Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Public Member Functions | Public Attributes | Protected Attributes | List of all members
AHBMaster< BASE > Class Template Referenceabstract

#include <ahbmaster.h>

Inheritance diagram for AHBMaster< BASE >:
Collaboration diagram for AHBMaster< BASE >:

Public Member Functions

 SC_HAS_PROCESS (AHBMaster)
 
 AHBMaster (ModuleName nm, uint8_t hindex, uint8_t vendor, uint8_t device, uint8_t version, uint8_t irq, AbstractionLayer ambaLayer, BAR bar0=BAR(), BAR bar1=BAR(), BAR bar2=BAR(), BAR bar3=BAR())
 Constructor. More...
 
 ~AHBMaster ()
 Destructor. More...
 
virtual void ahbread (uint32_t addr, unsigned char *data, uint32_t length)
 Read data from AHB (SC_ZERO_TIME version) More...
 
virtual void ahbwrite (uint32_t addr, unsigned char *data, uint32_t length)
 Write data to AHB (SC_ZERO_TIME version) More...
 
virtual void ahbread (uint32_t addr, unsigned char *data, uint32_t length, sc_core::sc_time &delay, bool &cacheable, tlm::tlm_response_status &response)
 Read data from AHB. More...
 
virtual void ahbread (uint32_t addr, unsigned char *data, uint32_t length, sc_core::sc_time &delay, bool &cacheable, bool is_lock, tlm::tlm_response_status &response)
 Read data from AHB. More...
 
virtual void ahbwrite (uint32_t addr, unsigned char *data, uint32_t length, sc_core::sc_time &delay, tlm::tlm_response_status &response)
 Write data to AHB. More...
 
virtual void ahbwrite (uint32_t addr, unsigned char *data, uint32_t length, sc_core::sc_time &delay, bool is_lock, tlm::tlm_response_status &response)
 Write data to AHB. More...
 
virtual void ahbaccess (tlm::tlm_generic_payload *trans)
 Generic AHB access function (blocking and non-blocking) More...
 
virtual uint32_t ahbaccess_dbg (tlm::tlm_generic_payload *trans)
 Generic AHB debug access function. More...
 
virtual uint32_t ahbread_dbg (uint32_t addr, unsigned char *data, uint32_t length)
 Debug read from AHB. More...
 
virtual uint32_t ahbwrite_dbg (uint32_t addr, unsigned char *data, uint32_t length)
 Debug write from AHB. More...
 
virtual void response_callback (tlm::tlm_generic_payload *trans)
 Function may be implemented by the child for payload checking (e.g. testbench master) More...
 
virtual tlm::tlm_sync_enum nb_transport_bw (tlm::tlm_generic_payload &payload, tlm::tlm_phase &phase, sc_core::sc_time &delay)
 TLM non-blocking backward transport function. More...
 
virtual sc_core::sc_time get_clock ()=0
 Returns clock cycle time from master. More...
 
void ResponseThread ()
 Thread for response processing (read) More...
 
void DataThread ()
 Thread for processing data-phase of write transactions. More...
 
virtual void transport_statistics (tlm::tlm_generic_payload &gp) throw ()
 Collect common transport statistics. More...
 
virtual void print_transport_statistics (const char *name) const throw ()
 Print common transport statistics. More...
 
- Public Member Functions inherited from AHBDevice< BASE >
 AHBDevice (ModuleName mn, uint32_t hindex, uint8_t vendorid, uint16_t deviceid, uint8_t version, uint8_t irq, BAR bar0, BAR bar1=BAR(), BAR bar2=BAR(), BAR bar3=BAR())
 
 AHBDevice (ModuleName mn)
 
void init (uint32_t hindex, uint8_t vendorid, uint16_t deviceid, uint8_t version, uint8_t irq, BAR bar0, BAR bar1=BAR(), BAR bar2=BAR(), BAR bar3=BAR())
 
void init_ahb_generics ()
 
virtual ~AHBDevice ()
 Empty destructor. More...
 
virtual const uint16_t get_ahb_device_id () const throw ()
 Returns the device id. More...
 
virtual const uint8_t get_ahb_vendor_id () const throw ()
 Returns the vendor id. More...
 
virtual const uint32_tget_ahb_device_info () throw ()
 
virtual const uint32_t get_ahb_base_addr_ () const throw ()
 
virtual sc_dt::uint64 get_ahb_base_addr () throw ()
 
virtual const uint32_t get_ahb_size_ () const throw ()
 
virtual sc_dt::uint64 get_ahb_size () throw ()
 
virtual const AMBADeviceType get_ahb_bar_type (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_base (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_mask (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_addr (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_size (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_relative_addr (uint32_t bar, uint32_t addr) const throw ()
 
const bool get_ahb_bar_prefetchable (uint32_t bar) const throw ()
 
const bool get_ahb_bar_cachable (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_hindex () const throw ()
 Returns the bus id of the module (hindex) More...
 
virtual void print_ahb_device_info (char *name) const
 Prints the device info of the device. More...
 
- Public Member Functions inherited from AHBDeviceBase
virtual ~AHBDeviceBase ()
 Empty destructor. More...
 

Public Attributes

amba::amba_master_socket< 32 > ahb
 The AHB master socketo. More...
 

Protected Attributes

tlm_utils::peq_with_get
< tlm::tlm_generic_payload > 
m_ResponsePEQ
 PEQs for response synchronization. More...
 
sc_event m_EndRequestEvent
 Events for phase notifications. More...
 
AbstractionLayer m_ambaLayer
 The abstraction layer of the instance (LT or AT) More...
 
sr_param< uint64_tm_reads
 Stores the number of Bytes read from the device. More...
 
sr_param< uint64_tm_writes
 Stores the number of Bytes written from the device. More...
 
bool response_error
 
- Protected Attributes inherited from AHBDevice< BASE >
uint32_t m_register [8]
 Impementation of the device register file. More...
 
ParameterArray g_bars
 
ParameterArray g_bar0
 
ParameterArray g_bar1
 
ParameterArray g_bar2
 
ParameterArray g_bar3
 
sr_param< uint32_tg_hindex
 
sr_param< uint8_tg_hvendorid
 
sr_param< uint16_tg_hdeviceid
 
sr_param< uint8_tg_hversion
 
sr_param< uint8_tg_hirq
 
sr_param< uint32_tg_bar0haddr
 
sr_param< uint32_tg_bar0hmask
 
sr_param< uint32_tg_bar0htype
 
sr_param< boolg_bar0hcacheable
 
sr_param< boolg_bar0hprefetchable
 
sr_param< uint32_tg_bar1haddr
 
sr_param< uint32_tg_bar1hmask
 
sr_param< uint32_tg_bar1htype
 
sr_param< boolg_bar1hcacheable
 
sr_param< boolg_bar1hprefetchable
 
sr_param< uint32_tg_bar2haddr
 
sr_param< uint32_tg_bar2hmask
 
sr_param< uint32_tg_bar2htype
 
sr_param< boolg_bar2hcacheable
 
sr_param< boolg_bar2hprefetchable
 
sr_param< uint32_tg_bar3haddr
 
sr_param< uint32_tg_bar3hmask
 
sr_param< uint32_tg_bar3htype
 
sr_param< boolg_bar3hcacheable
 
sr_param< boolg_bar3hprefetchable
 

Detailed Description

template<class BASE = BaseModule<DefaultBase>>
class AHBMaster< BASE >

Almost all models implementing an AHB master interface (except busses) are derived from class AHBMaster. AHBMaster is a convenience class providing an AHB master socket and implementations of various access functions for reading/writing data over the bus. AHBMaster inherits AHBDevice and can be configured for loosely timed (LT) or approximately timed (AT) level of abstraction.

An overview about how to build own components based on AHBMaster is given in Extending the Library.

Constructor & Destructor Documentation

template<class BASE = BaseModule<DefaultBase>>
AHBMaster< BASE >::AHBMaster ( ModuleName  nm,
uint8_t  hindex,
uint8_t  vendor,
uint8_t  device,
uint8_t  version,
uint8_t  irq,
AbstractionLayer  ambaLayer,
BAR  bar0 = BAR(),
BAR  bar1 = BAR(),
BAR  bar2 = BAR(),
BAR  bar3 = BAR() 
)

Constructor.

template<class BASE = BaseModule<DefaultBase>>
AHBMaster< BASE >::~AHBMaster ( )

Destructor.

Member Function Documentation

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::ahbaccess ( tlm::tlm_generic_payload *  trans)
virtual

Generic AHB access function (blocking and non-blocking)

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t AHBMaster< BASE >::ahbaccess_dbg ( tlm::tlm_generic_payload *  trans)
virtual

Generic AHB debug access function.

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::ahbread ( uint32_t  addr,
unsigned char data,
uint32_t  length 
)
virtual

Read data from AHB (SC_ZERO_TIME version)

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::ahbread ( uint32_t  addr,
unsigned char data,
uint32_t  length,
sc_core::sc_time &  delay,
bool cacheable,
tlm::tlm_response_status &  response 
)
virtual

Read data from AHB.

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::ahbread ( uint32_t  addr,
unsigned char data,
uint32_t  length,
sc_core::sc_time &  delay,
bool cacheable,
bool  is_lock,
tlm::tlm_response_status &  response 
)
virtual

Read data from AHB.

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t AHBMaster< BASE >::ahbread_dbg ( uint32_t  addr,
unsigned char data,
uint32_t  length 
)
virtual

Debug read from AHB.

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::ahbwrite ( uint32_t  addr,
unsigned char data,
uint32_t  length 
)
virtual

Write data to AHB (SC_ZERO_TIME version)

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::ahbwrite ( uint32_t  addr,
unsigned char data,
uint32_t  length,
sc_core::sc_time &  delay,
tlm::tlm_response_status &  response 
)
virtual

Write data to AHB.

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::ahbwrite ( uint32_t  addr,
unsigned char data,
uint32_t  length,
sc_core::sc_time &  delay,
bool  is_lock,
tlm::tlm_response_status &  response 
)
virtual

Write data to AHB.

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t AHBMaster< BASE >::ahbwrite_dbg ( uint32_t  addr,
unsigned char data,
uint32_t  length 
)
virtual

Debug write from AHB.

template<class BASE = BaseModule<DefaultBase>>
void AHBMaster< BASE >::DataThread ( )

Thread for processing data-phase of write transactions.

template<class BASE = BaseModule<DefaultBase>>
virtual sc_core::sc_time AHBMaster< BASE >::get_clock ( )
pure virtual

Returns clock cycle time from master.

Implemented in mmu_cache_base, and AHBIn.

template<class BASE = BaseModule<DefaultBase>>
virtual tlm::tlm_sync_enum AHBMaster< BASE >::nb_transport_bw ( tlm::tlm_generic_payload &  payload,
tlm::tlm_phase &  phase,
sc_core::sc_time &  delay 
)
virtual

TLM non-blocking backward transport function.

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::print_transport_statistics ( const char name) const
throw (
)
virtual

Print common transport statistics.

template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::response_callback ( tlm::tlm_generic_payload *  trans)
inlinevirtual

Function may be implemented by the child for payload checking (e.g. testbench master)

Reimplemented in mmu_cache_base.

template<class BASE = BaseModule<DefaultBase>>
void AHBMaster< BASE >::ResponseThread ( )

Thread for response processing (read)

template<class BASE = BaseModule<DefaultBase>>
AHBMaster< BASE >::SC_HAS_PROCESS ( AHBMaster< BASE )
template<class BASE = BaseModule<DefaultBase>>
virtual void AHBMaster< BASE >::transport_statistics ( tlm::tlm_generic_payload &  gp)
throw (
)
virtual

Collect common transport statistics.

Reimplemented from AHBDevice< BASE >.

Member Data Documentation

template<class BASE = BaseModule<DefaultBase>>
amba::amba_master_socket<32> AHBMaster< BASE >::ahb

The AHB master socketo.

Referenced by sc_main().

template<class BASE = BaseModule<DefaultBase>>
AbstractionLayer AHBMaster< BASE >::m_ambaLayer
protected

The abstraction layer of the instance (LT or AT)

template<class BASE = BaseModule<DefaultBase>>
sc_event AHBMaster< BASE >::m_EndRequestEvent
protected

Events for phase notifications.

template<class BASE = BaseModule<DefaultBase>>
sr_param<uint64_t> AHBMaster< BASE >::m_reads
protected

Stores the number of Bytes read from the device.

template<class BASE = BaseModule<DefaultBase>>
tlm_utils::peq_with_get<tlm::tlm_generic_payload> AHBMaster< BASE >::m_ResponsePEQ
protected

PEQs for response synchronization.

template<class BASE = BaseModule<DefaultBase>>
sr_param<uint64_t> AHBMaster< BASE >::m_writes
protected

Stores the number of Bytes written from the device.

template<class BASE = BaseModule<DefaultBase>>
bool AHBMaster< BASE >::response_error
protected

The documentation for this class was generated from the following file: