The standard Or1ksim ISS incorporates the functionality of several common peripherals. The objective of this application note is to demonstrate the ISS driving external peripherals modeled in SystemC using TLM 2.0 interfaces.
Or1ksim peripherals are configured in a textual configuration
file, with a section (introduced by the keyword
section
) for each device attached. This
configuration file specifies the memory mapped addresses of the
peripheral. Any reads or writes to those addresses will be directed
to the code of the peripheral within Or1ksim.
Or1ksim is extended with a new class of peripheral,
generic
, which specifies an external
peripheral. The specification in the configuration file specifies
the memory mapped address range covered and whether byte, half word
or full word access are enabled. Multiple generic
sections may be defined (for different address ranges) in the
configuration file.
Code is added to Or1ksim, so that any read or write to a
generic
peripheral is redirected back to the
wrapper code via the upcalls specified as arguments to
or1ksim_init
(see Section 4.1.1 and Section 4.2.6).