Skip to content

Commit 30d29c7

Browse files
committed
Update sail plugin and improve riscof makefile
1 parent 14b3e54 commit 30d29c7

File tree

11 files changed

+614
-209
lines changed

11 files changed

+614
-209
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
],
1212

1313
"postAttachCommand": {
14-
"Fix workspaces permissions": "sudo chown -R vscode /workspaces",
1514
"Fix commandhistory permissions": "sudo chown -R vscode: /commandhistory",
16-
"uv sync": "uv sync"
15+
"Fix workspaces permissions and uv sync": "sudo chown -R vscode /workspaces && uv sync"
1716
},
1817

1918
"customizations": {

.github/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN mkdir -p /usr/local \
1414
&& cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_GMP=FALSE -GNinja \
1515
&& cmake --build build \
1616
&& mkdir -p /opt/sail-riscv \
17-
&& mv build/c_emulator/* /opt/sail-riscv
17+
&& mv build/c_emulator/sail_riscv_sim /opt/sail-riscv/sail_riscv_sim
1818

1919
FROM mcr.microsoft.com/devcontainers/rust:bookworm
2020

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = https://github.com/eembc/coremark
44
[submodule "riscof/riscv-arch-test"]
55
path = riscof/riscv-arch-test
6-
url = https://github.com/riscv-non-isa/riscv-arch-test
6+
url = https://github.com/riscv-non-isa/riscv-arch-test.git
77
[submodule "micropython/micropython"]
88
path = micropython/micropython
99
url = https://github.com/micropython/micropython

riscof/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
!env/
22
riscof_work/
3+
riscof_db/

riscof/Makefile

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
1-
run:
2-
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env --no-browser
1+
SUITE ?= riscv-arch-test/riscv-test-suite
2+
ENV ?= riscv-arch-test/riscv-test-suite/env
3+
CONFIG ?= config.ini
4+
WORK_DIR ?= riscof_work
5+
DB_DIR ?= riscof_db
36

4-
run-dut:
5-
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env --no-ref-run
7+
ARGS = --suite $(SUITE) --env $(ENV) --config $(CONFIG) --work-dir $(WORK_DIR)
68

7-
run-ref:
8-
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env --no-dut-run
9+
RUN_DEPS = clean-work $(WORK_DIR)/test_list.yaml
10+
11+
RUN_ARGS = $(ARGS) --testfile $(WORK_DIR)/test_list.yaml --no-clean
12+
13+
.PHONY: run run-dut run-ref validate clean clean-work
14+
15+
run: $(RUN_DEPS)
16+
riscof run $(RUN_ARGS) --no-browser
17+
18+
run-dut: $(RUN_DEPS)
19+
riscof run $(RUN_ARGS) --no-ref-run
20+
21+
run-ref: $(RUN_DEPS)
22+
riscof run $(RUN_ARGS) --no-dut-run
923

1024
validate:
11-
riscof validateyaml --config=config.ini
25+
riscof validateyaml --work-dir $(WORK_DIR) --config $(CONFIG)
26+
27+
clean: clean-work
28+
rm -rf $(DB_DIR)
29+
30+
clean-work:
31+
rm -rf $(WORK_DIR)
32+
33+
$(WORK_DIR)/test_list.yaml: $(DB_DIR)/test_list.yaml
34+
mkdir -p $(WORK_DIR)
35+
cp -r $(DB_DIR)/* $(WORK_DIR)
1236

13-
testlist:
14-
riscof testlist --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env
37+
$(DB_DIR)/test_list.yaml: mlogv32/mlogv32_isa.yaml mlogv32/mlogv32_platform.yaml $(CONFIG)
38+
rm -rf $(DB_DIR)
39+
riscof testlist $(ARGS)
40+
mv $(WORK_DIR) $(DB_DIR)

riscof/config.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ pluginpath=./mlogv32
99
ispec=./mlogv32/mlogv32_isa.yaml
1010
pspec=./mlogv32/mlogv32_platform.yaml
1111
target_run=1
12+
jobs=8
1213
# change these when running the tests on another computer (FIXME: hack)
1314
host_repo_path=/Users/object/Git/mlogv32
1415
riscof_repo_path=/workspaces/mlogv32
1516

1617
[sail_cSim]
1718
pluginpath=./sail_cSim
19+
jobs=8

riscof/mlogv32/env/model_test.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#ifndef _COMPLIANCE_MODEL_H
22
#define _COMPLIANCE_MODEL_H
3+
4+
#define ALIGNMENT 2
5+
36
#define RVMODEL_DATA_SECTION \
47
.align 8; .global begin_regstate; begin_regstate: \
58
.word 128; \
@@ -69,12 +72,12 @@ mlogv32_bss_done: \
6972
//RV_COMPLIANCE_DATA_BEGIN
7073
#define RVMODEL_DATA_BEGIN \
7174
RVMODEL_DATA_SECTION \
72-
.align 4;\
75+
.align ALIGNMENT;\
7376
.global begin_signature; begin_signature:
7477

7578
//RV_COMPLIANCE_DATA_END
7679
#define RVMODEL_DATA_END \
77-
.align 4;\
80+
.align ALIGNMENT;\
7881
.global end_signature; end_signature:
7982

8083
//RVTEST_IO_INIT

0 commit comments

Comments
 (0)