Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Integrate Ara vector unit #1973

Merged
merged 11 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/check-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ search () {
}


submodules=("cva6" "boom" "ibex" "gemmini" "icenet" "nvdla" "rocket-chip" "rocket-chip-blocks" "rocket-chip-inclusive-cache" "testchipip" "riscv-sodor" "mempress" "bar-fetchers" "shuttle" "constellation" "fft-generator" "hardfloat" "caliptra-aes-acc" "rocc-acc-utils" "diplomacy" "rerocc" "compress-acc" "saturn")
submodules=("cva6" "boom" "ibex" "gemmini" "icenet" "nvdla" "rocket-chip" "rocket-chip-blocks" "rocket-chip-inclusive-cache" "testchipip" "riscv-sodor" "mempress" "bar-fetchers" "shuttle" "constellation" "fft-generator" "hardfloat" "caliptra-aes-acc" "rocc-acc-utils" "diplomacy" "rerocc" "compress-acc" "saturn" "ara")
dir="generators"
branches=("master" "main" "dev")
search
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ REMOTE_COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache
declare -A grouping
grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boomv3 chipyard-boomv4 chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike chipyard-clone chipyard-prefetchers chipyard-shuttle"
grouping["group-peripherals"]="chipyard-dmirocket chipyard-dmiboomv3 chipyard-dmiboomv4 chipyard-spiflashwrite chipyard-mmios chipyard-nocores chipyard-manyperipherals chipyard-chiplike chipyard-tethered chipyard-symmetric chipyard-llcchiplet"
grouping["group-accels"]="chipyard-compressacc chipyard-mempress chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla chipyard-aes256ecb chipyard-rerocc chipyard-rocketvector chipyard-shuttlevector"
grouping["group-accels"]="chipyard-compressacc chipyard-mempress chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla chipyard-aes256ecb chipyard-rerocc chipyard-rocketvector chipyard-shuttlevector chipyard-shuttleara"
grouping["group-constellation"]="chipyard-constellation"
grouping["group-tracegen"]="tracegen tracegen-boomv3 tracegen-boomv4"
grouping["group-other"]="icenet testchipip constellation rocketchip-amba rocketchip-tlsimple rocketchip-tlwidth rocketchip-tlxbar chipyard-clusters"
Expand Down Expand Up @@ -75,6 +75,7 @@ mapping["chipyard-aes256ecb"]=" CONFIG=AES256ECBRocketConfig"
mapping["chipyard-rerocc"]=" CONFIG=ReRoCCTestConfig"
mapping["chipyard-rocketvector"]=" CONFIG=MINV128D64RocketConfig"
mapping["chipyard-shuttlevector"]=" CONFIG=GENV256D128ShuttleConfig"
mapping["chipyard-shuttleara"]=" CONFIG=V4096Ara2LaneShuttleConfig USE_ARA=1 verilog"

mapping["constellation"]=" SUB_PROJECT=constellation"
mapping["firesim"]="TARGET_CONFIG=WithNIC_DDR3FRFCFSLLC4MB_FireSimRocketConfig"
Expand Down
8 changes: 8 additions & 0 deletions .github/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ case $1 in
run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-daxpy.riscv LOADMEM=1
run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-memcpy.riscv LOADMEM=1
;;
chipyard-shuttleara)
# Ara does not work with verilator
# run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-sgemm.riscv LOADMEM=1
# Ara cannot run strcmp
# run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-strcmp.riscv LOADMEM=1
# run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-daxpy.riscv LOADMEM=1
# run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/vec-memcpy.riscv LOADMEM=1
;;
tracegen)
run_tracegen
;;
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,6 @@
[submodule "software/firesim-paper-workloads"]
path = software/firesim-paper-workloads
url = https://github.com/firesim/firesim-paper-workloads.git
[submodule "generators/ara"]
path = generators/ara
url = https://github.com/ucb-bar/ara-wrapper.git
7 changes: 6 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ lazy val chipyard = (project in file("generators/chipyard"))
dsptools, rocket_dsp_utils,
gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator,
constellation, mempress, barf, shuttle, caliptra_aes, rerocc,
compressacc, saturn)
compressacc, saturn, ara)
.settings(libraryDependencies ++= rocketLibDeps.value)
.settings(
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -241,6 +241,11 @@ lazy val cva6 = (project in file("generators/cva6"))
.settings(libraryDependencies ++= rocketLibDeps.value)
.settings(commonSettings)

lazy val ara = (project in file("generators/ara"))
.dependsOn(rocketchip, shuttle)
.settings(libraryDependencies ++= rocketLibDeps.value)
.settings(commonSettings)

lazy val ibex = (project in file("generators/ibex"))
.dependsOn(rocketchip)
.settings(libraryDependencies ++= rocketLibDeps.value)
Expand Down
1 change: 1 addition & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ HELP_COMMANDS += \
#########################################################################################
include $(base_dir)/generators/cva6/cva6.mk
include $(base_dir)/generators/ibex/ibex.mk
include $(base_dir)/generators/ara/ara.mk
include $(base_dir)/generators/tracegen/tracegen.mk
include $(base_dir)/generators/nvdla/nvdla.mk
include $(base_dir)/tools/torture.mk
Expand Down
16 changes: 16 additions & 0 deletions docs/Generators/Ara.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Ara
===

`Ara <https://github.com/pulp-platform/ara>`__ is a RISC-V vector unit developed by the PULP project.
The Ara vector unit supports integration with either the Rocket or Shuttle in-order cores, following a similar methodology as used in the original Ara+CVA6 system.
Example Ara configurations are listed in ``generators/chipyard/src/main/scala/config/AraConfigs.scala``.

.. Warning:: Ara only supports a partial subset of the full V-extension. Notably, we do not support virtual memory or precise traps with Ara.

To compile simulators using Ara, you must pass an additional ``USE_ARA`` flag to the makefile.

.. Note:: Ara only supports VCS for simulation

.. code-block:: shell

make CONFIG=V4096Ara2LaneRocketConfig USE_ARA=1
1 change: 1 addition & 0 deletions docs/Generators/Saturn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Saturn is a parameterized RISC-V Vector Unit generator currently supporting inte
Saturn implements a compact short-vector-length vector microarchitecture suitable for deployment in a DSP-optimized core or area-efficient general-purpose core.

More documentation on Saturn will be released in the future.
A partial listing of supported Saturn configurations is in ``generators/chipyard/src/main/scala/config/SaturnConfigs.scala``.

* Full support for `V` application-profile RVV 1.0
* Precise traps with virtual memory
Expand Down
1 change: 1 addition & 0 deletions docs/Generators/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ so changes to the generators themselves will automatically be used when building
Mempress
CompressAcc
Prefetchers
Ara
1 change: 1 addition & 0 deletions generators/ara
Submodule ara added at ae77c7
32 changes: 32 additions & 0 deletions generators/chipyard/src/main/scala/config/AraConfigs.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package chipyard

import org.chipsalliance.cde.config.{Config}
import saturn.common.{VectorParams}

// Rocket-integrated configs
class V4096Ara2LaneRocketConfig extends Config(
new ara.WithAraRocketVectorUnit(4096, 2) ++
new freechips.rocketchip.rocket.WithNBigCores(1) ++
new chipyard.config.AbstractConfig)


class V8192Ara4LaneRocketConfig extends Config(
new ara.WithAraRocketVectorUnit(8192, 4) ++
new chipyard.config.WithSystemBusWidth(128) ++
new freechips.rocketchip.rocket.WithNBigCores(1) ++
new chipyard.config.AbstractConfig)


// Shuttle-integrated configs
class V4096Ara2LaneShuttleConfig extends Config(
new ara.WithAraShuttleVectorUnit(4096, 2) ++
new shuttle.common.WithNShuttleCores(1) ++
new chipyard.config.AbstractConfig)


class V8192Ara4LaneShuttleConfig extends Config(
new ara.WithAraShuttleVectorUnit(8192, 4) ++
new chipyard.config.WithSystemBusWidth(128) ++
new shuttle.common.WithShuttleTileBeatBytes(16) ++
new shuttle.common.WithNShuttleCores(1) ++
new chipyard.config.AbstractConfig)
5 changes: 5 additions & 0 deletions scripts/init-submodules-no-riscv-tools-nolog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ cd "$RDIR"
for name in \
toolchains/*-tools/* \
generators/cva6 \
generators/ara \
generators/nvdla \
toolchains/libgloss \
generators/gemmini \
Expand Down Expand Up @@ -115,6 +116,10 @@ cd "$RDIR"
git submodule update --init generators/nvdla
git -C generators/nvdla submodule update --init src/main/resources/hw

# Non-recursive clone to exclude ara submods
git submodule update --init generators/ara
git -C generators/ara submodule update --init ara

# Non-recursive clone to exclude gemmini-software
git submodule update --init generators/gemmini
git -C generators/gemmini/ submodule update --init --recursive software/gemmini-rocc-tests
Expand Down
2 changes: 1 addition & 1 deletion sims/verilator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ CHIPYARD_VERILATOR_FLAGS := \
# options dependent on whether external IP (cva6/NVDLA) or just chipyard is used
# NOTE: defer the evaluation of this until it is used!
PLATFORM_OPTS = $(shell \
if grep -qiP "module\s+(CVA6|NVDLA)" $(GEN_COLLATERAL_DIR)/*.*v; \
if grep -qiP "module\s+(CVA6|NVDLA|Ara)" $(GEN_COLLATERAL_DIR)/*.*v; \
then echo "$(VERILOG_IP_VERILATOR_FLAGS)"; \
else echo "$(CHIPYARD_VERILATOR_FLAGS)"; fi)

Expand Down
Loading