The constructor passes its arguments to the base class constructor
for processing. It then sets up intrMethod
as a
SystemC method process, sensitive to the positive edge of each
interrupt signal. There is no need to initialize this function.
SC_METHOD( intrMethod ); for( i = 0 ; i < NUM_INTR ; i++ ) { sensitive << intr[i].posedge_event(); } dont_initialize();
The interrupt method is triggered by a positive edge on one of the
signals. It loops through to find which interrupt was triggered and
generates a call to or1ksim_interrupt
for that
interrupt number. In principle more than one could be triggered in the
same cycle, so all are checked.
for( i = 0 ; i < NUM_INTR ; i++ ) { if( intr[i].event()) { or1ksim_interrupt( i ); } }
The implementation of the Or1ksim ISS wrapper module class with
interrupts, Or1ksimIntrSC
may be found in
sys-models/intr-soc/Or1ksimIntrSC.cpp
in the
distribution.