diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad31dd8..174df8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,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 @@ -42,6 +42,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..afa09f9 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) @@ -131,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')