Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Mctrl Class Reference

This class is an TLM 2.0 Model of the Aeroflex Gaisler GRLIB mctrl. Further informations to the original VHDL Modle are available in the GRLIB IP Core User's Manual Section 66. More...

#include <mctrl.h>

Inheritance diagram for Mctrl:
Collaboration diagram for Mctrl:

Public Member Functions

 SC_HAS_PROCESS (Mctrl)
 
 SR_HAS_SIGNALS (Mctrl)
 
 Mctrl (sc_module_name name, int romasel=28, int sdrasel=29, int romaddr=0x0, int rommask=0xE00, int ioaddr=0x200, int iomask=0xE00, int ramaddr=0x400, int rammask=0xC00, int paddr=0x0, int pmask=0xFFF, int wprot=0, int srbanks=4, int ram8=0, int ram16=0, int sepbus=0, int sdbits=32, int mobile=0, int sden=0, unsigned int hindex=0, unsigned int pindex=0, bool powmon=false, AbstractionLayer ambaLayer=amba::amba_LT)
 
 ~Mctrl ()
 Default destructor. More...
 
void init_generics ()
 Initialize generics. More...
 
void init_registers ()
 Initialize registers. More...
 
 GC_HAS_CALLBACKS ()
 proclamation of callbacks More...
 
void end_of_elaboration ()
 Execute the callback registering when systemc reaches the end of elaboration. More...
 
void start_of_simulation ()
 Gathers information about the connected memory types when SystemC reaches the start of simulation. More...
 
void power_model ()
 Calculate power/energy values from normalized input data. More...
 
gs::cnf::callback_return_type sta_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Static power callback. More...
 
gs::cnf::callback_return_type int_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Internal power callback. More...
 
gs::cnf::callback_return_type swi_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Switching power callback. More...
 
void end_of_simulation ()
 
sc_core::sc_time get_clock ()
 Returns clock cycle time from child. More...
 
void dorst ()
 
void launch_sdram_command ()
 
void switch_power_mode ()
 
void mcfg1_write ()
 
void mcfg2_write ()
 
uint32_t exec_func (tlm::tlm_generic_payload &trans, sc_core::sc_time &delay, bool debug=false)
 Encapsulation function for functional part of the model. More...
 
uint32_t transport_dbg (tlm_generic_payload &gp)
 
bool get_direct_mem_ptr (tlm::tlm_generic_payload &trans, tlm::tlm_dmi &dmi_data)
 
void invalidate_direct_mem_ptr (unsigned int index, sc_dt::uint64 start_range, sc_dt::uint64 end_range)
 
- Public Member Functions inherited from AHBSlave< APBSlave >
 SC_HAS_PROCESS (AHBSlave)
 
 AHBSlave (ModuleName mn, 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())
 
 ~AHBSlave ()
 
virtual uint32_t exec_func (tlm::tlm_generic_payload &gp, sc_time &delay, bool debug=false)=0
 Interface to functional part of the model. More...
 
virtual void b_transport (tlm::tlm_generic_payload &gp, sc_time &delay)
 TLM blocking transport functions. More...
 
virtual uint32_t transport_dbg (tlm::tlm_generic_payload &gp)
 TLM debug transport function. More...
 
virtual tlm::tlm_sync_enum nb_transport_fw (tlm::tlm_generic_payload &trans, tlm::tlm_phase &phase, sc_core::sc_time &delay)
 TLM non-blocking transport function. More...
 
void requestThread ()
 Accept new transaction (busy or not) More...
 
void responseThread ()
 Thread for interfacing functional part of the model in AT mode. 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< APBSlave >
 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 APBSlave
 APBSlave (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)
 
 APBSlave (ModuleName mn)
 
 ~APBSlave ()
 
- Public Member Functions inherited from APBDevice< BaseModule< DefaultBase > >
 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 BaseModule< DefaultBase >
 BaseModule (ModuleName mn)
 
virtual ~BaseModule ()
 
virtual void init_counters ()
 
virtual void init_power ()
 
- Public Member Functions inherited from APBDeviceBase
virtual ~APBDeviceBase ()
 Empty destructor. More...
 
- Public Member Functions inherited from AHBDeviceBase
virtual ~AHBDeviceBase ()
 Empty destructor. More...
 
- Public Member Functions inherited from CLKDevice
 SR_HAS_SIGNALS (CLKDevice)
 
 CLKDevice ()
 
virtual ~CLKDevice ()
 
virtual void onrst (const bool &value, const sc_core::sc_time &time)
 
virtual void onclk (const sc_core::sc_time &value, const sc_core::sc_time &time)
 
void set_clk (sc_core::sc_clock &clk)
 
void set_clk (sc_core::sc_time period)
 
void set_clk (double period, sc_core::sc_time_unit base)
 
virtual void clkcng ()
 

Public Attributes

gs::socket::initiator_multi_socket< 32 > mem
 
- Public Attributes inherited from AHBSlave< APBSlave >
::amba::amba_slave_socket< 32 > ahb
 
tlm_utils::peq_with_get
< tlm::tlm_generic_payload > 
m_RequestPEQ
 Event queues for AT mode. More...
 
tlm_utils::peq_with_get
< tlm::tlm_generic_payload > 
m_ResponsePEQ
 
- Public Attributes inherited from APBSlave
sr_register_bank< unsigned int,
unsigned int
r
 
APBSlaveSocket< 32, unsigned
int, unsigned int
apb
 
- Public Attributes inherited from CLKDevice
signal< bool >::in rst
 Reset input signal. More...
 
signal< sc_core::sc_time >::in clk
 Clock input signal. More...
 

Static Public Attributes

static const uint32_t MCFG1 = 0x00
 
static const uint32_t MCFG2 = 0x04
 
static const uint32_t MCFG3 = 0x08
 
static const uint32_t MCFG4 = 0x0C
 
static const uint32_t MCFG1_WRITE_MASK = 0x1FE808FF
 
static const uint32_t MCFG1_IOBUSW = 0x18000000
 
static const uint32_t MCFG1_IBRDY = 0x04000000
 
static const uint32_t MCFG1_BEXCN = 0x02000000
 
static const uint32_t MCFG1_IO_WAITSTATES = 0x01E00000
 
static const uint32_t MCFG1_IOEN = 0x00080000
 
static const uint32_t MCFG1_PWEN = 0x00000800
 
static const uint32_t MCFG1_PROM_WIDTH = 0x00000300
 
static const uint32_t MCFG1_IO_WIDTH = 0x18000000
 
static const uint32_t MCFG1_PROM_WRITE_WS = 0x000000F0
 
static const uint32_t MCFG1_PROM_READ_WS = 0x0000000F
 
static const uint32_t MCFG2_WRITE_MASK = 0xFFD07EFF
 
static const uint32_t MCFG2_SDRF = 0x80000000
 
static const uint32_t MCFG2_TRP = 0x40000000
 
static const uint32_t MCFG2_SDRAM_TRFC = 0x38000000
 
static const uint32_t MCFG2_TCAS = 0x04000000
 
static const uint32_t MCFG2_SDRAM_BANKSZ = 0x03800000
 
static const uint32_t MCFG2_SDRAM_COSZ = 0x00600000
 
static const uint32_t MCFG2_SDRAM_CMD = 0x00180000
 
static const uint32_t MCFG2_D64 = 0x00040000
 
static const uint32_t MCFG2_MS = 0x00010000
 
static const uint32_t MCFG2_SE = 0x00004000
 
static const uint32_t MCFG2_SI = 0x00002000
 
static const uint32_t MCFG2_RAM_BANK_SIZE = 0x00001E00
 
static const uint32_t MCFG2_RBRDY = 0x00000080
 
static const uint32_t MCFG2_RMW = 0x00000040
 
static const uint32_t MCFG2_RAM_WIDTH = 0x00000030
 
static const uint32_t MCFG2_RAM_WRITE_WS = 0x0000000C
 
static const uint32_t MCFG2_RAM_READ_WS = 0x00000003
 
static const uint32_t MCFG3_WRITE_MASK = 0x07FFF000
 
static const uint32_t MCFG3_SDRAM_RLD_VAL = 0x07FFF000
 
static const uint32_t MCFG4_WRITE_MASK = 0xE0F7007F
 
static const uint32_t MCFG4_ME = 0x80000000
 
static const uint32_t MCFG4_CE = 0x40000000
 
static const uint32_t MCFG4_EM = 0x20000000
 
static const uint32_t MCFG4_TXSR = 0x00F00000
 
static const uint32_t MCFG4_PMODE = 0x00070000
 
static const uint32_t MCFG4_DC = 0x00000060
 
static const uint32_t MCFG4_TCSR = 0x00000018
 
static const uint32_t MCFG4_PASR = 0x00000007
 
static const uint32_t MCFG1_IOBUSW_DEFAULT = 0x18000000
 
static const uint32_t MCFG1_IBRDY_DEFAULT = 0x00000000
 
static const uint32_t MCFG1_BEXCN_DEFAULT = 0x00000000
 
static const uint32_t MCFG1_IO_WAITSTATES_DEFAULT = 0x00000000
 
static const uint32_t MCFG1_IOEN_DEFAULT = 0x00000000
 
static const uint32_t MCFG1_PWEN_DEFAULT = 0x00000000
 
static const uint32_t MCFG1_PROM_WIDTH_DEFAULT = 0x00000300
 
static const uint32_t MCFG1_PROM_WRITE_WS_DEFAULT = 0x000000F0
 
static const uint32_t MCFG1_PROM_READ_WS_DEFAULT = 0x0000000F
 
static const uint32_t MCFG1_DEFAULT = 0x180003FF
 
static const uint32_t MCFG2_SDRF_DEFAULT = 0x80000000
 
static const uint32_t MCFG2_TRP_DEFAULT = 0x40000000
 
static const uint32_t MCFG2_SDRAM_TRFC_DEFAULT = 0x38000000
 
static const uint32_t MCFG2_TCAS_DEFAULT = 0x04000000
 
static const uint32_t MCFG2_SDRAM_BANKSZ_DEFAULT = 0x03000000
 
static const uint32_t MCFG2_SDRAM_COSZ_DEFAULT = 0x00600000
 
static const uint32_t MCFG2_SDRAM_CMD_DEFAULT = 0x00000000
 
static const uint32_t MCFG2_D64_DEFAULT = 0x00000000
 
static const uint32_t MCFG2_MS_DEFAULT = 0x00000000
 
static const uint32_t MCFG2_SE_DEFAULT = 0x00000000
 
static const uint32_t MCFG2_SI_DEFAULT = 0x00000000
 
static const uint32_t MCFG2_RAM_BANK_SIZE_DEFAULT = 0x00001C00
 
static const uint32_t MCFG2_RBRDY_DEFAULT = 0x00000000
 
static const uint32_t MCFG2_RMW_DEFAULT = 0x00000000
 
static const uint32_t MCFG2_RAM_WIDTH_DEFAULT = 0x00000030
 
static const uint32_t MCFG2_RAM_WRITE_WS_DEFAULT = 0x0000000C
 
static const uint32_t MCFG2_RAM_READ_WS_DEFAULT = 0x00000003
 
static const uint32_t MCFG2_DEFAULT = 0xFF601C3F
 
static const uint32_t MCFG3_DEFAULT = 0x07FFF000
 
static const uint32_t MCFG4_ME_DEFAULT = 0x00000000
 
static const uint32_t MCFG4_CE_DEFAULT = 0x00000000
 
static const uint32_t MCFG4_EM_DEFAULT = 0x00000000
 
static const uint32_t MCFG4_TXSR_DEFAULT = 0x00F00000
 
static const uint32_t MCFG4_PMODE_DEFAULT = 0x00000000
 
static const uint32_t MCFG4_DS_DEFAULT = 0x00000000
 
static const uint32_t MCFG4_TCSR_DEFAULT = 0x00000000
 
static const uint32_t MCFG4_PASR_DEFAULT = 0x00000000
 
static const uint32_t MCFG4_DEFAULT = 0x00F00000
 

Additional Inherited Members

- Protected Attributes inherited from AHBSlave< APBSlave >
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...
 
- Protected Attributes inherited from AHBDevice< APBSlave >
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
 
- Protected Attributes inherited from APBDevice< BaseModule< DefaultBase > >
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
 
- Protected Attributes inherited from BaseModule< DefaultBase >
ParameterAPIm_api
 Internal module gs param api instance. More...
 
ParameterArray m_generics
 Configuration generic container. More...
 
ParameterArray m_counters
 Performance counter container. More...
 
ParameterArray m_power
 Power counters container. More...
 
- Protected Attributes inherited from CLKDevice
sc_core::sc_time clock_cycle
 

Detailed Description

This class is an TLM 2.0 Model of the Aeroflex Gaisler GRLIB mctrl. Further informations to the original VHDL Modle are available in the GRLIB IP Core User's Manual Section 66.


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