Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
UmerShahidengr authored Nov 7, 2024
2 parents e40064c + c6b1faa commit 5d23fff
Show file tree
Hide file tree
Showing 117 changed files with 21,498 additions and 269 deletions.
3 changes: 0 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@
- [ ] Ran the new tests on RISCOF with SAIL/Spike as reference model successfully ?
- [ ] Ran the new tests on RISCOF in [coverage mode](https://riscof.readthedocs.io/en/stable/commands.html#coverage)
- [ ] Link to Google-Drive folder containing the new coverage reports ([See this](https://github.com/riscv-non-isa/riscv-arch-test/blob/main/CONTRIBUTION.md#uploading-test-stats) for more info): < SPECIFY HERE >
- [ ] Link to PR in RISCV-ISAC from which the reports were generated : < SPECIFY HERE >
- [ ] Changelog entry created with a minor patch

### Optional Checklist:

- [ ] RISCV-V CTG PR link if tests were generated using it : < SPECIFY HERE >
- [ ] Were the tests hand-written/modified ?
- [ ] Have you run these on any hard DUT model ? Please specify name and provide link if possible in the description
- [ ] If you have modified arch\_test.h Please provide a detailed description of the changes in the Description section above.
101 changes: 94 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
ACT-sail-spike:
name: ACT-sail-spike (RV${{ matrix.xlen }})
runs-on: ubuntu-22.04
# Set a 60-minute time limit for this job
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -42,7 +44,8 @@ jobs:
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-venv
sudo apt-get install -y gcc git autoconf automake libtool curl make unzip
sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev pkg-config
sudo apt-get install -y autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev pkg-config
sudo apt-get install -y device-tree-compiler libboost-regex-dev libboost-system-dev
pip3 install git+https://github.com/riscv/riscof.git
- name: Build RISCV-GNU Toolchain (${{ matrix.xlen }} bit)
Expand All @@ -61,29 +64,113 @@ jobs:
run: |
cd riscv-ctg
pip3 install --editable .
- name: Get Latest Spike Commit
run: |
SPIKE_HASH=$(git ls-remote https://github.com/riscv/riscv-isa-sim.git HEAD | awk '{ print $1}')
echo "SPIKE_HASH=$SPIKE_HASH" >> "$GITHUB_ENV"
- name: Restore cached Spike
id: cache-spike-restore
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/spike
key: spike-${{ env.SPIKE_HASH }}-RV${{ matrix.xlen }}

- name: Install Spike
if: steps.cache-spike-restore.outputs.cache-hit != 'true'
run: |
git clone https://github.com/riscv/riscv-isa-sim.git
sudo apt-get install device-tree-compiler libboost-regex-dev libboost-system-dev
cd riscv-isa-sim
mkdir build
cd build
../configure --prefix=$GITHUB_WORKSPACE/riscv64
../configure --prefix=$GITHUB_WORKSPACE/spike
make -j$(nproc)
sudo make install
echo $GITHUB_WORKSPACE/riscv64/bin >> $GITHUB_PATH
make install
- name: Save cached Spike
if: steps.cache-spike-restore.outputs.cache-hit != 'true'
id: cache-spike-save
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/spike
key: ${{ steps.cache-spike-restore.outputs.cache-primary-key }}

- name: Get Latest Sail Commit
run: |
SAIL_HASH=$(git ls-remote https://github.com/riscv/sail-riscv.git HEAD | awk '{ print $1}')
echo "SAIL_HASH=$SAIL_HASH" >> "$GITHUB_ENV"
- name: Restore cached Sail
id: cache-sail-restore
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/sail
key: sail-${{ env.SAIL_HASH }}-RV${{ matrix.xlen }}

- name: Install Sail
if: steps.cache-sail-restore.outputs.cache-hit != 'true'
run: |
sudo mkdir -p /usr/local
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
echo $PWD/c_emulator >> $GITHUB_PATH
mkdir -p $GITHUB_WORKSPACE/sail
mv c_emulator/riscv_sim_RV${{ matrix.xlen }} $GITHUB_WORKSPACE/sail/riscv_sim_RV${{ matrix.xlen }}
- name: Save cached Sail
if: steps.cache-sail-restore.outputs.cache-hit != 'true'
id: cache-sail-save
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/sail
key: ${{ steps.cache-sail-restore.outputs.cache-primary-key }}

- name: Set PATH
run: |
echo $GITHUB_WORKSPACE/spike/bin >> $GITHUB_PATH
echo $GITHUB_WORKSPACE/sail >> $GITHUB_PATH
- name: Config and run riscof for RV${{ matrix.xlen }}
run: |
cd riscof-plugins/rv${{ matrix.xlen }}
riscof run --config config.ini --suite ../../riscv-test-suite/rv${{ matrix.xlen }}i_m/ --env ../../riscv-test-suite/env
#Check the existance of the riscof work folder, and add the PATH to environment variable
- name: Check size and determine upload path
if: always()
id: check_size
run: |
work_folder="${{ github.workspace }}/riscof-plugins/rv${{ matrix.xlen }}/riscof_work/"
report_file="$work_folder/report.html"
if [ -d "$work_folder" ]; then
folder_size=$(du -sm "$work_folder" | cut -f1)
echo "Folder size: ${folder_size} MB"
if [ "$folder_size" -gt 1000 ]; then
echo "Size exceeds 1 GB. Checking if report exists."
if [ -f "$report_file" ]; then
echo "Uploading RISCOF generated report only."
echo "upload_path=$report_file" >> $GITHUB_ENV
else
echo "No report found. Skipping upload."
echo "upload_path=" >> $GITHUB_ENV
fi
else
echo "Size is within limit. Uploading complete RISCOF_WORK Folder."
echo "upload_path=$work_folder" >> $GITHUB_ENV
fi
else
echo "Folder does not exist. Skipping upload."
echo "upload_path=" >> $GITHUB_ENV
fi
# Upload the appropriate artifact (folder or report) and skip in case not exists
- name: Upload riscof artifact for rv${{ matrix.xlen }}
if: always() && env.upload_path != ''
uses: actions/upload-artifact@v4
with:
name: riscof-artifact-rv${{ matrix.xlen }}
path: ${{ env.upload_path }}
compression-level: 6
overwrite: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
*.DS_Store

riscv-target/

#ignore venv
riscv-isac/riscv-env
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## [3.10.0] - 2024-11-04
- Add support for Zvk* extensions
- Split float and double test cases into smaller ones
- Merged riscv-ctg and riscv-isac into riscv-arch-test, and updated README
- Updates crypto scalar instructions
- Physical Memory Protection (32/64) Tests and Covergroups
- CI updates: and updated Sail and Spike in CI
- Bug fixes


## [3.9.1] - 2024-07-01
- Converted one of the CANARY words to a delta instret count (there is a variable that will enable that)
- Converted CODE/DATA/SIG_BEGIN/END to include all the little incidental code, so the tests template improves
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ The files [`COPYING.BSD`](./COPYING.BSD), [`COPYING.APACHE`](./COPYING.APACHE) a
## Quick Links:

- RISCOF \[[DOCS](https://riscof.readthedocs.io/en/latest/)\] \[[REPO](https://github.com/riscv-software-src/riscof)\]: This is the next version of the architectural test framework currently under development
- RISCV-ISAC \[[DOCS](https://riscv-isac.readthedocs.io/en/latest/index.html)\] \[[REPO](https://github.com/riscv-software-src/riscv-isac)\] : This is an ISA level coverage extraction tool for RISC-V which used to generate the coverage statistics of the architectural tests.
- RISCV-CTG: \[[DOCS](https://riscv-ctg.readthedocs.io/en/latest/index.html)\]\[[REPO](https://github.com/riscv-software-src/riscv-ctg)\]: This is a RISC-V Architectural Test generator used to generate some of the tests already checked into this repository.
- RISCV-ISAC \[[DOCS](https://riscv-isac.readthedocs.io/en/latest/index.html)\]: This is an ISA level coverage extraction tool for RISC-V which used to generate the coverage statistics of the architectural tests.
- RISCV-CTG: \[[DOCS](https://riscv-ctg.readthedocs.io/en/latest/index.html)\]: This is a RISC-V Architectural Test generator used to generate some of the tests already checked into this repository.
- [Videos](https://youtu.be/VIW1or1Oubo): This Global Forum 2020 video provides an introduction to the above mentioned tools
- [riscvOVPsim](https://github.com/riscv-ovpsim/imperas-riscv-tests): Imperas freeware RISC-V reference simulator for compliance testing
- [riscvOVPsimPlus](https://www.ovpworld.org/riscvOVPsimPlus/): Imperas enhanced freeware RISC-V reference simulator for test development and verification
Expand Down Expand Up @@ -209,22 +209,23 @@ Note: Use sudo if the installation path requires administrative privileges.


### 2. SAIL (SAIL C-emulator)
First install the [Sail Compiler](https://github.com/rems-project/sail/). It is recommended to use the pre-compiled [binary release](https://github.com/rems-project/sail/releases). This can be performed as follows:

```bash
$ sudo apt-get install opam build-essential libgmp-dev z3 pkg-config zlib1g-dev
$ opam init -y --disable-sandboxing
$ opam switch create ocaml-base-compiler
$ opam install sail -y
$ eval $(opam config env)
$ sudo apt-get install libgmp-dev pkg-config zlib1g-dev curl
$ curl --location https://github.com/rems-project/sail/releases/download/0.18-linux-binary/sail.tar.gz | [sudo] tar xvz --directory=/path/to/install --strip-components=1
```
Note: Make sure to add the path `/path/to/install` to your `$PATH`.

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
$ ln -s sail-riscv/c_emulator/riscv_sim_RV64 /usr/bin/riscv_sim_RV64
$ ln -s sail-riscv/c_emulator/riscv_sim_RV32 /usr/bin/riscv_sim_RV32
```

This will create a C simulator in `c_emulator/riscv_sim_RV64` and `c_emulator/riscv_sim_RV32`. You will need to add these paths to your `$PATH` or create an alias to execute them from the command line.
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.


## Necessary Env Files
Expand Down
Loading

0 comments on commit 5d23fff

Please sign in to comment.