The constructor just passes its arguments to its base class
Or1ksimExtSC::Or1ksimExtSC ( sc_core::sc_module_name name, const char *configFile, const char *imageFile ) : Or1ksimSC( name, configFile, imageFile ) { } // Or1ksimExtSC()
isLittleEndian
is a simple wrapper for the
underlying Or1ksim ISS library function[3].
bool Or1ksimExtSC::isLittleEndian() { return (1 == or1ksim_is_le()); } // or1ksimIsLe()
The majority of the code for doTrans
is
unchanged from its implementation in
Or1ksimSC
. The addition is a
wait
for zero time immediately after the
transaction has completed. This allows the SystemC thread to
yield, so that any other threads that are ready can take a turn.
wait( sc_core::SC_ZERO_TIME );
Caution | |
---|---|
The call to The implementation currently is untimed, so a zero delay wait is perfectly acceptable. That just gives all the other untimed threads a turn at execution.
The logger described in Chapter 5
worked without this call to |
The extended Or1ksim wrapper module class,
Or1ksimExtSC
implementation may be found in
sys-models/simple-soc/Or1ksimExtSC.cpp
in the
distribution.
[3]
A technicality is that the Or1ksim library function,
is_little_endian
returns an
int
, since C does not have a
bool
type. A C++ compiler would automatically
convert one to the other, but making the comparison explicit is
good for clarity. The same code will be generated, so there is
no loss of performance.