Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Files | Classes | Functions
APBCtrl

Files

file  apbctrl.cpp
 
file  apbctrl.h
 

Classes

struct  apb_check_slave_type
 
class  APBCtrl
 

Functions

 APBCtrl::APBCtrl (ModuleName nm, uint32_t haddr=0xfff, uint32_t hmask=0, bool mcheck=0, uint32_t hindex=0, bool pow_mon=0, AbstractionLayer ambaLayer=amba::amba_LT)
 Constructor. More...
 
void APBCtrl::dorst ()
 Reset Callback. More...
 
 APBCtrl::~APBCtrl ()
 Desctructor. More...
 
void APBCtrl::init_generics ()
 Initialisation function for model generics. More...
 
void APBCtrl::setAddressMap (const uint32_t binding, const uint32_t pindex, const uint32_t paddr, const uint32_t pmask)
 Helper function for creating slave map decoder entries. More...
 
int APBCtrl::get_index (const uint32_t address)
 Get slave index for a given address. More...
 
unsigned int APBCtrl::getPNPReg (const uint32_t address)
 Returns a PNP register from the APB configuration area (upper 4kb of address space) More...
 
uint32_t APBCtrl::exec_func (tlm::tlm_generic_payload &ahb_gp, sc_core::sc_time &delay, bool debug)
 Encapsulation function for functional part of the model (decoder) More...
 
void APBCtrl::end_of_elaboration ()
 Systemc end of elaboration hook. Enables power monitoring. More...
 
void APBCtrl::start_of_simulation ()
 Set up slave map and collect plug & play information. More...
 
void APBCtrl::power_model ()
 Calculate power/energy values from normalized input data. More...
 
gs::cnf::callback_return_type APBCtrl::sta_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Static power callback. More...
 
gs::cnf::callback_return_type APBCtrl::int_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Internal power callback. More...
 
gs::cnf::callback_return_type APBCtrl::swi_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Switching power callback. More...
 
void APBCtrl::end_of_simulation ()
 SystemC end of simulation hook. More...
 
sc_core::sc_time APBCtrl::get_clock ()
 Return clock cycle for ahb interface. More...
 
void APBCtrl::checkMemMap ()
 Check memory map for overlaps. More...
 

Detailed Description

Function Documentation

APBCtrl::APBCtrl ( ModuleName  nm,
uint32_t  haddr = 0xfff,
uint32_t  hmask = 0,
bool  mcheck = 0,
uint32_t  hindex = 0,
bool  pow_mon = 0,
AbstractionLayer  ambaLayer = amba::amba_LT 
)

Constructor.

Constructor of class APBCtrl.

Parameters
nmSystemC name
haddrThe MSB address of the AHB area. Sets the 12 MSBs in the AHB address
hmaskThe 12bit AHB area address mask
mcheckCheck if there are any intersections between APB slave memory regions
hindexAHB bus index
pow_monEnables power monitoring

References srInfo.

void APBCtrl::checkMemMap ( )
void APBCtrl::dorst ( )
virtual

Reset Callback.

Reimplemented from CLKDevice.

Referenced by AMBABasePlatform::dorst().

void APBCtrl::end_of_elaboration ( )

Systemc end of elaboration hook. Enables power monitoring.

References APBCtrl::int_power_cb(), usi.cci.callback::pre_read, APBCtrl::sta_power_cb(), and APBCtrl::swi_power_cb().

Here is the call graph for this function:

void APBCtrl::end_of_simulation ( )

SystemC end of simulation hook.

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

Here is the call graph for this function:

uint32_t APBCtrl::exec_func ( tlm::tlm_generic_payload &  ahb_gp,
sc_core::sc_time &  delay,
bool  debug 
)

Encapsulation function for functional part of the model (decoder)

References APBCtrl::apb, CLKDevice::clock_cycle, v::debug, v::error, APBCtrl::get_index(), APBCtrl::getPNPReg(), i, setup::name, AHBSlave<>::transport_statistics(), v::uint32, and v::warn.

Here is the call graph for this function:

sc_core::sc_time APBCtrl::get_clock ( )
virtual

Return clock cycle for ahb interface.

Implements AHBSlave<>.

References CLKDevice::clock_cycle.

int APBCtrl::get_index ( const uint32_t  address)

Get slave index for a given address.

Find slave index by address.

References v::info.

Referenced by APBCtrl::exec_func().

uint32_t APBCtrl::getPNPReg ( const uint32_t  address)

Returns a PNP register from the APB configuration area (upper 4kb of address space)

References v::debug, device, AHBDevice< BaseModule< DefaultBase > >::get_ahb_bar_addr(), setup::name, offset, result, and swap_Endianess().

Referenced by APBCtrl::exec_func().

Here is the call graph for this function:

void APBCtrl::init_generics ( )
virtual

Initialisation function for model generics.

Reimplemented from BaseModule< DefaultBase >.

References sr_param_base::add_properties().

Here is the call graph for this function:

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

Dynamic/Internal power callback.

References GC_RETURN_OK.

Referenced by APBCtrl::end_of_elaboration().

void APBCtrl::power_model ( )

Calculate power/energy values from normalized input data.

References CLKDevice::clock_cycle.

Referenced by APBCtrl::start_of_simulation().

void APBCtrl::setAddressMap ( const uint32_t  binding,
const uint32_t  pindex,
const uint32_t  paddr,
const uint32_t  pmask 
)

Helper function for creating slave map decoder entries.

References pindex.

Referenced by APBCtrl::start_of_simulation().

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

Static power callback.

References GC_RETURN_OK.

Referenced by APBCtrl::end_of_elaboration().

void APBCtrl::start_of_simulation ( )

Set up slave map and collect plug & play information.

References APBCtrl::apb, APBCtrl::checkMemMap(), APBDeviceBase::get_apb_base(), APBDeviceBase::get_apb_device_info(), APBDeviceBase::get_apb_mask(), APBDeviceBase::get_apb_pindex(), APBDeviceBase::get_apb_type(), i, v::info, setup::name, APBCtrl::power_model(), APBCtrl::setAddressMap(), and v::warn.

Here is the call graph for this function:

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

Dynamic/Switching power callback.

References GC_RETURN_OK.

Referenced by APBCtrl::end_of_elaboration().

APBCtrl::~APBCtrl ( )

Desctructor.