diff --git a/.github/scripts/check-commit.sh b/.github/scripts/check-commit.sh index 6b742366..f54fd50e 100755 --- a/.github/scripts/check-commit.sh +++ b/.github/scripts/check-commit.sh @@ -45,7 +45,7 @@ search () { done } -submodules=("cva6" "boom" "ibex" "gemmini" "icenet" "nvdla" "rocket-chip" "sha3" "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") +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") dir="generators" branches=("master" "main" "dev") search diff --git a/.github/scripts/defaults.sh b/.github/scripts/defaults.sh index 462e9773..124bdd3f 100755 --- a/.github/scripts/defaults.sh +++ b/.github/scripts/defaults.sh @@ -30,7 +30,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-mempress chipyard-sha3 chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla chipyard-aes256ecb" +grouping["group-accels"]="chipyard-mempress chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla chipyard-aes256ecb" 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" @@ -40,7 +40,6 @@ grouping["group-fpga"]="arty35t arty100t nexysvideo vc707 vcu118" declare -A mapping mapping["chipyard-rocket"]=" CONFIG=QuadChannelRocketConfig" mapping["chipyard-dmirocket"]=" CONFIG=dmiRocketConfig" -mapping["chipyard-sha3"]=" CONFIG=Sha3RocketConfig" mapping["chipyard-mempress"]=" CONFIG=MempressRocketConfig" mapping["chipyard-prefetchers"]=" CONFIG=PrefetchingRocketConfig" mapping["chipyard-digitaltop"]=" TOP=DigitalTop" diff --git a/.github/scripts/run-tests.sh b/.github/scripts/run-tests.sh index b1992602..31fea5d6 100755 --- a/.github/scripts/run-tests.sh +++ b/.github/scripts/run-tests.sh @@ -85,10 +85,6 @@ case $1 in run_binary BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/raw_hazard-baremetal run_binary BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/mvin_mvout-baremetal ;; - chipyard-sha3) - (cd $LOCAL_CHIPYARD_DIR/generators/sha3/software && ./build.sh) - run_binary BINARY=$LOCAL_CHIPYARD_DIR/generators/sha3/software/tests/bare/sha3-rocc.riscv - ;; chipyard-mempress) (cd $LOCAL_CHIPYARD_DIR/generators/mempress/software/src && make) run_binary BINARY=$LOCAL_CHIPYARD_DIR/generators/mempress/software/src/mempress-rocc.riscv diff --git a/.github/workflows/chipyard-run-tests.yml b/.github/workflows/chipyard-run-tests.yml index dd91f4de..0b644888 100644 --- a/.github/workflows/chipyard-run-tests.yml +++ b/.github/workflows/chipyard-run-tests.yml @@ -119,29 +119,6 @@ jobs: conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools .github/scripts/check-commit.sh - tutorial-setup-check: - name: tutorial-setup-check - needs: [setup-complete] - if: needs.change-filters.outputs.needs-rtl == 'true' - runs-on: as4 - 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: 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 - scripts/tutorial-setup.sh - documentation-check: name: documentation-check needs: [setup-complete] @@ -800,29 +777,6 @@ jobs: group-key: "group-peripherals" project-key: "chipyard-llcchiplet" - chipyard-sha3-run-tests: - name: chipyard-sha3-run-tests - needs: prepare-chipyard-accels - runs-on: as4 - 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-accels" - project-key: "chipyard-sha3" - chipyard-gemmini-run-tests: name: chipyard-gemmini-run-tests needs: prepare-chipyard-accels @@ -1172,7 +1126,6 @@ jobs: all_tests_passed: name: "all tests passed" needs: [commit-on-master-check, - tutorial-setup-check, documentation-check, chipyard-rocket-run-tests, chipyard-hetero-run-tests, @@ -1190,7 +1143,6 @@ jobs: chipyard-tethered-run-tests, chipyard-symmetric-run-tests, chipyard-llcchiplet-run-tests, - chipyard-sha3-run-tests, chipyard-gemmini-run-tests, chipyard-manymmioaccels-run-tests, # chipyard-nvdla-run-tests, chipyard-prefetchers-run-tests, diff --git a/.gitmodules b/.gitmodules index fcf0f3b1..240fad83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -55,9 +55,6 @@ [submodule "generators/rocket-chip-inclusive-cache"] path = generators/rocket-chip-inclusive-cache url = https://github.com/chipsalliance/rocket-chip-inclusive-cache.git -[submodule "generators/sha3"] - path = generators/sha3 - url = https://github.com/ucb-bar/sha3.git [submodule "generators/shuttle"] path = generators/shuttle url = https://github.com/ucb-bar/shuttle.git diff --git a/build.sbt b/build.sbt index 831a5af3..0775cd44 100644 --- a/build.sbt +++ b/build.sbt @@ -157,7 +157,6 @@ lazy val testchipip = (project in file("generators/testchipip")) lazy val chipyard = (project in file("generators/chipyard")) .dependsOn(testchipip, rocketchip, boom, rocketchip_blocks, rocketchip_inclusive_cache, - sha3, // On separate line to allow for cleaner tutorial-setup patches dsptools, rocket_dsp_utils, gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator, constellation, mempress, barf, shuttle, caliptra_aes) @@ -224,11 +223,6 @@ lazy val sodor = (project in file("generators/riscv-sodor")) .settings(libraryDependencies ++= rocketLibDeps.value) .settings(commonSettings) -lazy val sha3 = (project in file("generators/sha3")) - .dependsOn(rocketchip, midasTargetUtils) - .settings(libraryDependencies ++= rocketLibDeps.value) - .settings(commonSettings) - lazy val gemmini = (project in file("generators/gemmini")) .dependsOn(rocketchip) .settings(libraryDependencies ++= rocketLibDeps.value) diff --git a/docs/Chipyard-Basics/Chipyard-Components.rst b/docs/Chipyard-Basics/Chipyard-Components.rst index f3b0a4a7..a412c2a3 100644 --- a/docs/Chipyard-Basics/Chipyard-Components.rst +++ b/docs/Chipyard-Basics/Chipyard-Components.rst @@ -34,10 +34,6 @@ Accelerators **Gemmini** A matrix-multiply accelerator targeting neural-networks -**SHA3** - A fixed-function accelerator for the SHA3 hash function. This simple accelerator is used as a demonstration for some of the - Chipyard integration flows using the RoCC interface. - System Components: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/Customization/Custom-Chisel.rst b/docs/Customization/Custom-Chisel.rst index ff58e7c2..126f6837 100644 --- a/docs/Customization/Custom-Chisel.rst +++ b/docs/Customization/Custom-Chisel.rst @@ -60,7 +60,7 @@ should look something like this: lazy val chipyard = (project in file("generators/chipyard")) .dependsOn(testchipip, rocketchip, boom, rocketchip_blocks, rocketchip_inclusive_cache, - sha3, dsptools, `rocket-dsp-utils`, + dsptools, `rocket-dsp-utils`, gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator, yourproject, // <- added to the middle of the list for simplicity constellation, mempress) diff --git a/docs/Generators/SHA3.rst b/docs/Generators/SHA3.rst deleted file mode 100644 index 428e2ebe..00000000 --- a/docs/Generators/SHA3.rst +++ /dev/null @@ -1,81 +0,0 @@ -SHA3 RoCC Accelerator -=================================== -The SHA3 accelerator is a basic RoCC accelerator for the SHA3 hashing algorithm. -We like using SHA3 in Chipyard tutorial content because it is a self-contained, simple -example of integrating a custom accelerator into Chipyard. - - -Introduction ------------------------------------ -Secure hashing algorithms represent a class of hashing functions that provide four attributes: ease -of hash computation, inability to generate the message from the hash (one-way property), inability -to change the message and not the hash (weakly collision free property), and inability to find -two messages with the same hash (strongly collision free property). The National Institute of -Standards and Technology (NIST) recently held a competition for a new algorithm to be added to -its set of Secure Hashing Algorithms (SHA). In 2012 the winner was determined to be the Keccak -hashing function and a rough specification for SHA3 was established. The algorithm operates on -variable length messages with a sponge function, and thus alternates between absorbing chunks of -the message into a set of state bits and permuting the state. The absorbing is a simple bitwise -XOR while the permutation is a more complex function composed of several operations, χ, θ, ρ, -π, ι, that all perform various bitwise operations, including rotations, parity calculations, XORs, -etc. The Keccak hashing function is parameterized for different sizes of state and message chunks -but for this accelerator we will only support the Keccak-256 variant with 1600 bits of state and -1088 bit message chunks. A diagram of the SHA3 accelerator is shown below. - -.. image:: ../_static/images/sha3.png - -Technical Details ------------------------------------- -The accelerator is designed around three sub-systems, an -interface with the processor, an interface with memory, and -the actual hashing computation system. The interface -with the processor is designed using the ROCC interface for -coprocessors integrating with the RISC-V Rocket/BOOM -processor. It includes the ability to transfer two 64 bit -words to the co-processor, the request for a return value, -and a small field for the function requested. The accelerator -receives these requests using a ready/valid interface. The -ROCC instruction is parsed and the needed information is -stored into a execution context. The execution context contains -the memory address of the message being hashed, the memory address -to store the resulting hash in, the length of the message, and -several other control fields. - -Once the execution context is valid the memory subsystem -then begins to fetch chunks of the message. The memory -subsystem is fully decoupled from the other subsystems -and maintains a single full round memory buffers. -The accelerators memory interface can provide a -maximum of one 64 bit word per cycle which corresponds -to 17 requests needed to fill a buffer (the size is dictated by -the SHA3 algorithm). Memory requests to fill these buffers -are sent out as rapidly as the memory interface can handle, -with a tag field set to allow the different memory buffers -requests to be distinguished, as they may be returned out of -order. Once the memory subsystem has filled a buffer the -control unit absorbs the buffer into the execution -context, at which point the execution context is free to -begin permutation, and the memory buffer is free to send -more memory requests. - -After the buffer is absorbed, the hashing computation -subsystem begins the permutation operations. Once -the message is fully hashed, the hash is written to memory -with a simple state machine. - - -Using a SHA3 Accelerator ------------------------- -Since the SHA3 accelerator is designed as a RoCC accelerator, -it can be mixed into a Rocket or BOOM core by overriding the -``BuildRoCC`` key. The config fragment is defined in the SHA3 -generator. An example configuration highlighting the use of -this config fragment is shown here: - -.. literalinclude:: ../../generators/chipyard/src/main/scala/config/RocketSha3Configs.scala - :language: scala - :start-after: DOC include start: Sha3Rocket - :end-before: DOC include end: Sha3Rocket - -The SHA3 example baremetal and Linux tests are located in the SHA3 repository. -Please refer to its `README.md `_ for more information on how to run/build the tests. diff --git a/docs/Generators/index.rst b/docs/Generators/index.rst index 82de74a9..88d9ee2a 100644 --- a/docs/Generators/index.rst +++ b/docs/Generators/index.rst @@ -26,7 +26,6 @@ so changes to the generators themselves will automatically be used when building IceNet TestChipIP Rocket-Chip-Generators - SHA3 CVA6 Ibex fft diff --git a/generators/chipyard/src/main/scala/config/RocketSha3Configs.scala b/generators/chipyard/src/main/scala/config/RocketSha3Configs.scala deleted file mode 100644 index 43ad1de3..00000000 --- a/generators/chipyard/src/main/scala/config/RocketSha3Configs.scala +++ /dev/null @@ -1,22 +0,0 @@ -package chipyard - -import org.chipsalliance.cde.config.{Config} -import freechips.rocketchip.diplomacy.{AsynchronousCrossing} - -// -------------- -// Rocket+SHA3 Configs -// These live in a separate file to simplify patching out for the tutorials. -// -------------- - -// DOC include start: Sha3Rocket -class Sha3RocketConfig extends Config( - new sha3.WithSha3Accel ++ // add SHA3 rocc accelerator - new freechips.rocketchip.subsystem.WithNBigCores(1) ++ - new chipyard.config.AbstractConfig) -// DOC include end: Sha3Rocket - -class Sha3RocketPrintfConfig extends Config( - new sha3.WithSha3Printf ++ - new sha3.WithSha3Accel ++ // add SHA3 rocc accelerator - new freechips.rocketchip.subsystem.WithNBigCores(1) ++ - new chipyard.config.AbstractConfig) diff --git a/generators/chipyard/src/main/scala/config/TutorialConfigs.scala b/generators/chipyard/src/main/scala/config/TutorialConfigs.scala index 7225c800..dca2af03 100644 --- a/generators/chipyard/src/main/scala/config/TutorialConfigs.scala +++ b/generators/chipyard/src/main/scala/config/TutorialConfigs.scala @@ -12,10 +12,6 @@ import scala.collection.immutable.ListMap // For each of 4 phases, participants will customize and build a // small demonstration config. -// This file is designed to be used after running chipyard/scripts/tutorial-setup.sh, -// which removes the SHA3 accelerator RTL, and provides participants -// the experience of integrating external RTL. - // This file was originally developed for the cancelled ASPLOS-2020 // Chipyard tutorial. While the configs here work, the corresponding // slideware has not yet been created. @@ -54,26 +50,6 @@ class TutorialMMIOConfig extends Config( new chipyard.config.AbstractConfig ) -// Tutorial Phase 3: Integrate a SHA3 RoCC accelerator -class TutorialSha3Config extends Config( - // Uncomment this line once you added SHA3 to the build.sbt, and cloned the SHA3 repo - // new sha3.WithSha3Accel ++ - - // For this demonstration we assume the base system is a single-core Rocket, for fast elaboration - new freechips.rocketchip.subsystem.WithNBigCores(1) ++ - new chipyard.config.AbstractConfig -) - -// Tutorial Phase 4: Integrate a Black-box verilog version of the SHA3 RoCC accelerator -class TutorialSha3BlackBoxConfig extends Config( - // Uncomment these lines once SHA3 is integrated - // new sha3.WithSha3BlackBox ++ // Specify we want the Black-box verilog version of Sha3 Ctrl - // new sha3.WithSha3Accel ++ - - // For this demonstration we assume the base system is a single-core Rocket, for fast elaboration - new freechips.rocketchip.subsystem.WithNBigCores(1) ++ - new chipyard.config.AbstractConfig -) // Tutorial Phase 5: Map a multicore heterogeneous SoC with multiple cores and memory-mapped accelerators class TutorialNoCConfig extends Config( diff --git a/generators/sha3 b/generators/sha3 deleted file mode 160000 index 2d38585d..00000000 --- a/generators/sha3 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2d38585d6410ca51ab19040fc23b1f6b3465270c diff --git a/scripts/init-submodules-no-riscv-tools-nolog.sh b/scripts/init-submodules-no-riscv-tools-nolog.sh index e46af0ca..c81c95f1 100755 --- a/scripts/init-submodules-no-riscv-tools-nolog.sh +++ b/scripts/init-submodules-no-riscv-tools-nolog.sh @@ -72,7 +72,6 @@ cd "$RDIR" generators/cva6 \ generators/nvdla \ toolchains/libgloss \ - generators/sha3 \ generators/gemmini \ generators/rocket-chip \ sims/firesim \ @@ -101,9 +100,6 @@ cd "$RDIR" ) ( - # Non-recursive clone to exclude riscv-linux - git submodule update --init generators/sha3 - # Non-recursive clone to exclude cva6 submods git submodule update --init generators/cva6 git -C generators/cva6 submodule update --init src/main/resources/cva6/vsrc/cva6 diff --git a/scripts/tutorial-patches/build.sbt.patch b/scripts/tutorial-patches/build.sbt.patch deleted file mode 100644 index f6f735b7..00000000 --- a/scripts/tutorial-patches/build.sbt.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/build.sbt b/build.sbt -index c3be6161..2a6d7160 100644 ---- a/build.sbt -+++ b/build.sbt -@@ -147,7 +147,7 @@ lazy val testchipip = (project in file("generators/testchipip")) - - lazy val chipyard = (project in file("generators/chipyard")) - .dependsOn(testchipip, rocketchip, boom, rocketchip_blocks, rocketchip_inclusive_cache, -- sha3, // On separate line to allow for cleaner tutorial-setup patches -+ //sha3, // On separate line to allow for cleaner tutorial-setup patches - dsptools, rocket_dsp_utils, - gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator, - constellation, mempress, barf, shuttle, caliptra_aes) -@@ -219,10 +219,10 @@ lazy val sodor = (project in file("generators/riscv-sodor")) - .settings(libraryDependencies ++= rocketLibDeps.value) - .settings(commonSettings) - --lazy val sha3 = (project in file("generators/sha3")) -- .dependsOn(rocketchip, midasTargetUtils) -- .settings(libraryDependencies ++= rocketLibDeps.value) -- .settings(commonSettings) -+// lazy val sha3 = (project in file("generators/sha3")) -+// .dependsOn(rocketchip, midasTargetUtils) -+// .settings(libraryDependencies ++= rocketLibDeps.value) -+// .settings(commonSettings) - - lazy val gemmini = (project in file("generators/gemmini")) - .dependsOn(rocketchip) diff --git a/scripts/tutorial-setup.sh b/scripts/tutorial-setup.sh deleted file mode 100755 index 080043f5..00000000 --- a/scripts/tutorial-setup.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -ex - -RDIR=$(git rev-parse --show-toplevel) - -cd $RDIR - -git rm generators/chipyard/src/main/scala/config/RocketSha3Configs.scala -git rm -rf generators/sha3 - -for p in scripts/tutorial-patches/*.patch -do - echo "Applying tutorial patch $p" - git apply $p -done