Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Public Member Functions | Protected Attributes | List of all members
APBDevice< BASE > Class Template Reference

This class is a base class for grlib models. It implements the device plug and play informations. Together with the APBBridge class it implements the plug and play feature of the grlib. More...

#include <apbdevice.h>

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

Public Member Functions

 APBDevice (ModuleName mn, uint32_t bus_id, uint8_t vendorid, uint16_t deviceid, uint8_t version, uint8_t irq, AMBADeviceType type, uint16_t mask, bool cacheable, bool prefetchable, uint16_t address)
 
 APBDevice (ModuleName mn)
 
void init_apb (uint32_t pindex, uint8_t vendorid, uint16_t deviceid, uint8_t version, uint8_t irq, AMBADeviceType type, uint16_t mask, bool cacheable, bool prefetchable, uint16_t address)
 
void init_apb_generics ()
 Initialize the APBDevice generics. More...
 
virtual ~APBDevice ()
 Empty destructor. More...
 
virtual uint16_t get_apb_device_id () const
 Returns the device id. More...
 
virtual uint8_t get_apb_vendor_id () const
 Returns the vendor id. More...
 
virtual const uint32_tget_apb_device_info ()
 
virtual const AMBADeviceType get_apb_type () const
 
virtual uint32_t get_apb_base () const
 
virtual uint32_t get_apb_mask () const
 
virtual sc_dt::uint64 get_apb_base_addr ()
 
virtual uint32_t get_apb_base_addr_ () const
 
virtual sc_dt::uint64 get_apb_size ()
 
virtual uint32_t get_apb_size_ () const
 
virtual uint32_t get_apb_relative_addr (uint32_t addr) const
 
virtual uint32_t get_apb_pindex () const
 Returns the bus id of the module (pindex) More...
 
virtual void print_apb_device_info (char *name) const
 Prints the device info of the device. More...
 
- Public Member Functions inherited from APBDeviceBase
virtual ~APBDeviceBase ()
 Empty destructor. More...
 

Protected Attributes

uint32_t m_register [2]
 Impementation of the device register file. More...
 
sr_param< uint32_tg_pindex
 
sr_param< uint8_tg_pvendorid
 
sr_param< uint16_tg_pdeviceid
 
sr_param< uint8_tg_pversion
 
sr_param< uint8_tg_pirq
 
sr_param< uint32_tg_paddr
 
sr_param< uint32_tg_pmask
 
sr_param< uint32_tg_ptype
 
sr_param< boolg_pcacheable
 
sr_param< boolg_pprefetchable
 

Detailed Description

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

This class is a base class for grlib models. It implements the device plug and play informations. Together with the APBBridge class it implements the plug and play feature of the grlib.

All simulation models that are supposed to be connected to the TLM APBCTRL must be derived from class APBDevice. Similar to the concept of AHBDevice, the child inherits Plug & Play configuration records representing its device type and address. At start_of_simulation the APBCTRL iterates through the connected slaves collecting all APB bar and mask settings for building up its routing table.

Modules, like the MCTRL, which posses an AHB as well as an APB interface must be derived from AHBDevice and APBDevice.

See Also
APBCtrl

Constructor & Destructor Documentation

template<class BASE = BaseModule<DefaultBase>>
APBDevice< BASE >::APBDevice ( ModuleName  mn,
uint32_t  bus_id,
uint8_t  vendorid,
uint16_t  deviceid,
uint8_t  version,
uint8_t  irq,
AMBADeviceType  type,
uint16_t  mask,
bool  cacheable,
bool  prefetchable,
uint16_t  address 
)

All device informations are needed while constructing a device. The register content is formed here.

template<class BASE = BaseModule<DefaultBase>>
APBDevice< BASE >::APBDevice ( ModuleName  mn)
template<class BASE = BaseModule<DefaultBase>>
virtual APBDevice< BASE >::~APBDevice ( )
virtual

Empty destructor.

Member Function Documentation

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t APBDevice< BASE >::get_apb_base ( ) const
virtual

Returns the Bus specific most significant 12bit of the base address Shifted to the lowest bits in the word.

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual sc_dt::uint64 APBDevice< BASE >::get_apb_base_addr ( )
virtual

Returns the Bus specific base address of the device.

See Also
get_bar_addr
Returns
The device base address.

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t APBDevice< BASE >::get_apb_base_addr_ ( ) const
virtual

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual uint16_t APBDevice< BASE >::get_apb_device_id ( ) const
virtual

Returns the device id.

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual const uint32_t* APBDevice< BASE >::get_apb_device_info ( )
virtual

Returns the device register file. A set of 8 registers as specified by the grlib manual. See section: 14.2.2 (Page 79)

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t APBDevice< BASE >::get_apb_mask ( ) const
virtual

Returns the Bus specific mask of the most significant 12bit of the address Shifted to the lowest bits in the word.

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t APBDevice< BASE >::get_apb_pindex ( ) const
virtual

Returns the bus id of the module (pindex)

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t APBDevice< BASE >::get_apb_relative_addr ( uint32_t  addr) const
virtual

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual sc_dt::uint64 APBDevice< BASE >::get_apb_size ( )
virtual

Returns the size of the hole device as seen from the bus.

See Also
get_bar_size
Returns
The device size.

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual uint32_t APBDevice< BASE >::get_apb_size_ ( ) const
virtual

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual const AMBADeviceType APBDevice< BASE >::get_apb_type ( ) const
virtual

Returns the device type. Should be APBIO ;-)

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
virtual uint8_t APBDevice< BASE >::get_apb_vendor_id ( ) const
virtual

Returns the vendor id.

Implements APBDeviceBase.

template<class BASE = BaseModule<DefaultBase>>
void APBDevice< BASE >::init_apb ( uint32_t  pindex,
uint8_t  vendorid,
uint16_t  deviceid,
uint8_t  version,
uint8_t  irq,
AMBADeviceType  type,
uint16_t  mask,
bool  cacheable,
bool  prefetchable,
uint16_t  address 
)
template<class BASE = BaseModule<DefaultBase>>
void APBDevice< BASE >::init_apb_generics ( )

Initialize the APBDevice generics.

template<class BASE = BaseModule<DefaultBase>>
virtual void APBDevice< BASE >::print_apb_device_info ( char name) const
virtual

Prints the device info of the device.

Implements APBDeviceBase.

Member Data Documentation

template<class BASE = BaseModule<DefaultBase>>
sr_param<uint32_t> APBDevice< BASE >::g_paddr
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<bool> APBDevice< BASE >::g_pcacheable
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<uint16_t> APBDevice< BASE >::g_pdeviceid
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<uint32_t> APBDevice< BASE >::g_pindex
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<uint8_t> APBDevice< BASE >::g_pirq
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<uint32_t> APBDevice< BASE >::g_pmask
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<bool> APBDevice< BASE >::g_pprefetchable
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<uint32_t> APBDevice< BASE >::g_ptype
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<uint8_t> APBDevice< BASE >::g_pvendorid
protected
template<class BASE = BaseModule<DefaultBase>>
sr_param<uint8_t> APBDevice< BASE >::g_pversion
protected
template<class BASE = BaseModule<DefaultBase>>
uint32_t APBDevice< BASE >::m_register[2]
protected

Impementation of the device register file.


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