VIRTUTECH CONFIDENTIAL    Previous - Up - Next

3   Simulated Machines

Simics scripts for starting LEON2 machines are located in the [workspace]/targets/leon2-simple/ directory, while the actual configuration scripts can be found in [simics]/targets/leon2-simple/.

3.1   LEON2 Parameters

The leon2-simple target takes a number of parameters. The parameters prefixed with pmon are further documented in the PMON firmware sourcecode.

$freq_mhz
The clock frequency of the processor in MHz
$prom_size
The size of the PROM area in bytes.
$has_sram
Set to TRUE if the the LEON has SRAM attached. If $has_sram is TRUE, the SDRAM will be mapped to address 0x60000000, if it is set to FALSE, the SDRAM will be mapped to address 0x40000000. Defaults to FALSE.
$sram_size
The size of the SRAM area in bytes, only used if $has_sram is set to TRUE.
$sdram_size
The size of the SDRAM area. Defaults to 0x40000000 (1 GiB)
$num_windows
The number of register windows available in the LEON2 cpu. The $num_windows must be a power of 2 and be in the range [2, 32].
$has_v8e_mac
TRUE if the UMAC and SMAC instructions are to be enabled. FALSE if they are disabled. Default is TRUE.
$has_v8_mul
TRUE if the UMUL and SMUL instructions are to be enabled. FALSE if they are disabled. Default is TRUE.
$has_v8_div
TRUE if the UDIV and SDIV instructions are to be enabled. FALSE if they are disabled. Default is TRUE.
$use_pmon_emulation
Set this to TRUE if the PMON firmware is to be emulated on boot. It defaults to TRUE. Note that if the PMON memory parameters don't match the machine configuration the same behaviour will ocurr as if the PMON firmware was compiled with the wrong parameters, e.g. the stack pointer could point outside valid memory.
$pmon_memcfg1
This value is used if the PMON emulation is used, it will be written to the Memory Configuration 1 on chip register. Defaults to 0x80000
$pmon_memcfg2
This value is used if the PMON emulation is used, it will be written to the Memory Configuration 2 on chip register. Defaults to 0x3806000
$pmon_ram_banks
The number of RAM banks. Defaults to 2.
$pmon_bank_size
Size of one RAM bank in bytes. Defaults to 0x20000000 (512 MiB)
$pmon_timer_scale
Timer scaling, this is the divisor when the timer scaler values are computed. Usually, this should remain at the default value. Defaults to 1000000.
$pmon_baud_rate
The baud rate of the serial ports, defaults to 38400.

3.2   LEON2 Scripts

This section explains the files and scripts that can be used to create and boot a simple LEON2 based target.
leon2-simple.simics
The leon2-simple.simics script is used to bring up a working LEON2 based target. It creates a LEON2 processor, some additional memory and optionally runs a PMON emulation script that perform the regular PMON firmware setup but without starting the serial port boot-loader. Note that the script does not load any binary. Loading a binary is performed by issuing a set-pc (load-binary foo.srec) command after the machine has been set up.

VIRTUTECH CONFIDENTIAL    Previous - Up - Next