URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [README] - Rev 213
Go to most recent revision | Compare with Previous | Blame | View Log
This directory includes some test case programs that should be used to verify correct operation
of the or1ksim, OR32 GCC and OR32 GNU Binutils.
All programs should be built inside their directories (ie. dhrystone should be built
inside testbench/dhrystone). You need to have all GNU OR32 tools installed and in path.
All makefiles assume or32-rtems target.
!!! For all test cases, or1ksim should be built with ONLY_VIRTUAL_MACHINE undefined in
cpu/or1k/except.h !!!
Dhrystone 2.1: a benchmark modified to use simulator's timing facility. It should finish with exit(0).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
running simulation:
# ./sim testbench/dhrystone/dhry.or32
(sim) run 1000000 hush
<cut> <cut> <cut>
MTSPR(0x1234, 20070);
MTSPR(0x1234, 20013);
MTSPR(0x1234, 7);
MTSPR(0x1234, 30010);
MTSPR(0x1234, 30010);
MTSPR(0x1234, 8);
MTSPR(0x1234, 20020);
MTSPR(0x1234, 9);
syscall exit(0)
(sim)
stdout.txt should read like this:
Execution starts, 20 runs through Dhrystone
Begin Time = 549
End Time = 22701
OR1K at 200 MHz
Microseconds for one run through Dhrystone: 110 us / 20 runs
Dhrystones per Second: 181
test0: a test for all instructions and all GPRs. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simulation:
# ./sim testbench/test0/test0.or32
(sim) run 1000000000 hush
UART 0 RX EOF detected. Shutting down to prevent endless loop.
MTSPR(0x1234, ffff0012);
MTSPR(0x1234, 12352af7);
MTSPR(0x1234, 7ffffffe);
MTSPR(0x1234, ffffa5a7);
MTSPR(0x1234, fffff);
MTSPR(0x1234, 2800);
MTSPR(0x1234, a);
MTSPR(0x1234, deaddead);
syscall exit(0)
(sim)
Standard output:
RESULT: deaddead
test1: a test for "all" instructions and their combinations. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simulation:
# ./sim testbench/test1/test1.or32
(sim) run 100000000 hush
MTSPR(0x1234, ffffffda);
MTSPR(0x1234, ffffffc5);
MTSPR(0x1234, 6805);
MTSPR(0x1234, ffff97f9);
MTSPR(0x1234, ffff97f9);
MTSPR(0x1234, 7a77952e);
MTSPR(0x1234, 81e5e000);
MTSPR(0x1234, 74);
MTSPR(0x1234, 74);
MTSPR(0x1234, 74);
MTSPR(0x1234, 1);
MTSPR(0x1234, d7c);
MTSPR(0x1234, 74);
MTSPR(0x1234, 74);
MTSPR(0x1234, 74);
MTSPR(0x1234, ffffffff);
MTSPR(0x1234, d7a);
MTSPR(0x1234, d7a);
MTSPR(0x1234, deaddead);
syscall exit(0)
(sim)
Standard output:
RESULT: deaddead
test2: a test for PIC and TICK timer. All three modes of TICK timer are tested and interrupt is enabled and disabled in PIC. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simulation:
# ./sim testbench/test2/test2.or32
(sim) run 100000000 hush
...
...
...
MTSPR(0x1234, 178);
MTSPR(0x1234, 178);
MTSPR(0x1234, deaddead);
syscall exit(0)
(sim)
Standard output:
RESULT: deaddead
test3: a test of l.sys instruction. Checks all the delay slot issues ind other things. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simulation:
# ./sim testbench/test3/test3.or32
(sim) run 1000000 hush
UART 0 RX EOF detected. Shutting down to prevent endless loop.
Exception 0xc00 (System Call): Iqueue[0].insn_addr: 0xc74 Eff ADDR: 0x0
pc: 0xc74 pcnext: 0xc78
MTSPR(0x1234, 1);
MTSPR(0x1234, 1);
MTSPR(0x1234, 1c);
MTSPR(0x1234, 1);
MTSPR(0x1234, 3);
MTSPR(0x1234, deaddead);
syscall exit(0)
(sim)
Standard output:
RESULT: deaddead
test4: a test of SPRs (SPR_VR, SPR_CPUCFGR, SPR_DMMUCFGR, SPR_IMMUCFGR, SPR_DCCFGR, SPR_ICCFGR, SPR_DCFGR, SPR_PCCFGR). If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simulation:
# ./sim testbench/test4/test4.or32
(sim) run 1000000 hush
MTSPR(0x1234, 0);
MTSPR(0x1234, e83f);
MTSPR(0x1234, 0);
MTSPR(0x1234, 5);
MTSPR(0x1234, 20);
MTSPR(0x1234, 1d);
MTSPR(0x1234, 1d);
MTSPR(0x1234, 1d);
MTSPR(0x1234, 1d);
MTSPR(0x1234, 8);
MTSPR(0x1234, 1);
MTSPR(0x1234, deaddead);
syscall exit(0)
(sim)
Standard output:
RESULT: deaddead
test5: a test of DMA in normal (software) mode. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simulation:
# ./sim testbench/test5/test5.or32
(sim) run 1000000 hush
MTSPR(0x1234, 1);
MTSPR(0x1234, 6);
MTSPR(0x1234, a);
MTSPR(0x1234, deaddead);
syscall exit(0)
(sim)
Standard output:
RESULT: deaddead
compress: UNIX compressed modified not to use libc calls. Should finish with exit(0).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simulation:
./sim testbench/compress/mycompress.or32
(sim) run 100000000 hush
Interrupt reported.
Interrupt reported.
syscall exit(0)
(sim)
Standard output:
main: bytes_out 3... hsize 5003
main: hshift 4...
main: bytes_out 3...
main: hsize_reg 5003...
main: before compress 1...
main: compressing 1...
main: compressing 2...
main: compressing 3...
<cut> <cut> <cut>
main: compressing 997...
main: compressing 998...
main: compressing 999...
main: output...
main: end...
Go to most recent revision | Compare with Previous | Blame | View Log