Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

10.2.2.  Or1ksimIntrSC Module Class Definition

The new module class, Or1ksimIntrSC is derived from the existing Or1ksimDecoupSC module class, whose header, Or1ksimDecoupSC.h, is included. The number of interrupts to be supported is given by the constant, NUM_INTR.

#define  NUM_INTR  32
	  

The new class derived from the base class and a custom constructor defined. The possible interrupts are represented by an array of sc_signal.

  sc_core::sc_signal<bool>  intr[NUM_INTR];
	  
[Tip]Tip

It would have been possible to define an array of signal input ports, sc_in<bool>. However these ports must then be explicitly connected (bound), requiring tie-off signals to be created in the main program.

By creating actual signals, interrupts that are unused can be left unbound and ignored.

A SystemC method is required to handle the interrupts (since it never waits, a thread is not needed). This can respond to interrupts in parallel with the main ISS execution thread.

  void  intrMethod();
	  

The definition of the Or1ksim ISS wrapper module class with interrupts, Or1ksimIntrSC may be found in sys-models/intr-soc/Or1ksimIntrSC.h in the distribution.

Embecosm divider strip