|
JACK WHITHAM PhD MEng Professional Activities - Publications - Software - Articles |
|||
|
|
|
||
| Home -> Software -> RTEMS/Simplescalar |
Note: If you are interested in accurate CPU simulation for either a single program (system call emulation) or an entire system, you should look into the more recent M5 simulator, which improves upon Simplescalar in a number of important ways.
During the first year of my PhD work, I experimented with running a real-time operating system (RTOS) within the ARM7TDMI simulator Simplescalar. I needed to be able to simulate systems in which many applications were competing for resources, and it was not sufficient to just run these systems on genuine ARM hardware, because I wished to add non-standard architectural extensions such as custom instructions.
RTEMS proves ideal for this purpose because it is an open source RTOS that already supports the ARM architecture. Only minimal changes to RTEMS were required to support the work: basically just creating a new board support package for Simplescalar.
The official version of Simplescalar-ARM (from here) doesn't support the features required by RTEMS: it doesn't provide the MRS and MSR instructions, interrupt support or a programmable timer. I added these features.
I haven't implemented fast interrupts, exceptions, or the LDM/STM instructions that allow access to user-mode registers. RTEMS does not normally appear to use these features.
Memory accesses to very low memory addresses (i.e. bootstrap code and interrupt vector table) are not cached. This is because Simplescalar uses a cache tag of 0 to indicate that a cache line is empty. Unfortunately, very low memory addresses legitimately have a tag of 0. My workaround was to turn off caching for these addresses completely.
RTEMS will take several million clock cycles to fully start up within
Simplescalar. This would only be a matter of milliseconds on a real processor,
but it is quite noticeable here. There is not much that can be done.
If you are brave, you could consider using the Simplescalar fast-forward
option to run initialisation at high speed. However I have not tested this.
Using it *may* break the interrupt system.
|
|
|
||
| Copyright (C) Jack Whitham 1997-2008 | |||