The new class, Or1ksimExtSC
is derived from
Or1ksimSC
, so the definition file includes
its header. The module class can then inherit from that class.
#include "Or1ksimSC.h" class Or1ksimExtSC : public Or1ksimSC {
A custom constructor must be defined. Custom constructors do not inherit, so a new custom constructor is defined just to pass the arguments on to the base class.
Or1ksimExtSC( sc_core::sc_module_name name, const char *configFile, const char *imageFile );
A new public function to report the endianness of the underlying CPU model is defined
bool isLittleEndian();
The doTrans
function is reimplemented here, to
allow the thread to yield. The function remains protected and
virtual, since it will be redefined again later in this application
note.
virtual void doTrans( tlm::tlm_generic_payload &trans );
The extended Or1ksim wrapper module class,
Or1ksimExtSC
, definition may be found in
sys-models/simple-soc/Or1ksimExtSC.h
in the
distribution. It uses the TLM 2.0 simple target convenience socket
(described earlier in Chapter 5).