Skip to content

Commit

Permalink
Build Sail with cmake (#606)
Browse files Browse the repository at this point in the history
* Update sail installation in CI to use cmake

* Update README sail installation instructions for cmake

* Update riscof plugins to use new sail sim name
  • Loading branch information
jordancarlin authored Feb 6, 2025
1 parent a5a20fe commit b7634dc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ jobs:
curl --location https://github.com/rems-project/sail/releases/download/0.18-linux-binary/sail.tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
git clone https://github.com/riscv/sail-riscv.git
cd sail-riscv
ARCH=RV${{ matrix.xlen }} make
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
cmake --build build
mkdir -p $GITHUB_WORKSPACE/sail
mv c_emulator/riscv_sim_RV${{ matrix.xlen }} $GITHUB_WORKSPACE/sail/riscv_sim_RV${{ matrix.xlen }}
mv build/c_emulator/riscv_sim_rv${{ matrix.xlen }}d $GITHUB_WORKSPACE/sail/riscv_sim_rv${{ matrix.xlen }}d
- name: Save cached Sail
if: steps.cache-sail-restore.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -173,4 +174,4 @@ jobs:
name: riscof-artifact-rv${{ matrix.xlen }}
path: ${{ env.upload_path }}
compression-level: 6
overwrite: true
overwrite: true
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,10 @@ Then build the RISC-V Sail Model:
```bash
$ git clone https://github.com/riscv/sail-riscv.git
$ cd sail-riscv
$ ARCH=RV32 make
$ ARCH=RV64 make
$ ./build-simulators.sh
```

This will create a C simulator in `c_emulator/riscv_sim_RV64` and `c_emulator/riscv_sim_RV32`. You will need to add this path to your `$PATH` or create an alias to execute them from the command line.
This will create a C simulator in `build/c_emulator/riscv_sim_rv64d` and `build/c_emulator/riscv_sim_rv32d`. You will need to add this path to your `$PATH` or create an alias to execute them from the command line.


## Necessary Env Files
Expand Down
4 changes: 2 additions & 2 deletions riscof-plugins/rv32/sail_cSim/riscof_sail_cSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def __init__(self, *args, **kwargs):
path = config['PATH'] if 'PATH' in config else ""


self.sail_exe = { '32' : os.path.join(path,"riscv_sim_RV32"),
'64' : os.path.join(path,"riscv_sim_RV64")}
self.sail_exe = { '32' : os.path.join(path,"riscv_sim_rv32d"),
'64' : os.path.join(path,"riscv_sim_rv64d")}
self.isa_spec = os.path.abspath(config['ispec']) if 'ispec' in config else ''
self.platform_spec = os.path.abspath(config['pspec']) if 'ispec' in config else ''
self.make = config['make'] if 'make' in config else 'make'
Expand Down
4 changes: 2 additions & 2 deletions riscof-plugins/rv64/sail_cSim/riscof_sail_cSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def __init__(self, *args, **kwargs):
raise SystemExit(1)
self.num_jobs = str(config['jobs'] if 'jobs' in config else 1)
self.pluginpath = os.path.abspath(config['pluginpath'])
self.sail_exe = { '32' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV32"),
'64' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV64")}
self.sail_exe = { '32' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_rv32d"),
'64' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_rv64d")}
self.isa_spec = os.path.abspath(config['ispec']) if 'ispec' in config else ''
self.platform_spec = os.path.abspath(config['pspec']) if 'ispec' in config else ''
self.make = config['make'] if 'make' in config else 'make'
Expand Down

0 comments on commit b7634dc

Please sign in to comment.