OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [testbench/] [README] - Diff between revs 213 and 226

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 213 Rev 226
Line 1... Line 1...
This directory includes some test case programs that should be used to verify correct operation
This directory includes some test case programs that should be used to verify correct operation
of the or1ksim, OR32 GCC and OR32 GNU Binutils.
of the or1ksim, OR32 GCC and OR32 GNU Binutils.
 
 
All programs should be built inside their directories (ie. dhrystone should be built
All programs are built from root directories. You need to have all GNU OR32 tools installed and in
inside testbench/dhrystone). You need to have all GNU OR32 tools installed and in path.
path.
All makefiles assume or32-rtems target.
 
 
 
!!! For all test cases, or1ksim should be built with ONLY_VIRTUAL_MACHINE undefined in
!!! For all test cases, or1ksim should be built with ONLY_VIRTUAL_MACHINE undefined in
cpu/or1k/except.h !!!
cpu/or1k/except.h !!!
 
 
Dhrystone 2.1: a benchmark modified to use simulator's timing facility. It should finish with exit(0).
Dhrystone 2.1: a benchmark modified to use simulator's timing facility. It should finish with exit(0).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
running simulation:
running simulation:
 
 
# ./sim testbench/dhrystone/dhry.or32
# ./sim testbench/dhrystone/dhry.or32
(sim) run 1000000 hush
(sim) run -1 hush
  
  
MTSPR(0x1234, 20070);
MTSPR(0x1234, 20070);
MTSPR(0x1234, 20013);
MTSPR(0x1234, 20013);
MTSPR(0x1234, 7);
MTSPR(0x1234, 7);
MTSPR(0x1234, 30010);
MTSPR(0x1234, 30010);
Line 34... Line 33...
End Time   = 22701
End Time   = 22701
OR1K at 200 MHz
OR1K at 200 MHz
Microseconds for one run through Dhrystone: 110 us / 20 runs
Microseconds for one run through Dhrystone: 110 us / 20 runs
Dhrystones per Second:                      181
Dhrystones per Second:                      181
 
 
test0: a test for all instructions and all GPRs. If everything is ok, RESULT == 0xdeadead.
basic: a test for all instructions and all GPRs. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
Simulation:
Simulation:
# ./sim testbench/test0/test0.or32
# ./sim testbench/basic.or32
(sim) run 1000000000 hush
(sim) run -1 hush
UART 0 RX EOF detected. Shutting down to prevent endless loop.
UART 0 RX EOF detected. Shutting down to prevent endless loop.
MTSPR(0x1234, ffff0012);
MTSPR(0x1234, ffff0012);
MTSPR(0x1234, 12352af7);
MTSPR(0x1234, 12352af7);
MTSPR(0x1234, 7ffffffe);
MTSPR(0x1234, 7ffffffe);
MTSPR(0x1234, ffffa5a7);
MTSPR(0x1234, ffffa5a7);
Line 60... Line 59...
 
 
test1: a test for "all" instructions and their combinations. If everything is ok, RESULT == 0xdeadead.
test1: a test for "all" instructions and their combinations. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
Simulation:
Simulation:
# ./sim testbench/test1/test1.or32
# ./sim testbench/cbasic.or32
(sim) run 100000000 hush
(sim) run -1 hush
MTSPR(0x1234, ffffffda);
MTSPR(0x1234, ffffffda);
MTSPR(0x1234, ffffffc5);
MTSPR(0x1234, ffffffc5);
MTSPR(0x1234, 6805);
MTSPR(0x1234, 6805);
MTSPR(0x1234, ffff97f9);
MTSPR(0x1234, ffff97f9);
MTSPR(0x1234, ffff97f9);
MTSPR(0x1234, ffff97f9);
Line 87... Line 86...
(sim)
(sim)
 
 
Standard output:
Standard output:
RESULT: deaddead
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.
pic: 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:
Simulation:
# ./sim testbench/test2/test2.or32
# ./sim testbench/pic.or32
(sim) run 100000000 hush
(sim) run -1 hush
...
...
...
...
...
...
MTSPR(0x1234, 178);
MTSPR(0x1234, 178);
MTSPR(0x1234, 178);
MTSPR(0x1234, 178);
Line 105... Line 104...
(sim)
(sim)
 
 
Standard output:
Standard output:
RESULT: deaddead
RESULT: deaddead
 
 
test3: a test of l.sys instruction. Checks all the delay slot issues ind other things. If everything is ok, RESULT == 0xdeadead.
excpt: a test of l.sys instruction. Checks all the delay slot issues ind other things. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
Simulation:
Simulation:
# ./sim testbench/test3/test3.or32
# ./sim testbench/excpt.or32
(sim) run 1000000 hush
(sim) run -1 hush
UART 0 RX EOF detected. Shutting down to prevent endless loop.
UART 0 RX EOF detected. Shutting down to prevent endless loop.
Exception 0xc00 (System Call): Iqueue[0].insn_addr: 0xc74  Eff ADDR: 0x0
Exception 0xc00 (System Call): Iqueue[0].insn_addr: 0xc74  Eff ADDR: 0x0
  pc: 0xc74  pcnext: 0xc78
  pc: 0xc74  pcnext: 0xc78
MTSPR(0x1234, 1);
MTSPR(0x1234, 1);
MTSPR(0x1234, 1);
MTSPR(0x1234, 1);
Line 126... Line 125...
(sim)
(sim)
 
 
Standard output:
Standard output:
RESULT: deaddead
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.
cfg: 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:
Simulation:
# ./sim testbench/test4/test4.or32
# ./sim testbench/cfg.or32
(sim) run 1000000 hush
(sim) run -1 hush
MTSPR(0x1234, 0);
MTSPR(0x1234, 0);
MTSPR(0x1234, e83f);
MTSPR(0x1234, e83f);
MTSPR(0x1234, 0);
MTSPR(0x1234, 0);
MTSPR(0x1234, 5);
MTSPR(0x1234, 5);
MTSPR(0x1234, 20);
MTSPR(0x1234, 20);
Line 150... Line 149...
(sim)
(sim)
 
 
Standard output:
Standard output:
RESULT: deaddead
RESULT: deaddead
 
 
test5: a test of DMA in normal (software) mode. If everything is ok, RESULT == 0xdeadead.
dma: a test of DMA in normal (software) mode. If everything is ok, RESULT == 0xdeadead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
Simulation:
Simulation:
# ./sim testbench/test5/test5.or32
# ./sim testbench/dma.or32
(sim) run 1000000 hush
(sim) run 1000000 hush
MTSPR(0x1234, 1);
MTSPR(0x1234, 1);
MTSPR(0x1234, 6);
MTSPR(0x1234, 6);
MTSPR(0x1234, a);
MTSPR(0x1234, a);
MTSPR(0x1234, deaddead);
MTSPR(0x1234, deaddead);
Line 172... Line 171...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
Simulation:
Simulation:
 
 
./sim testbench/compress/mycompress.or32
./sim testbench/compress/mycompress.or32
(sim) run 100000000 hush
(sim) run -1 hush
Interrupt reported.
Interrupt reported.
Interrupt reported.
Interrupt reported.
syscall exit(0)
syscall exit(0)
(sim)
(sim)
 
 
Line 195... Line 194...
main: compressing 998...
main: compressing 998...
main: compressing 999...
main: compressing 999...
main: output...
main: output...
main: end...
main: end...
 
 
 
mul: Test l.mul, l.mac and l.macrc instructions. Should finish with exit(0).
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
Simulation:
 
./sim testbench/mul.or32
 
(sim) run -1 hush
 
MTSPR(0x1234, deadbeef);
 
syscall exit(0)
 
(sim)
 
 
 
Standard output:
 
 
 
0xa6312f33, expected 0xa6312f33
 
0x0d4de375, expected 0x0d4de375
 
0x61ab48dc, expected 0x61ab48dc
 
Test succesful.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.