
8-34
ZSIM Simulator
The format of input and output files are the same. Data must be in
decimal digits, with each data on a single line. If the input file is not
present in the current running directory at the time of the request, the
simulator will print an error message to standard output and exit.
ZSIM400 also supports user-specified I/O ports. You can create a library
containing peripheral devices and then use it in place of the default
library in the directory
$SDSP_HOME/sdspI/bin
, which is created when
the ZSP SDK tools are installed. The peripheral library is called
libzperiph.dll
on Windows and
libzperiph.so
on Solaris platforms.
For information on writing the peripheral library, refer to the
ZSIM
Peripheral API Reference Guide,
document DB06-000299-00.
8.4 Example Session Using ZSIM
This section contains an example simulation session using ZSIM in
interactive mode.
zsim{1}>
load exe test.exe
***(info) Starting address: 0x2000
.text : Loading to INT-INST memory ... 0x2000 -> 0x2950 (0x0951)
.data : Loading to INT-DATA memory ... 0x0001 -> 0x005f (0x005f)
Loading "test.exe" successfully.
The contents of the instruction memory can be checked to confirm
proper loading of the test:
zsim{2}>
show imem int 0x2000 4
0x2000 0x2cfb movl r12, 0xfb
0x2001 0x3cf7 movh r12, 0xf7
0x2002 0xa6d0 mov r13, 0x0
0x2003 0x2460 movl r4, 0x60
zsim{3}> _
Before execution cycles begin, you can check to make sure that the
pipeline and caches are empty:
zsim{3}>
show pipe
------------------------------------------ F(0:0)
------------------------------------------ G(0:0)
------------------------------------------ R(0:0)
------------------------------------------ E(0:0)
------------------------------------------ W(0:0)
As shown above, the five stages of the execution pipeline are identified
with a single letter – F (Fetch/decode), G (Group), R (Read), E (Execute),