The Simple SoC used in the previous sections is not sufficient to run Linux. Two significant extensions are needed.
Memory management must be added to support Linux virtual memory. This is provided by enabling the internal MMUs (instruction and data) of the Or1ksim ISS.
The SystemC UART peripheral must be extended to handle interrupts.
The example design was shown in Section 3.1.3, but for convenience the diagram is repeated here in Figure 10.1.
Enabling memory management is a matter of modifying the configuration file for Or1ksim. The Linux port used here expects to boot from flash memory, so the internal memory of Or1ksim is also extended to provide this.
The UART model, UartDecoupSC
is further
extended by a new derived class, UartIntrSC
providing a SystemC sc_out<bool>
port
through which the interrupt signal is driven.
The code for the Or1ksim ISS wrapper with interrupts enabled
(Or1ksimIntrSC.cpp
and
Or1ksimIntrSC.h
), the code for the interrupt
enabled UART module (UartIntrSC.cpp
and
UartIntrSC.h
) and the main program for the complete
model (intrSocMainSC.cpp
) may be found in the
sysc-models/intr-soc
directory of the distribution.