This article is a stub. You can help by
MIPSsim support is deprecated and scheduled for removal in late 2012 (for the 3.7 release)
One of the difficulties of a SoC designer is to evaluate the impact of the SoC architecture and its configuration on the final system. When the final system includes the Linux Kernel, the MIPSsim simulator can be the good candidate to solve the problem.
Analyzing the traces of several simulations its possible to (in)validate an architecture and to configure the SoC to obtain the best system performances. And in the case of the cache configuration, the impact of this analysis can be very important due to the cost of the cache ram.
This page intends to explain briefly how to quickly run a Linux kernel on MIPSsim configured to simulate a 4KSd where throughout this document the 4KSd should be considered a placeholder for another core made by MIPS Technologies.
This document has been validated on the following platform:
- Ubuntu 7.10/8.04
- Redhat Enterprise 5
- Fedora 8
MIPSsim is supported by a stock Linux/MIPS kernel since several years. MIPSsim is a proprietary product that is not available to the general public. However Qemu supports a MIPSsim target as well. That said, MIPSsim is an extremly simple platform and virtually everybody is better served by the other targets supported by Qemu and the Linux in general. At the same time it also appears MIPS Techologies has been shifting away from MIPSsim for a while and as such MIPSsim support in the kernel is considered obsolete and will eventually be removed probably whenever its continued support is getting in the way of more useful work.
Configuration of the different components.
To configure the kernel, the best way is to use the MIPSsim default configuration and to modify it:
Using menuconfig/xconfig you must choose the endianess correpsponding to the core configuration.
Excepted that, there is no other mandatory modification.
This configuration uses the virtual UART, you must not modify the section "Serial Drivers" excepted if you want integrated your own virtual UART.
In order to allow the kernel to calibrate the delay you need to enable interruption from the internal timer. In the configuration file you must have this line:
set TIMER_INT_ENABLE 1
The second part of the MIPSsim configuration is the configuration of the Device Manager. This one is in charge to simulate hardware devices. MIPSsim is provided with some virtual devices. In order to run the Linux kernel on MIPsim you have to enable a RAM, an UART (to get the console) and a RTC. The default configuration of those last devices are those you have to use.
Your device configuration files should look like:
MemIntf(EB, SparseMemRam, 0, 0x0, 64M, MIPS_SparseMemRam) MemIntf(EB, RTC, 2, 0x1fd00070, 0x00000002, MIPS_Rtc) MemIntf(EB, UART, 3, 0x1fd003f8, 0x00000008, MIPS_Uart) SparseMemRam(0,,,0,0,0,0,0) RTC(2,,0,0,1) UART(3,UNBUFFERED,0,0,1)
An important point here is the delay you can add to the SparseMemRam accesses modifying the last number of the line:
The GDB script must set the configuration file, the MIPSsim library and the target MIPS core. By example for a 4KSd the gdb script can look like this:
set mdi library libMIPSsim_MDIc.so set mdi configfile 4KSd.cfg set mdi target 19 set mdi device 01 target mdi load run
Run the Simulation
First make the kernel:
Set environment variables depending on your configuration:
export LM_LICENSE_FILE=@license-server export LD_LIBRARY_PATH=/path/to/MIPSsim/libraries
Then run the simulation:
sde-gdb -x gdbinit vmlinux