From 9a4eba787ff6129b31f9c082feda6fc61851064c Mon Sep 17 00:00:00 2001 From: Iztok Jeras Date: Sat, 29 Nov 2025 13:18:54 +0100 Subject: [PATCH 1/2] switch to sail-riscv 0.9, handling JSON with comments --- .github/workflows/main.yml | 3 ++- plugin-sail_cSim/riscof_sail_cSim.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f72843c..60a5a82 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: - name: '📦 Install Sail RISC-V reference model' run: | mkdir $GITHUB_WORKSPACE/sail-riscv - wget -q https://github.com/riscv/sail-riscv/releases/download/0.8/sail-riscv-Linux-x86_64.tar.gz + wget -q https://github.com/riscv/sail-riscv/releases/download/0.9/sail-riscv-Linux-x86_64.tar.gz tar -xzf $GITHUB_WORKSPACE/sail-riscv-Linux-x86_64.tar.gz -C $GITHUB_WORKSPACE/sail-riscv ls -al $GITHUB_WORKSPACE/sail-riscv/sail-riscv-Linux-x86_64/bin echo $GITHUB_WORKSPACE/sail-riscv/sail-riscv-Linux-x86_64/bin >> $GITHUB_PATH @@ -41,6 +41,7 @@ jobs: run: | echo "upstream RISCOF is broken! https://github.com/riscv-software-src/riscof/issues/122" pip3 install git+https://github.com/riscv/riscof.git@d38859f85fe407bcacddd2efcd355ada4683aee4 + pip3 install jsoncomment - name: '📦 Install GHDL' uses: ghdl/setup-ghdl@v1 diff --git a/plugin-sail_cSim/riscof_sail_cSim.py b/plugin-sail_cSim/riscof_sail_cSim.py index 1fcfc7a..d156038 100644 --- a/plugin-sail_cSim/riscof_sail_cSim.py +++ b/plugin-sail_cSim/riscof_sail_cSim.py @@ -7,6 +7,7 @@ import random import string import json +from jsoncomment import JsonComment from string import Template import riscof.utils as utils @@ -110,7 +111,9 @@ def runTests(self, testList, cgf_file=None, header_file= None): try: sail_config = subprocess.run(["sail_riscv_sim", "--print-default-config"], check= True, text=True, capture_output=True) - sail_config = json.loads(sail_config.stdout) + # Sail 0.9 generates non compliant JSON (contains C style inline comments) + parser = JsonComment(json) + sail_config = parser.loads(sail_config.stdout) except subprocess.CalledProcessError as e: print("sail_riscv_sim --print-default-config failed:", e.stderr) exit(1) From 903833d50b556042aa6b65fc47ef460852e2533a Mon Sep 17 00:00:00 2001 From: Iztok Jeras Date: Tue, 2 Dec 2025 04:36:49 +0100 Subject: [PATCH 2/2] Disabling 'Svrsw60t59b' since it is conflicting with disabled 'Sv39' --- plugin-sail_cSim/riscof_sail_cSim.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin-sail_cSim/riscof_sail_cSim.py b/plugin-sail_cSim/riscof_sail_cSim.py index d156038..afa09f9 100644 --- a/plugin-sail_cSim/riscof_sail_cSim.py +++ b/plugin-sail_cSim/riscof_sail_cSim.py @@ -134,6 +134,9 @@ def runTests(self, testList, cgf_file=None, header_file= None): sail_config["extensions"]["Sv32"]["supported"] = True sail_config["extensions"]["Zcf"]["supported"] = True + # Disabling "Svrsw60t59b" since it is conflicting with disabled "Sv39" + sail_config["extensions"]["Svrsw60t59b"]["supported"] = False + # For User-configuration: Replace this variable with your configuration. "/home/riscv-arch-test/custom_sail_config.json" sail_config_path = os.path.join(self.pluginpath, 'env', 'sail_config.json')