Skip to content

Commit

Permalink
Updated test/doc for changes to test framework
Browse files Browse the repository at this point in the history
  • Loading branch information
simon5656 committed Jun 20, 2018
1 parent caa38ea commit 0cd3faf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ export WORK = $(ROOTDIR)/work
export ISA = rv32i
export SUITEDIR = $(ROOTDIR)/riscv-test-suite/$(ISA)


all: simulate verify

simulate:
make \
RISCV_TARGET=$(RISCV_TARGET) RISCV_DEVICE=$(RISCV_DEVICE) \
RISCV_PREFIX=$(RISCV_PREFIX) run -C $(SUITEDIR)
RISCV_TARGET=$(RISCV_TARGET) \
RISCV_DEVICE=$(RISCV_DEVICE) \
RISCV_PREFIX=$(RISCV_PREFIX) \
run -C $(SUITEDIR)

verify:
riscv-test-env/verify.sh
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,17 @@ The files [`COPYING.BSD`](./COPYING.BSD) and [`COPYING.CC`](./COPYING.CC) in the

## Running the compliance tests

The only setup required is to define where the toolchain is found, and where the target device is found
The only setup required is to define where the toolchain is found, and where the target / device is found.

In the Makefile there are 2 entries to be defined for `GCC_BIN` & `OVP_BIN`
For the toolchain, the binaries must be in the search path and the compiler prefix is defined on the make line. The default value for this is

I have as yet only defined a single test which uses any logging, this is the test `I-IO`. This test contains a number of logging macros, eg
RISCV_PREFIX ?= riscv64-unknown-elf-

The path to the RUN_TARGET is defined within the riscv-target Makefile.include.

RVTEST_IO_WRITE_STR("# Test part A1 - Complete\n");

and assertion macros for sequential correctness

RVTEST_IO_ASSERT_EQ(x3, 0x00000000)

To run on rv32i on either riscvOVPsim or spike
To run the rv32i test suite on riscvOVPsim

make RISCV_TARGET=riscvOVPsim RISCV_DEVICE=rv32i
make RISCV_TARGET=spike RISCV_DEVICE=rv32i

### Accessing riscvOVPsim

Expand Down
16 changes: 9 additions & 7 deletions doc/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,18 @@ Tests are run by commands in the top level `Makefile` which has targets for simu

[source,make]
----
RISCV_TARGET?=riscvOVPsim
RISCV_DEVICE?=rv32i
RISCV_TARGET ?= riscvOVPsim
RISCV_DEVICE ?= rv32i
RISCV_PREFIX ?= riscv64-unknown-elf-
simulate:
make RISCV_TARGET=$(RISCV_TARGET) \
RISCV_DEVICE=$(RISCV_DEVICE) \
RISCV_PREFIX=riscv64-unknown-elf- \
run -C $(ISA)
RISCV_PREFIX=$(RISCV_PREFIX) \
run -C $(SUITEDIR)
verify:
verify.sh
riscv-test-env/verify.sh
----

== Setting the target environment
Expand All @@ -320,7 +321,6 @@ For tracing the test the following macros are defined in `riscv-target/riscvOVP
[source,make]
----
RVTEST_IO_INIT
RVTEST_IO_PUTC(_R)
RVTEST_IO_WRITE_STR(_STR)
RVTEST_IO_ASSERT_EQ(_R, _I)
----
Expand All @@ -338,7 +338,7 @@ RISCV_TARGET?=riscvOVPsim
RISCV_DEVICE?=rv32i
----

Also in the top level Makefile, you will need to configure other variables like `GCC_BIN`, `OVP_BIN`, `PATH` etc...
The path to the RUN_TARGET is defined within the riscv-target Makefile.include.


=== Codasip ISA simulator
Expand Down Expand Up @@ -456,6 +456,8 @@ The top level directory contains a `README.md` file giving an overview of the pr

`riscv-test-suite`:: This contains a subdirectory for each instruction set or instruction set extension. Within each subdirectory the source code and reference output for each test are in the `ISA` directory.

`riscv-ovpsim`:: This contains a copy of the Imperas OVP riscvOVPsim simulator for use in compliance testing. It includes a subdirectory of examples with pre-compiled .elf files and has binaries of the simulator for Linux64 and Windows64. This is referenced by the makefiles for developing and running the compliance suites. riscvOVPsim can run all the tracing and assertion macros used in the tests.

[appendix]
== Creative Commons Attribution 4.0 International License

Expand Down

0 comments on commit 0cd3faf

Please sign in to comment.