From 0cd3fafe6092216243fe44d7ea44cd9b742bf7b4 Mon Sep 17 00:00:00 2001 From: simon5656 Date: Wed, 20 Jun 2018 10:58:51 +0100 Subject: [PATCH] Updated test/doc for changes to test framework --- Makefile | 7 ++++--- README.md | 17 ++++++----------- doc/README.adoc | 16 +++++++++------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 92c6037..02cb19d 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index fe470dd..0392346 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/doc/README.adoc b/doc/README.adoc index 23be2af..8a02a2a 100644 --- a/doc/README.adoc +++ b/doc/README.adoc @@ -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 @@ -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) ---- @@ -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 @@ -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