Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Files | Classes | Functions
AHBMemory

Files

file  ahbmem.cpp
 
file  ahbmem.h
 

Classes

class  AHBMem
 

Functions

 SR_HAS_MODULE (AHBMem)
 
 AHBMem::AHBMem (const ModuleName nm, uint16_t haddr_=0, uint16_t hmask_=0, AbstractionLayer ambaLayer=amba::amba_LT, uint32_t slave_id=0, bool cacheable=1, uint32_t wait_states=0, bool pow_mon=false)
 Constructor for the test bench memory class. More...
 
 AHBMem::~AHBMem ()
 Destructor. More...
 
void AHBMem::init_generics ()
 Initialize generics. More...
 
void AHBMem::dorst ()
 Reset callback. More...
 
uint32_t AHBMem::exec_func (tlm::tlm_generic_payload &gp, sc_time &delay, bool debug=false)
 Encapsulated functionality. More...
 
sc_core::sc_time AHBMem::get_clock ()
 Returns clock cycle time from child. More...
 
bool AHBMem::get_direct_mem_ptr (tlm::tlm_generic_payload &trans, tlm::tlm_dmi &dmi_data)
 
void AHBMem::writeByteDBG (const uint32_t addr, const uint8_t byte)
 Method to write a byte into the memory. More...
 
void AHBMem::before_end_of_elaboration ()
 Creates the memory backend. More...
 
void AHBMem::start_of_simulation ()
 Called by scheduler at start of simulation. More...
 
void AHBMem::power_model ()
 Calculate power/energy values from normalized input data. More...
 
gs::cnf::callback_return_type AHBMem::sta_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Static power callback. More...
 
gs::cnf::callback_return_type AHBMem::int_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Internal power callback. More...
 
gs::cnf::callback_return_type AHBMem::swi_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Switching power callback. More...
 
void AHBMem::end_of_simulation ()
 Generates execution statistic at end of simulation. More...
 

Detailed Description

Function Documentation

AHBMem::AHBMem ( const ModuleName  nm,
uint16_t  haddr_ = 0,
uint16_t  hmask_ = 0,
AbstractionLayer  ambaLayer = amba::amba_LT,
uint32_t  slave_id = 0,
bool  cacheable = 1,
uint32_t  wait_states = 0,
bool  pow_mon = false 
)

Constructor for the test bench memory class.

Constructor.

Constructor

Parameters
haddrAHB address of the AHB slave socket (12 bit)
hmaskAHB address mask (12 bit)
ambaLayerAbstraction layer used (AT/LT)
infileFile name of a text file to initialize the memory from
addrStart address for memory initilization

References AHBSlave<>::ahb, AHBDevice< BaseModule< DefaultBase > >::get_ahb_base_addr(), AHBDevice< BaseModule< DefaultBase > >::get_ahb_size(), AHBMem::get_direct_mem_ptr(), AHBMem::init_generics(), AHBMem::int_power, AHBMem::int_power_cb(), usi.cci.callback::pre_read, srInfo, AHBMem::sta_power, AHBMem::sta_power_cb(), AHBMem::swi_power, and AHBMem::swi_power_cb().

Here is the call graph for this function:

void AHBMem::before_end_of_elaboration ( )

Creates the memory backend.

References AHBDevice< BaseModule< DefaultBase > >::get_ahb_bar_size(), and BaseMemory::set_storage().

Here is the call graph for this function:

void AHBMem::dorst ( )
virtual

Reset callback.

Reimplemented from CLKDevice.

References BaseMemory::erase(), and AHBDevice< BaseModule< DefaultBase > >::get_ahb_size().

Here is the call graph for this function:

void AHBMem::end_of_simulation ( )

Generates execution statistic at end of simulation.

References setup::name, AHBSlave<>::print_transport_statistics(), and v::report.

Here is the call graph for this function:

uint32_t AHBMem::exec_func ( tlm::tlm_generic_payload &  gp,
sc_time &  delay,
bool  debug = false 
)
virtual

Encapsulated functionality.

Implements AHBSlave<>.

References AHBSlave<>::ahb, Storage::allow_dmi_rw(), CLKDevice::clock_cycle, AHBMem::dyn_reads, AHBMem::dyn_writes, AHBDevice< BaseModule< DefaultBase > >::get_ahb_bar_relative_addr(), BaseMemory::m_storage, setup::name, BaseMemory::read_block(), srDebug, srError, srWarn, trans, and BaseMemory::write_block().

Here is the call graph for this function:

sc_core::sc_time AHBMem::get_clock ( )
virtual

Returns clock cycle time from child.

Implements AHBSlave<>.

References CLKDevice::clock_cycle.

bool AHBMem::get_direct_mem_ptr ( tlm::tlm_generic_payload &  trans,
tlm::tlm_dmi &  dmi_data 
)

References Storage::allow_dmi_rw(), AHBDevice< BaseModule< DefaultBase > >::get_ahb_bar_size(), Storage::get_dmi_ptr(), v::info, BaseMemory::m_storage, setup::name, and v::uint32.

Referenced by AHBMem::AHBMem().

Here is the call graph for this function:

void AHBMem::init_generics ( )
virtual

Initialize generics.

Reimplemented from BaseModule< DefaultBase >.

References sr_param_base::add_properties().

Referenced by AHBMem::AHBMem().

Here is the call graph for this function:

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

Dynamic/Internal power callback.

References GC_RETURN_OK.

Referenced by AHBMem::AHBMem().

void AHBMem::power_model ( )

Calculate power/energy values from normalized input data.

References CLKDevice::clock_cycle, AHBMem::dyn_read_energy, AHBMem::dyn_read_energy_norm, AHBMem::dyn_write_energy, AHBMem::dyn_write_energy_norm, AHBDevice< BaseModule< DefaultBase > >::get_ahb_size(), AHBMem::int_power, AHBMem::int_power_norm, AHBMem::sta_power, and AHBMem::sta_power_norm.

Referenced by AHBMem::start_of_simulation().

Here is the call graph for this function:

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

Static power callback.

References GC_RETURN_OK.

Referenced by AHBMem::AHBMem().

void AHBMem::start_of_simulation ( )

Called by scheduler at start of simulation.

References AHBMem::power_model().

Here is the call graph for this function:

gs::cnf::callback_return_type AHBMem::swi_power_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)
void AHBMem::writeByteDBG ( const uint32_t  addr,
const uint8_t  byte 
)

Method to write a byte into the memory.

Parameters
addrWrite address
byteWrite data

References BaseMemory::write_dbg().

Here is the call graph for this function:

AHBMem::~AHBMem ( )

Destructor.