Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
mmu_cache_base Class Referenceabstract

Top-level class of the memory sub-system for the TrapGen LEON3 simulator. More...

#include <mmu_cache_base.h>

Inheritance diagram for mmu_cache_base:
Collaboration diagram for mmu_cache_base:

Public Member Functions

 GC_HAS_CALLBACKS ()
 
 SC_HAS_PROCESS (mmu_cache_base)
 
 SR_HAS_SIGNALS (mmu_cache_base)
 
 mmu_cache_base (ModuleName name="", bool icen=true, uint32_t irepl=1, uint32_t isets=4, uint32_t ilinesize=8, uint32_t isetsize=8, uint32_t isetlock=true, uint32_t dcen=true, uint32_t drepl=1, uint32_t dsets=2, uint32_t dlinesize=4, uint32_t dsetsize=8, bool dsetlock=true, bool dsnoop=true, bool ilram=false, uint32_t ilramsize=0x000, uint32_t ilramstart=0x000, uint32_t dlram=false, uint32_t dlramsize=0x000, uint32_t dlramstart=0x000, uint32_t cached=0, bool mmu_en=true, uint32_t itlb_num=8, uint32_t dtlb_num=8, uint32_t tlb_type=0, uint32_t tlb_rep=1, uint32_t mmupgsz=0, uint32_t hindex=0, bool pow_mon=false, AbstractionLayer ambaLayer=amba::amba_LT)
 Constructor of the top-level class of the memory sub-system (caches and mmu). More...
 
 ~mmu_cache_base ()
 
virtual void exec_instr (const unsigned int &addr, unsigned char *ptr, unsigned int asi, unsigned int *debug, const unsigned int &flush, sc_core::sc_time &delay, bool is_dbg)
 Instruction interface to functional part of the model. More...
 
virtual void exec_data (const tlm::tlm_command cmd, const unsigned int &addr, unsigned char *ptr, unsigned int len, unsigned int asi, unsigned int *debug, unsigned int flush, unsigned int lock, sc_core::sc_time &delay, bool is_dbg, tlm::tlm_response_status &response)
 Data interface to functional part of the model. More...
 
virtual void response_callback (tlm::tlm_generic_payload *trans)
 Called from AHB master to signal begin response. More...
 
virtual void mem_write (unsigned int addr, unsigned int asi, unsigned char *data, unsigned int length, sc_core::sc_time *t, unsigned int *debug, bool is_dbg, bool &cacheable, bool is_lock)
 MemIF implementation - writes data to AHB master. More...
 
virtual bool mem_read (unsigned int addr, unsigned int asi, unsigned char *data, unsigned int length, sc_core::sc_time *t, unsigned int *debug, bool is_dbg, bool &cacheable, bool is_lock)
 MemIF implementation - reads data from AHB master. More...
 
virtual void set_irq (uint32_t tt)
 Send an interrupt over the central IRQ interface. More...
 
virtual void trigger_exception (unsigned int exception)=0
 Sent an exception to the CPU. More...
 
void write_ccr (unsigned char *data, unsigned int len, sc_core::sc_time *delay, unsigned int *debug, bool is_dbg)
 Writes the cache control register. More...
 
virtual unsigned int read_ccr (bool internal)
 Read the cache control register. More...
 
void snoopingCallBack (const t_snoop &snoop, const sc_core::sc_time &delay)
 Snooping function (For calling dcache->snoop_invalidate) More...
 
void start_of_simulation ()
 Automatically called at the beginning of the 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 ()
 Called at end of simulation to print execution statistics. More...
 
void dorst ()
 Reset function. More...
 
void clkcng ()
 Deal with clock changes. More...
 
sc_core::sc_time get_clock ()
 Return clock period (for ahb interface) More...
 
- Public Member Functions inherited from AHBMaster<>
 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 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)
 Write data to AHB (SC_ZERO_TIME version) 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 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...
 
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< BaseModule< DefaultBase > >
 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 BaseModule< DefaultBase >
 BaseModule (ModuleName mn)
 
virtual ~BaseModule ()
 
virtual void init_generics ()
 
virtual void init_registers ()
 
virtual void init_counters ()
 
virtual void init_power ()
 
- Public Member Functions inherited from AHBDeviceBase
virtual ~AHBDeviceBase ()
 Empty destructor. More...
 
- Public Member Functions inherited from mmu_cache_if
virtual ~mmu_cache_if ()
 
- Public Member Functions inherited from mem_if
virtual ~mem_if ()
 
- 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)
 

Public Attributes

signal< t_snoop >::in snoop
 
signal< std::pair< uint32_t,
bool > >::out 
irq
 
cache_ificache
 instruction cache pointer More...
 
cache_ifdcache
 data cache pointer More...
 
mmum_mmu
 mmu poiner More...
 
localramilocalram
 instruction scratchpad pointer More...
 
localramdlocalram
 data scratchpad pointer More...
 
- Public Attributes inherited from AHBMaster<>
amba::amba_master_socket< 32 > ahb
 The AHB master socketo. More...
 
- Public Attributes inherited from CLKDevice
signal< bool >::in rst
 Reset input signal. More...
 
signal< sc_core::sc_time >::in clk
 Clock input signal. More...
 

Protected Member Functions

void mem_access ()
 

Protected Attributes

unsigned int CACHE_CONTROL_REG
 
unsigned int m_icen
 icache enable More...
 
unsigned int m_dcen
 dcache enabled More...
 
unsigned int m_dsnoop
 dcache snooping enabled More...
 
unsigned int m_ilram
 instruction scratchpad enabled More...
 
unsigned int m_ilramstart
 instruction scratchpad starting address More...
 
unsigned int m_dlram
 data scratchpad enabled More...
 
unsigned int m_dlramstart
 data scratchpad starting address More...
 
unsigned int m_cached
 enables fixed cacheability mask More...
 
unsigned int m_mmu_en
 mmu enabled More...
 
unsigned int m_master_id
 amba master id More...
 
unsigned char write_buf [1024]
 
unsigned int wb_pointer
 
sc_event bus_read_completed
 
tlm::tlm_fifo
< tlm::tlm_generic_payload * > 
bus_in_fifo
 
sr_param< uint64_tm_right_transactions
 Total number of successful transactions for execution statistics. More...
 
sr_param< uint64_tm_total_transactions
 Total number of transactions for execution statistics. More...
 
bool m_pow_mon
 power monitoring enabled More...
 
AbstractionLayer m_abstractionLayer
 amba abstraction layer More...
 
sc_event ahb_response_event
 begin response signal for AT More...
 
sr_param< doublesta_power_norm
 Normalized static power of controller. More...
 
sr_param< doubleint_power_norm
 Normalized internal power of controller. More...
 
sr_param< doubledyn_read_energy_norm
 Normalized read access energy. More...
 
sr_param< doubledyn_write_energy_norm
 Normalized write access energy. More...
 
sr_param< doublesta_power
 Controller static power. More...
 
sr_param< doubleint_power
 Controller internal power. More...
 
sr_param< doubleswi_power
 Controller switching power. More...
 
sr_param< sc_core::sc_time > power_frame_starting_time
 Power frame starting time. More...
 
sr_param< doubledyn_read_energy
 Dynamic energy per read access. More...
 
sr_param< doubledyn_write_energy
 Dynamic energy per write access. More...
 
sr_param< uint64_tdyn_reads
 Number of reads from memory (read & reset by monitor) More...
 
sr_param< uint64_tdyn_writes
 Number of writes to memory (read & reset by monitor) More...
 
uint64_t globl_count
 
- Protected Attributes inherited from AHBMaster<>
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< BaseModule< DefaultBase > >
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 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

Top-level class of the memory sub-system for the TrapGen LEON3 simulator.

Member Function Documentation

mmu_cache_base::GC_HAS_CALLBACKS ( )
mmu_cache_base::SC_HAS_PROCESS ( mmu_cache_base  )
mmu_cache_base::SR_HAS_SIGNALS ( mmu_cache_base  )
virtual void mmu_cache_base::trigger_exception ( unsigned int  exception)
pure virtual

Sent an exception to the CPU.

Reimplemented from mmu_cache_if.

Implemented in Leon3.

Member Data Documentation

sc_event mmu_cache_base::ahb_response_event
protected

begin response signal for AT

Referenced by mem_access(), and response_callback().

tlm::tlm_fifo<tlm::tlm_generic_payload *> mmu_cache_base::bus_in_fifo
protected

Referenced by mem_access(), mem_read(), and mem_write().

sc_event mmu_cache_base::bus_read_completed
protected

Referenced by mem_access(), and mem_read().

unsigned int mmu_cache_base::CACHE_CONTROL_REG
protected

Referenced by mmu_cache_base(), read_ccr(), and write_ccr().

cache_if* mmu_cache_base::dcache
localram* mmu_cache_base::dlocalram

data scratchpad pointer

Referenced by clkcng(), exec_data(), and mmu_cache_base().

sr_param<double> mmu_cache_base::dyn_read_energy
protected

Dynamic energy per read access.

Referenced by power_model(), and swi_power_cb().

sr_param<double> mmu_cache_base::dyn_read_energy_norm
protected

Normalized read access energy.

Referenced by power_model().

sr_param<uint64_t> mmu_cache_base::dyn_reads
protected

Number of reads from memory (read & reset by monitor)

Referenced by mmu_cache::exec_data(), mmu_cache::exec_instr(), and swi_power_cb().

sr_param<double> mmu_cache_base::dyn_write_energy
protected

Dynamic energy per write access.

Referenced by power_model(), and swi_power_cb().

sr_param<double> mmu_cache_base::dyn_write_energy_norm
protected

Normalized write access energy.

Referenced by power_model().

sr_param<uint64_t> mmu_cache_base::dyn_writes
protected

Number of writes to memory (read & reset by monitor)

Referenced by mmu_cache::exec_data(), and swi_power_cb().

uint64_t mmu_cache_base::globl_count
protected
cache_if* mmu_cache_base::icache

instruction cache pointer

Referenced by clkcng(), exec_data(), mmu_cache::exec_instr(), exec_instr(), mmu_cache_base(), and write_ccr().

localram* mmu_cache_base::ilocalram

instruction scratchpad pointer

Referenced by clkcng(), exec_data(), exec_instr(), and mmu_cache_base().

sr_param<double> mmu_cache_base::int_power
protected

Controller internal power.

Referenced by mmu_cache_base(), and power_model().

sr_param<double> mmu_cache_base::int_power_norm
protected

Normalized internal power of controller.

Referenced by power_model().

signal<std::pair<uint32_t, bool> >::out mmu_cache_base::irq

Referenced by set_irq().

AbstractionLayer mmu_cache_base::m_abstractionLayer
protected

amba abstraction layer

Referenced by mem_access().

unsigned int mmu_cache_base::m_cached
protected

enables fixed cacheability mask

Referenced by mem_read(), and mmu_cache_base().

unsigned int mmu_cache_base::m_dcen
protected

dcache enabled

Referenced by clkcng(), and snoopingCallBack().

unsigned int mmu_cache_base::m_dlram
protected

data scratchpad enabled

Referenced by exec_data().

unsigned int mmu_cache_base::m_dlramstart
protected

data scratchpad starting address

Referenced by exec_data().

unsigned int mmu_cache_base::m_dsnoop
protected

dcache snooping enabled

Referenced by snoopingCallBack().

unsigned int mmu_cache_base::m_icen
protected

icache enable

Referenced by clkcng().

unsigned int mmu_cache_base::m_ilram
protected

instruction scratchpad enabled

Referenced by exec_data(), and exec_instr().

unsigned int mmu_cache_base::m_ilramstart
protected

instruction scratchpad starting address

Referenced by exec_data(), and exec_instr().

unsigned int mmu_cache_base::m_master_id
protected

amba master id

Referenced by snoopingCallBack().

mmu* mmu_cache_base::m_mmu

mmu poiner

Referenced by clkcng(), exec_data(), and mmu_cache_base().

unsigned int mmu_cache_base::m_mmu_en
protected

mmu enabled

Referenced by clkcng(), and exec_data().

bool mmu_cache_base::m_pow_mon
protected
sr_param<uint64_t> mmu_cache_base::m_right_transactions
protected

Total number of successful transactions for execution statistics.

Referenced by end_of_simulation().

sr_param<uint64_t> mmu_cache_base::m_total_transactions
protected

Total number of transactions for execution statistics.

Referenced by end_of_simulation().

sr_param<sc_core::sc_time> mmu_cache_base::power_frame_starting_time
protected

Power frame starting time.

Referenced by swi_power_cb().

signal<t_snoop>::in mmu_cache_base::snoop

Referenced by sc_main().

sr_param<double> mmu_cache_base::sta_power
protected

Controller static power.

Referenced by mmu_cache_base(), and power_model().

sr_param<double> mmu_cache_base::sta_power_norm
protected

Normalized static power of controller.

Referenced by power_model().

sr_param<double> mmu_cache_base::swi_power
protected

Controller switching power.

Referenced by mmu_cache_base(), and swi_power_cb().

unsigned int mmu_cache_base::wb_pointer
protected

Referenced by mem_write(), and mmu_cache_base().

unsigned char mmu_cache_base::write_buf[1024]
protected

Referenced by mem_write().


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