Skip to content

Commit

Permalink
Merge pull request #1307 from ucb-bar/spiketile
Browse files Browse the repository at this point in the history
Spike-as-a-Tile
  • Loading branch information
jerryz123 authored Feb 2, 2023
2 parents 41fd20a + 65bad16 commit e732fdf
Show file tree
Hide file tree
Showing 11 changed files with 1,839 additions and 22 deletions.
22 changes: 7 additions & 15 deletions .github/actions/create-conda-env/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
name: create-conda-env
description: 'Create conda environments if they dont exist'
inputs:
install-collateral:
description: 'Install Spike/Libgloss/etc'
required: false
default: true

runs:
using: "composite"
steps:
Expand All @@ -20,14 +14,12 @@ runs:
conda-lock install -n ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools ./conda-reqs/conda-lock-reqs/conda-requirements-esp-tools-linux-64.conda-lock.yml
conda deactivate
if [[ "${{ inputs.install-collateral }}" == 'true' ]]; then
echo "Add extra toolchain collateral to RISC-V install area"
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools
./scripts/build-toolchain-extra.sh riscv-tools -p $CONDA_PREFIX/riscv-tools
conda deactivate
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools
./scripts/build-toolchain-extra.sh esp-tools -p $CONDA_PREFIX/esp-tools
conda deactivate
fi
echo "Add extra toolchain collateral to RISC-V install area"
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools
./scripts/build-toolchain-extra.sh riscv-tools -p $CONDA_PREFIX/riscv-tools
conda deactivate
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools
./scripts/build-toolchain-extra.sh esp-tools -p $CONDA_PREFIX/esp-tools
conda deactivate
fi
shell: bash -leo pipefail {0}
3 changes: 2 additions & 1 deletion .github/scripts/defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LOCAL_FIRESIM_DIR=$LOCAL_CHIPYARD_DIR/sims/firesim/sim

# key value store to get the build groups
declare -A grouping
grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boom chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad"
grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boom chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike"
grouping["group-peripherals"]="chipyard-dmirocket chipyard-blkdev chipyard-spiflashread chipyard-spiflashwrite chipyard-mmios chipyard-lbwif"
grouping["group-accels"]="chipyard-fftgenerator chipyard-nvdla chipyard-mempress chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-streaming-fir chipyard-streaming-passthrough"
grouping["group-constellation"]="chipyard-constellation"
Expand All @@ -45,6 +45,7 @@ mapping["chipyard-streaming-fir"]=" CONFIG=StreamingFIRRocketConfig"
mapping["chipyard-streaming-passthrough"]=" CONFIG=StreamingPassthroughRocketConfig"
mapping["chipyard-hetero"]=" CONFIG=LargeBoomAndRocketConfig"
mapping["chipyard-boom"]=" CONFIG=SmallBoomConfig"
mapping["chipyard-spike"]=" CONFIG=SpikeConfig"
mapping["chipyard-blkdev"]=" CONFIG=SimBlockDeviceRocketConfig"
mapping["chipyard-hwacha"]=" CONFIG=HwachaRocketConfig"
mapping["chipyard-gemmini"]=" CONFIG=GemminiRocketConfig"
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ case $1 in
chipyard-boom)
run_bmark ${mapping[$1]}
;;
chipyard-spike)
run_bmark ${mapping[$1]}
;;
chipyard-hetero)
run_bmark ${mapping[$1]}
;;
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/chipyard-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ jobs:
uses: ./.github/actions/git-workaround
- name: Create conda env
uses: ./.github/actions/create-conda-env
with:
install-collateral: false
- name: Check commits of each submodule
run: |
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools
Expand All @@ -111,8 +109,6 @@ jobs:
uses: ./.github/actions/git-workaround
- name: Create conda env
uses: ./.github/actions/create-conda-env
with:
install-collateral: false
- name: Check that the tutorial-setup patches apply
run: |
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools
Expand All @@ -138,8 +134,6 @@ jobs:
uses: ./.github/actions/git-workaround
- name: Create conda env
uses: ./.github/actions/create-conda-env
with:
install-collateral: false
- name: Check that documentation builds with no warnings/errors
run: |
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools
Expand Down Expand Up @@ -535,6 +529,29 @@ jobs:
group-key: "group-cores"
project-key: "chipyard-sodor"

chipyard-spike-run-tests:
name: chipyard-spike-run-tests
needs: prepare-chipyard-cores
runs-on: self-hosted
steps:
- name: Delete old checkout
run: |
ls -alh .
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
ls -alh .
- name: Checkout
uses: actions/checkout@v3
- name: Git workaround
uses: ./.github/actions/git-workaround
- name: Create conda env
uses: ./.github/actions/create-conda-env
- name: Run tests
uses: ./.github/actions/run-tests
with:
group-key: "group-cores"
project-key: "chipyard-spike"

chipyard-fftgenerator-run-tests:
name: chipyard-fftgenerator-run-tests
needs: prepare-chipyard-accels
Expand Down
12 changes: 12 additions & 0 deletions docs/Software/Spike.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ full cycle-accurate simulation using software RTL simulators or FireSim.

Spike comes pre-packaged in the RISC-V toolchain and is available on the path as ``spike``.
More information can be found in the `Spike repository <https://github.com/riscv/riscv-isa-sim>`__.

Spike-as-a-Tile
-----------------

Chipyard contains experimental support for simulating a Spike processor model with the uncore, similar to a virtual-platform.
In this configuration, Spike is cache-coherent, and communicates with the uncore through a C++ TileLink private cache model.

.. code-block:: shell
make CONFIG=SpikeConfig run-binary BINARY=hello.riscv
Loading

0 comments on commit e732fdf

Please sign in to comment.