Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Files | Functions
Mmu_cache_base

Files

file  mmu_cache_base.cpp
 

Functions

 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::~mmu_cache_base ()
 
void mmu_cache_base::dorst ()
 Reset function. More...
 
virtual void mmu_cache_base::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 mmu_cache_base::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 mmu_cache_base::response_callback (tlm::tlm_generic_payload *trans)
 Called from AHB master to signal begin response. More...
 
virtual void mmu_cache_base::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 mmu_cache_base::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...
 
void mmu_cache_base::mem_access ()
 
virtual void mmu_cache_base::set_irq (uint32_t tt)
 Send an interrupt over the central IRQ interface. More...
 
void mmu_cache_base::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 mmu_cache_base::read_ccr (bool internal)
 Read the cache control register. More...
 
void mmu_cache_base::snoopingCallBack (const t_snoop &snoop, const sc_core::sc_time &delay)
 Snooping function (For calling dcache->snoop_invalidate) More...
 
void mmu_cache_base::start_of_simulation ()
 Automatically called at the beginning of the simulation. More...
 
void mmu_cache_base::power_model ()
 Calculate power/energy values from normalized input data. More...
 
gs::cnf::callback_return_type mmu_cache_base::sta_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Static power callback. More...
 
gs::cnf::callback_return_type mmu_cache_base::int_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Internal power callback. More...
 
gs::cnf::callback_return_type mmu_cache_base::swi_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Switching power callback. More...
 
void mmu_cache_base::end_of_simulation ()
 Called at end of simulation to print execution statistics. More...
 
sc_core::sc_time mmu_cache_base::get_clock ()
 Return clock period (for ahb interface) More...
 
void mmu_cache_base::clkcng ()
 Deal with clock changes. More...
 

Detailed Description

Function Documentation

void mmu_cache_base::clkcng ( )
virtual

Deal with clock changes.

Reimplemented from CLKDevice.

References localram::clkcng(), cache_if::clkcng(), mmu::clkcng(), CLKDevice::clock_cycle, dcache, dlocalram, icache, ilocalram, m_dcen, m_icen, m_mmu, and m_mmu_en.

Referenced by Leon3::clkcng().

Here is the call graph for this function:

void mmu_cache_base::dorst ( )
virtual

Reset function.

Reimplemented from CLKDevice.

void mmu_cache_base::end_of_simulation ( )

Called at end of simulation to print execution statistics.

References m_right_transactions, m_total_transactions, setup::name, AHBMaster<>::print_transport_statistics(), and v::report.

Here is the call graph for this function:

void mmu_cache_base::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 
)
virtual
void mmu_cache_base::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 
)
virtual

Instruction interface to functional part of the model.

References __PRETTY_FUNCTION__, flush(), icache, ilocalram, m_ilram, m_ilramstart, mem_if::mem_read(), localram::mem_read(), and srDebug.

Referenced by mmu_cache::exec_instr().

Here is the call graph for this function:

sc_core::sc_time mmu_cache_base::get_clock ( )
virtual

Return clock period (for ahb interface)

Implements AHBMaster<>.

References CLKDevice::clock_cycle.

gs::cnf::callback_return_type mmu_cache_base::int_power_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

Dynamic/Internal power callback.

References GC_RETURN_OK.

Referenced by mmu_cache_base().

void mmu_cache_base::mem_access ( )
protected

References ahb_response_event, AHBMaster<>::ahbaccess(), bus_in_fifo, bus_read_completed, m_abstractionLayer, srDebug, trans, and pysc::api::systemc::wait().

Referenced by mmu_cache_base().

Here is the call graph for this function:

bool mmu_cache_base::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 
)
virtual

MemIF implementation - reads data from AHB master.

Reimplemented from mem_if.

References AHBMaster<>::ahb, AHBMaster<>::ahbaccess_dbg(), bus_in_fifo, bus_read_completed, m_cached, srDebug, trans, and pysc::api::systemc::wait().

Referenced by exec_data().

Here is the call graph for this function:

void mmu_cache_base::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 
)
virtual

MemIF implementation - writes data to AHB master.

Function for write access to AHB master socket.

Reimplemented from mem_if.

References AHBMaster<>::ahb, AHBMaster<>::ahbaccess_dbg(), bus_in_fifo, srDebug, trans, pysc::api::systemc::wait(), wb_pointer, and write_buf.

Referenced by exec_data().

Here is the call graph for this function:

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).

Constructor.

Select LT or AT abstraction

Parameters
nameSystemC module name
iceninstruction cache enable
ireplinstruction cache replacement strategy
isetsnumber of instruction cache sets
ilinesizeinstruction cache line size (in bytes)
isetsizesize of an instruction cache set (in kbytes)
isetlockenable instruction cache locking
dcendata cache enable
drepldata cache replacement strategy
dsetsnumber of data cache sets
dlinesizedata cache line size (in bytes)
dsetsizesize of a data cache set (in kbytes)
dsetlockenable data cache locking
dsnoopenable data cache snooping
ilramenable instruction scratch pad
ilramsizesize of the instruction scratch pad (in kbytes)
ilramstartstart address of the instruction scratch pad
dlramenable data scratch pad
dlramsizesize of the data scratch pad (in kbytes)
dlramstartstart address of the data scratch pad
cachedfixed cacheability mask
mmu_enmmu enable
itlb_numnumber of instruction TLBs
dtlb_numnumber of data TLBs
tlb_typesplit or shared instruction and data TLBs
tlb_repTLB replacement strategy
mmupgszMMU page size
hindexID of the bus master
pow_monEnable power monitoring

References CACHE_CONTROL_REG, dcache, dlocalram, mmu::get_dtlb_if(), mmu::get_itlb_if(), globl_count, icache, ilocalram, int_power, int_power_cb(), m_cached, m_mmu, m_pow_mon, mem_access(), usi.cci.callback::pre_read, srInfo, sta_power, sta_power_cb(), swi_power, swi_power_cb(), and wb_pointer.

Here is the call graph for this function:

void mmu_cache_base::power_model ( )

Calculate power/energy values from normalized input data.

References CLKDevice::clock_cycle, dyn_read_energy, dyn_read_energy_norm, dyn_write_energy, dyn_write_energy_norm, int_power, int_power_norm, sta_power, and sta_power_norm.

Referenced by start_of_simulation().

unsigned int mmu_cache_base::read_ccr ( bool  internal)
virtual

Read the cache control register.

Reimplemented from mmu_cache_if.

References __PRETTY_FUNCTION__, CACHE_CONTROL_REG, srDebug, and swap_Endianess().

Referenced by exec_data().

Here is the call graph for this function:

void mmu_cache_base::response_callback ( tlm::tlm_generic_payload *  trans)
virtual

Called from AHB master to signal begin response.

Reimplemented from AHBMaster<>.

References ahb_response_event, and srWarn.

void mmu_cache_base::set_irq ( uint32_t  tt)
virtual

Send an interrupt over the central IRQ interface.

Reimplemented from mmu_cache_if.

References irq.

void mmu_cache_base::snoopingCallBack ( const t_snoop snoop,
const sc_core::sc_time &  delay 
)

Snooping function (For calling dcache->snoop_invalidate)

References __PRETTY_FUNCTION__, t_snoop::address, dcache, t_snoop::length, m_dcen, m_dsnoop, m_master_id, t_snoop::master_id, cache_if::snoop_invalidate(), and srDebug.

Here is the call graph for this function:

gs::cnf::callback_return_type mmu_cache_base::sta_power_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

Static power callback.

References GC_RETURN_OK.

Referenced by mmu_cache_base().

void mmu_cache_base::start_of_simulation ( )

Automatically called at the beginning of the simulation.

References m_pow_mon, and power_model().

Here is the call graph for this function:

gs::cnf::callback_return_type mmu_cache_base::swi_power_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

Dynamic/Switching power callback.

References dyn_read_energy, dyn_reads, dyn_write_energy, dyn_writes, GC_RETURN_OK, power_frame_starting_time, and swi_power.

Referenced by mmu_cache_base().

void mmu_cache_base::write_ccr ( unsigned char data,
unsigned int  len,
sc_core::sc_time *  delay,
unsigned int debug,
bool  is_dbg 
)
virtual

Writes the cache control register.

Reimplemented from mmu_cache_if.

References __PRETTY_FUNCTION__, CACHE_CONTROL_REG, dcache, cache_if::flush(), icache, srDebug, and swap_Endianess().

Referenced by exec_data().

Here is the call graph for this function:

mmu_cache_base::~mmu_cache_base ( )