forked from riscv-non-isa/riscv-arch-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support and instructions for using the C and OCaml simulators …
…from the Sail RISC-V formal model as targets. * added subdirectories riscv-target/sail-riscv-c and riscv-target/sail-riscv-ocaml * updated README.md and doc/README.adoc
- Loading branch information
1 parent
2657d67
commit fac250b
Showing
27 changed files
with
650 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// RISC-V Compliance IO Test Header File | ||
|
||
/* | ||
* Copyright (c) 2005-2018 Imperas Software Ltd., www.imperas.com | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#ifndef _COMPLIANCE_IO_H | ||
#define _COMPLIANCE_IO_H | ||
|
||
//----------------------------------------------------------------------- | ||
// RV IO Macros (Non functional) | ||
//----------------------------------------------------------------------- | ||
|
||
#define RVTEST_IO_INIT | ||
#define RVTEST_IO_WRITE_STR(_SP, _STR) | ||
#define RVTEST_IO_CHECK() | ||
#define RVTEST_IO_ASSERT_GPR_EQ(_SP, _R, _I) | ||
#define RVTEST_IO_ASSERT_SFPR_EQ(_F, _R, _I) | ||
#define RVTEST_IO_ASSERT_DFPR_EQ(_D, _R, _I) | ||
|
||
#endif // _COMPLIANCE_IO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// RISC-V Compliance Test Header File | ||
// Copyright (c) 2017, Codasip Ltd. All Rights Reserved. | ||
// See LICENSE for license details. | ||
// | ||
// Description: Common header file for RV32I tests | ||
|
||
#ifndef _COMPLIANCE_TEST_H | ||
#define _COMPLIANCE_TEST_H | ||
|
||
#include "riscv_test.h" | ||
|
||
//----------------------------------------------------------------------- | ||
// RV Compliance Macros | ||
//----------------------------------------------------------------------- | ||
|
||
#define RV_COMPLIANCE_HALT \ | ||
RVTEST_PASS \ | ||
|
||
#define RV_COMPLIANCE_RV32M \ | ||
RVTEST_RV32M \ | ||
|
||
#define RV_COMPLIANCE_CODE_BEGIN \ | ||
RVTEST_CODE_BEGIN \ | ||
|
||
#define RV_COMPLIANCE_CODE_END \ | ||
RVTEST_CODE_END \ | ||
|
||
#define RV_COMPLIANCE_DATA_BEGIN \ | ||
RVTEST_DATA_BEGIN \ | ||
|
||
#define RV_COMPLIANCE_DATA_END \ | ||
RVTEST_DATA_END \ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV32 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv32-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV64 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv64-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TARGET_SIM ?= riscv_sim_RV64 | ||
ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),) | ||
$(error Target simulator executable '$(TARGET_SIM)` not found) | ||
endif | ||
|
||
RUN_TARGET=\ | ||
$(TARGET_SIM) \ | ||
--test-signature=$(work_dir_isa)/$(*).signature.output \ | ||
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>&2 | ||
|
||
|
||
RISCV_PREFIX ?= riscv64-unknown-elf- | ||
RISCV_GCC ?= $(RISCV_PREFIX)gcc | ||
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump | ||
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles | ||
|
||
COMPILE_TARGET=\ | ||
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \ | ||
-I$(ROOTDIR)/riscv-test-env/ \ | ||
-I$(ROOTDIR)/riscv-test-env/p/ \ | ||
-I$(TARGETDIR)/$(RISCV_TARGET)/ \ | ||
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \ | ||
-o $(work_dir_isa)/$$@; \ | ||
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump |
Oops, something went wrong.