Transaction-Level Modeling Framework for Space Applications
This class is a base class for grlib models. It implements the device plug and play informations. Together with the AHBCtrl class it implements the plug and play feature of the grlib. More...
#include <ahbdevice.h>
Public Member Functions | |
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_t * | get_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... | |
virtual void | transport_statistics (tlm::tlm_generic_payload &gp) throw () |
Collect common transport statistics. More... | |
Public Member Functions inherited from AHBDeviceBase | |
virtual | ~AHBDeviceBase () |
Empty destructor. More... | |
This class is a base class for grlib models. It implements the device plug and play informations. Together with the AHBCtrl class it implements the plug and play feature of the grlib.
All simulation models that are supposed to be connected to the TLM AHBCTRL must be derived from the class AHBDevice. Usually, this is indirectly done by inheriting from the AHBMaster or AHBSlave classes. The Aeroflex Gaisler AHBCTRL implements a Plug & Play mechanism, which relies on configuration information that is collected from the attached masters and slaves. AHBDevice models the respective configuration data records. The structure of these records is described in GRLIB IP Core User’s Manual. At start_of_simulation the TLM AHBCTRL iterates through all connected modules to retrieve AHB bar & mask and build up its internal routing table.
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() |
||
) |
All device informations are needed while constructing a device. The register content is formed here.
AHBDevice< BASE >::AHBDevice | ( | ModuleName | mn | ) |
All device informations are needed while constructing a device. The register content is formed here. Before ending the constructor of the subclass you have to call init!
Empty destructor.
|
virtual |
Returns the Bus specific base address of the device. Returns the address of one bar in byte offset as seen from the bus.
bar | The selected bar |
Implements AHBDeviceBase.
|
virtual |
Returns the Bus specific most significant 12bit of the bar base address Shifted to the lowest bits in the word.
Implements AHBDeviceBase.
|
inline |
Returns whether a bar is cachable
bar | The selected bar |
|
virtual |
Returns the Bus specific mask of the most significant 12bit of the bar address Shifted to the lowest bits in the word.
Implements AHBDeviceBase.
|
inline |
Returns whether a bar is prefetchable
bar | The selected bar |
|
virtual |
Returns the size of one bar in bytes as seen from the bus.
bar | The selected bar |
Implements AHBDeviceBase.
|
virtual |
Returns the type of the bar.
bar | The selected bar |
Implements AHBDeviceBase.
|
virtual |
Implements AHBDeviceBase.
|
virtual |
Returns the Bus specific base address of the device. Legacy for AMBAKit Please use get_bar_address instead. It will work with gaps between slave areas.
Implements AHBDeviceBase.
|
virtual |
Returns the device id.
Implements AHBDeviceBase.
|
virtual |
Returns the device register file. A set of 8 registers as specified by the grlib manual. See section: 4.2.3 (Page 50)
Implements AHBDeviceBase.
|
virtual |
Returns the bus id of the module (hindex)
Implements AHBDeviceBase.
|
virtual |
Implements AHBDeviceBase.
|
virtual |
Returns the size of the hole device as seen from the bus. Legacy for AMBAKit Please use get_bar_size instead. It will work with gaps between the slave areas.
Implements AHBDeviceBase.
|
virtual |
Returns the vendor id.
Implements AHBDeviceBase.
void AHBDevice< BASE >::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() |
||
) |
All device informations missing by the second constructor. The register content is formed here.
|
virtual |
Prints the device info of the device.
Implements AHBDeviceBase.
|
virtual |
Collect common transport statistics.
Implements AHBDeviceBase.
Reimplemented in AHBMaster< BASE >, AHBMaster<>, AHBSlave< BASE >, AHBSlave<>, and AHBSlave< APBSlave >.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Impementation of the device register file.
Referenced by AHBDevice< APBSlave >::get_ahb_bar_cachable(), and AHBDevice< APBSlave >::get_ahb_bar_prefetchable().