Transaction-Level Modeling Framework for Space Applications
Files | |
file | irqmp.cpp |
Classes | |
class | Irqmp |
Functions | |
SR_HAS_MODULE (Irqmp) | |
Irqmp::Irqmp (sc_module_name name, int32_t paddr=0, int32_t pmask=0xFFF, int32_t ncpu=2, int32_t eirq=1, uint32_t pindex=0, bool powmon=false) | |
Constructor. More... | |
Irqmp::~Irqmp () | |
void | Irqmp::init_generics () |
void | Irqmp::init_registers () |
void | Irqmp::start_of_simulation () |
Automatically called at start of simulation. More... | |
void | Irqmp::end_of_elaboration () |
SystemC end of elaboration implementation. More... | |
void | Irqmp::end_of_simulation () |
SystemC end of simulation. More... | |
void | Irqmp::power_model () |
Calculate power/energy values from normalized input data. More... | |
gs::cnf::callback_return_type | Irqmp::sta_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason) |
Static power callback. More... | |
gs::cnf::callback_return_type | Irqmp::int_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason) |
Dynamic/Internal power callback. More... | |
void | Irqmp::dorst () |
void | Irqmp::incomming_irq (const std::pair< uint32_t, bool > &value, const sc_time &time) |
void | Irqmp::launch_irq () |
void | Irqmp::clear_write () |
void | Irqmp::force_write () |
void | Irqmp::acknowledged_irq (const uint32_t &irq, const uint32_t &cpu, const sc_time &time) |
void | Irqmp::mpstat_write () |
Write to MP status register. More... | |
void | Irqmp::mpstat_read () |
Prepare reading of the MP status register. More... | |
void | Irqmp::pending_write () |
Acknowledged Irq Callback
This Callback is called if the direct acknowledge way is used. It will clean the coressponding bit out of the pending and force registers.
irq | The Interrupt to clean. |
cpu | The CPU which acknowleged the Interrupt |
time | Delay to the simulation time. Not used with this signal. |
References CLKDevice::clock_cycle, v::debug, Irqmp::e_signal, core.waf.cmake::f(), Irqmp::g_eirq, Irqmp::IR_FORCE, Irqmp::IR_PENDING, irq, Irqmp::irq_req, setup::name, Irqmp::PROC_EXTIR_ID(), Irqmp::PROC_IR_FORCE(), and APBSlave::r.
void Irqmp::clear_write | ( | ) |
Write to IR clear register
Triggers the cleaning of an interupt bit in the IR clear register. Will force a recalculation of a new interrupt.
References CLKDevice::clock_cycle, Irqmp::e_signal, Irqmp::g_eirq, Irqmp::g_ncpu, i, Irqmp::IR_CLEAR, Irqmp::IR_FORCE, Irqmp::IR_PENDING, Irqmp::irq_req, Irqmp::PROC_EXTIR_ID(), and APBSlave::r.
Referenced by Irqmp::init_registers().
|
virtual |
Reset Callback
This function is called when the reset signal is triggert. The reset whill reset all registers and bring the IRQ controler in a valid state.
value | Value of the reset signal the reset is active as long the signal is false. Therefore the reset is done on the transition from false to true. |
time | Delay to the current simulation time. Is not used in this callback. |
Reimplemented from CLKDevice.
References Irqmp::BROADCAST, Irqmp::BROADCAST_DEFAULT, Irqmp::CLEAR_DEFAULT, Irqmp::cpu_rst, Irqmp::EXTIR_ID_DEFAULT, Irqmp::FORCE_DEFAULT, Irqmp::g_eirq, Irqmp::g_ncpu, Irqmp::IR_CLEAR, Irqmp::IR_FORCE, Irqmp::IR_LEVEL, Irqmp::IR_PENDING, Irqmp::LEVEL_DEFAULT, Irqmp::MASK_DEFAULT, Irqmp::MP_STAT, Irqmp::PENDING_DEFAULT, Irqmp::PROC_EXTIR_ID(), Irqmp::PROC_FORCE_DEFAULT, Irqmp::PROC_IR_FORCE(), Irqmp::PROC_IR_MASK(), and APBSlave::r.
void Irqmp::end_of_elaboration | ( | ) |
SystemC end of elaboration implementation.
void Irqmp::end_of_simulation | ( | ) |
SystemC end of simulation.
References Irqmp::g_ncpu, i, setup::name, and v::report.
void Irqmp::force_write | ( | ) |
Write to the IR force register
If a write is done to the interrupt force register this function will recalculate the interrupt force settings and trigger a recalculation of the outputs.
References CLKDevice::clock_cycle, v::debug, Irqmp::e_signal, Irqmp::g_eirq, Irqmp::g_ncpu, i, Irqmp::IR_PENDING, Irqmp::irq_req, setup::name, Irqmp::PROC_EXTIR_ID(), Irqmp::PROC_IR_FORCE(), Irqmp::PROC_IR_FORCE_IF, APBSlave::r, and v::uint32.
Referenced by Irqmp::init_registers().
Incomming interrupts
This Callback is registert to the interrupt input signal. It will set the corresponding register bits and trigger a recalculation of the outputs.
value | The value of the Interrupt. A value of false will be ignored due to the fact that interrupts can only be cleared in the interrupt controler. |
irq | The interrupt line which is triggered. |
time | Delay to the simulation time. Not used in this signal. |
References Irqmp::BROADCAST, CLKDevice::clock_cycle, v::debug, Irqmp::e_signal, Irqmp::g_ncpu, Irqmp::IR_PENDING, setup::name, Irqmp::PROC_IR_FORCE(), and APBSlave::r.
|
virtual |
Initialize the generics with meta data.
Will ne called from the constructor.
Reimplemented from BaseModule< DefaultBase >.
References sr_param_base::add_properties(), Irqmp::g_eirq, and Irqmp::g_ncpu.
Referenced by Irqmp::Irqmp().
|
virtual |
Reimplemented from BaseModule< DefaultBase >.
References Irqmp::BROADCAST_BM, sr_register< DATA_TYPE >::callback(), Irqmp::clear_write(), sr_register_bank< ADDR_TYPE, DATA_TYPE >::create_register(), Irqmp::force_write(), Irqmp::g_ncpu, i, Irqmp::IR_CLEAR_IC, Irqmp::IR_FORCE_IF, Irqmp::IR_LEVEL_IL, Irqmp::IR_PENDING_EIP, Irqmp::IR_PENDING_IP, Irqmp::MP_STAT_WMASK, Irqmp::mpstat_read(), Irqmp::mpstat_write(), Irqmp::pending_write(), Irqmp::PROC_EXTIR_ID_EID, Irqmp::PROC_IR_FORCE_IF, Irqmp::PROC_IR_FORCE_IFC, Irqmp::PROC_MASK_EIM, Irqmp::PROC_MASK_IM, APBSlave::r, SR_POST_WRITE, and SR_PRE_READ.
Referenced by Irqmp::Irqmp().
gs::cnf::callback_return_type Irqmp::int_power_cb | ( | gs::gs_param_base & | changed_param, |
gs::cnf::callback_type | reason | ||
) |
Irqmp::Irqmp | ( | sc_module_name | name, |
int32_t | paddr = 0 , |
||
int32_t | pmask = 0xFFF , |
||
int32_t | ncpu = 2 , |
||
int32_t | eirq = 1 , |
||
uint32_t | pindex = 0 , |
||
bool | powmon = false |
||
) |
Constructor.
Constructor
The constructor is taking the VHDL generics as parameters.
name | SystemC instance name. |
paddr | Upper 12bit of the APB address. |
pmask | Upper 12bit of the APB mask. |
ncpu | Number of CPU which receive interupts. |
eirq | Interrupt channel which hides all the extended interrupt channels. |
References Irqmp::g_ncpu, i, Irqmp::init_generics(), Irqmp::init_registers(), Irqmp::int_power, Irqmp::int_power_cb(), Irqmp::launch_irq(), pindex, usi.cci.callback::pre_read, srInfo, Irqmp::sta_power, and Irqmp::sta_power_cb().
void Irqmp::launch_irq | ( | ) |
Recalculates the output for the CPUs.
This function is called whenever an interrupt is triggered. It will change the output state.
References v::debug, Irqmp::e_signal, Irqmp::g_eirq, Irqmp::g_ncpu, Irqmp::IR_FORCE, Irqmp::IR_FORCE_IF, Irqmp::IR_LEVEL, Irqmp::IR_PENDING, Irqmp::IR_PENDING_EIP, Irqmp::IR_PENDING_IP, Irqmp::irq_req, setup::name, Irqmp::PROC_IR_FORCE(), Irqmp::PROC_IR_MASK(), APBSlave::r, v::uint32, and pysc::api::systemc::wait().
Referenced by Irqmp::Irqmp().
void Irqmp::mpstat_read | ( | ) |
Prepare reading of the MP status register.
References Irqmp::cpu_stat, Irqmp::g_eirq, Irqmp::g_ncpu, i, Irqmp::MP_STAT, APBSlave::r, and srDebug.
Referenced by Irqmp::init_registers().
void Irqmp::mpstat_write | ( | ) |
Write to MP status register.
References Irqmp::cpu_rst, Irqmp::cpu_stat, Irqmp::g_ncpu, i, Irqmp::MP_STAT, APBSlave::r, and srDebug.
Referenced by Irqmp::init_registers().
void Irqmp::pending_write | ( | ) |
Write to pending register
Addes new interrupts to the current pending register. It will trigger the recalculation of the outputs.
References CLKDevice::clock_cycle, Irqmp::e_signal, v::info, and setup::name.
Referenced by Irqmp::init_registers().
void Irqmp::power_model | ( | ) |
Calculate power/energy values from normalized input data.
References CLKDevice::clock_cycle, Irqmp::int_power, Irqmp::int_power_norm, Irqmp::sta_power, and Irqmp::sta_power_norm.
Referenced by Irqmp::start_of_simulation().
SR_HAS_MODULE | ( | Irqmp | ) |
gs::cnf::callback_return_type Irqmp::sta_power_cb | ( | gs::gs_param_base & | changed_param, |
gs::cnf::callback_type | reason | ||
) |
void Irqmp::start_of_simulation | ( | ) |
Automatically called at start of simulation.
References Irqmp::power_model().
Irqmp::~Irqmp | ( | ) |
Default destructor
Frees all dynamic object members.