Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Files | Classes | Functions
IRQMP

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

Detailed Description

Function Documentation

void Irqmp::acknowledged_irq ( const uint32_t irq,
const uint32_t cpu,
const sc_time &  time 
)

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.

Parameters
irqThe Interrupt to clean.
cpuThe CPU which acknowleged the Interrupt
timeDelay 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.

Here is the call graph for this function:

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

Here is the call graph for this function:

void Irqmp::dorst ( )
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.

Parameters
valueValue 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.
timeDelay 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.

Here is the call graph for this function:

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

Here is the call graph for this function:

void Irqmp::incomming_irq ( const std::pair< uint32_t, bool > &  value,
const sc_time &  time 
)

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.

Parameters
valueThe 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.
irqThe interrupt line which is triggered.
timeDelay 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.

Here is the call graph for this function:

void Irqmp::init_generics ( )
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().

Here is the call graph for this function:

void Irqmp::init_registers ( )
virtual
gs::cnf::callback_return_type Irqmp::int_power_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

Dynamic/Internal power callback.

References GC_RETURN_OK.

Referenced by Irqmp::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.

Constructor

The constructor is taking the VHDL generics as parameters.

Parameters
nameSystemC instance name.
paddrUpper 12bit of the APB address.
pmaskUpper 12bit of the APB mask.
ncpuNumber of CPU which receive interupts.
eirqInterrupt 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().

Here is the call graph for this function:

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

Here is the call graph for this function:

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 
)

Static power callback.

References GC_RETURN_OK.

Referenced by Irqmp::Irqmp().

void Irqmp::start_of_simulation ( )

Automatically called at start of simulation.

References Irqmp::power_model().

Here is the call graph for this function:

Irqmp::~Irqmp ( )

Default destructor

Frees all dynamic object members.