Transaction-Level Modeling Framework for Space Applications
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... | |
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.
nm | SystemC name |
haddr | The MSB address of the AHB area. Sets the 12 MSBs in the AHB address |
hmask | The 12bit AHB area address mask |
mcheck | Check if there are any intersections between APB slave memory regions |
hindex | AHB bus index |
pow_mon | Enables power monitoring |
References srInfo.
void APBCtrl::checkMemMap | ( | ) |
Check memory map for overlaps.
References APBCtrl::apb, apb_check_slave_type::end, v::error, apb_check_slave_type::index, setup::name, apb_check_slave_type::start, and v::uint32.
Referenced by APBCtrl::start_of_simulation().
|
virtual |
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().
void APBCtrl::end_of_simulation | ( | ) |
SystemC end of simulation hook.
References setup::name, AHBSlave<>::print_transport_statistics(), and v::report.
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.
|
virtual |
Get slave index for a given address.
Find slave index by address.
References v::info.
Referenced by APBCtrl::exec_func().
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().
|
virtual |
Initialisation function for model generics.
Reimplemented from BaseModule< DefaultBase >.
References sr_param_base::add_properties().
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 | ||
) |
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.
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.