Skip to content

Commit 33f5040

Browse files
authored
Integrate Mempress memory tester (#1253)
1 parent fb2f83b commit 33f5040

File tree

12 files changed

+71
-8
lines changed

12 files changed

+71
-8
lines changed

.github/scripts/check-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ search () {
4747
done
4848
}
4949

50-
submodules=("cva6" "boom" "ibex" "gemmini" "hwacha" "icenet" "nvdla" "rocket-chip" "sha3" "sifive-blocks" "sifive-cache" "testchipip" "riscv-sodor")
50+
submodules=("cva6" "boom" "ibex" "gemmini" "hwacha" "icenet" "nvdla" "rocket-chip" "sha3" "sifive-blocks" "sifive-cache" "testchipip" "riscv-sodor" "mempress")
5151
dir="generators"
5252
branches=("master" "main" "dev")
5353
search

.github/scripts/defaults.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LOCAL_FIRESIM_DIR=$LOCAL_CHIPYARD_DIR/sims/firesim/sim
2727
declare -A grouping
2828
grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boom chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad"
2929
grouping["group-peripherals"]="chipyard-dmirocket chipyard-blkdev chipyard-spiflashread chipyard-spiflashwrite chipyard-mmios chipyard-lbwif"
30-
grouping["group-accels"]="chipyard-fftgenerator chipyard-nvdla chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-streaming-fir chipyard-streaming-passthrough"
30+
grouping["group-accels"]="chipyard-fftgenerator chipyard-nvdla chipyard-mempress chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-streaming-fir chipyard-streaming-passthrough"
3131
grouping["group-constellation"]="chipyard-constellation"
3232
grouping["group-tracegen"]="tracegen tracegen-boom"
3333
grouping["group-other"]="icenet testchipip constellation"
@@ -39,6 +39,7 @@ mapping["chipyard-rocket"]=""
3939
mapping["chipyard-dmirocket"]=" CONFIG=dmiRocketConfig"
4040
mapping["chipyard-lbwif"]=" CONFIG=LBWIFRocketConfig"
4141
mapping["chipyard-sha3"]=" CONFIG=Sha3RocketConfig"
42+
mapping["chipyard-mempress"]=" CONFIG=MempressRocketConfig"
4243
mapping["chipyard-digitaltop"]=" TOP=DigitalTop"
4344
mapping["chipyard-streaming-fir"]=" CONFIG=StreamingFIRRocketConfig"
4445
mapping["chipyard-streaming-passthrough"]=" CONFIG=StreamingPassthroughRocketConfig"

.github/scripts/run-tests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ case $1 in
6262
(cd $LOCAL_CHIPYARD_DIR/generators/sha3/software && ./build.sh)
6363
make -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} run-binary-fast BINARY=$LOCAL_CHIPYARD_DIR/generators/sha3/software/tests/bare/sha3-rocc.riscv
6464
;;
65+
chipyard-mempress)
66+
(cd $LOCAL_CHIPYARD_DIR/generators/mempress/software/src && make)
67+
make -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} run-binary-fast BINARY=$LOCAL_CHIPYARD_DIR/generators/mempress/software/src/mempress-rocc.riscv
68+
;;
6569
chipyard-streaming-passthrough)
6670
make -C $LOCAL_CHIPYARD_DIR/tests
6771
make -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} run-binary-fast BINARY=$LOCAL_CHIPYARD_DIR/tests/streaming-passthrough.riscv

.github/workflows/chipyard-run-tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,31 @@ jobs:
791791
group-key: "group-accels"
792792
project-key: "chipyard-nvdla"
793793

794+
chipyard-mempress-run-tests:
795+
name: chipyard-mempress-run-tests
796+
needs: prepare-chipyard-accels
797+
runs-on: self-hosted
798+
steps:
799+
- name: Delete old checkout
800+
run: |
801+
ls -alh .
802+
rm -rf ${{ github.workspace }}/* || true
803+
rm -rf ${{ github.workspace }}/.* || true
804+
ls -alh .
805+
- name: Checkout
806+
uses: actions/checkout@v3
807+
- name: Git workaround
808+
uses: ./.github/actions/git-workaround
809+
- name: Create conda env
810+
uses: ./.github/actions/create-conda-env
811+
- name: Run tests
812+
uses: ./.github/actions/run-tests
813+
with:
814+
group-key: "group-accels"
815+
project-key: "chipyard-mempress"
816+
toolchain: "esp-tools"
817+
818+
794819
tracegen-boom-run-tests:
795820
name: tracegen-boom-run-tests
796821
needs: prepare-chipyard-tracegen
@@ -1028,6 +1053,7 @@ jobs:
10281053
chipyard-hwacha-run-tests,
10291054
chipyard-gemmini-run-tests,
10301055
chipyard-nvdla-run-tests,
1056+
chipyard-mempress-run-tests,
10311057
chipyard-constellation-run-tests,
10321058
tracegen-boom-run-tests,
10331059
tracegen-run-tests,

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@
130130
[submodule "generators/constellation"]
131131
path = generators/constellation
132132
url = https://github.com/ucb-bar/constellation.git
133+
[submodule "generators/mempress"]
134+
path = generators/mempress
135+
url = https://github.com/ucb-bar/mempress.git

build.sbt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,16 @@ lazy val chipyard = (project in file("generators/chipyard"))
149149
sha3, // On separate line to allow for cleaner tutorial-setup patches
150150
dsptools, `rocket-dsp-utils`,
151151
gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator,
152-
constellation)
152+
constellation, mempress)
153153
.settings(libraryDependencies ++= rocketLibDeps.value)
154154
.settings(commonSettings)
155155

156+
lazy val mempress = (project in file("generators/mempress"))
157+
.dependsOn(rocketchip, midasTargetUtils)
158+
.settings(libraryDependencies ++= rocketLibDeps.value)
159+
.settings(chiselTestSettings)
160+
.settings(commonSettings)
161+
156162
lazy val constellation = (project in file("generators/constellation"))
157163
.dependsOn(rocketchip)
158164
.settings(libraryDependencies ++= rocketLibDeps.value)

docs/Generators/Mempress.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Mempress
2+
====================================
3+
4+
Mempress is a RoCC accelerator that generates memory requests through TileLink. It sends out requests as hard as it can to stress test the memory hierarchy of the Chipyard/Rocketchip-based SoC.
5+
6+
Mempress can generate multiple **streams** of memory requests. Each stream can be set up to generate read or write requests and configured to generate strided or random access patterns. Furthermore, the memory footprint of each stream is also configurable.
7+
8+
To add the Mempress unit into the SoC, you should add the ``mempress.WithMemPress`` config fragment to the SoC configurations.

docs/Generators/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ so changes to the generators themselves will automatically be used when building
3333
fft
3434
NVDLA
3535
Sodor
36+
Mempress
3637

generators/chipyard/src/main/scala/config/RocketConfigs.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ class TinyRocketConfig extends Config(
2121
new freechips.rocketchip.subsystem.With1TinyCore ++ // single tiny rocket-core
2222
new chipyard.config.AbstractConfig)
2323

24+
class MempressRocketConfig extends Config(
25+
new mempress.WithMemPress ++ // use Mempress (memory traffic generation) accelerator
26+
new freechips.rocketchip.subsystem.WithNBanks(8) ++
27+
new freechips.rocketchip.subsystem.WithInclusiveCache(nWays=16, capacityKB=2048) ++
28+
new chipyard.config.WithExtMemIdBits(7) ++ // use 7 bits for tl like request id
29+
new freechips.rocketchip.subsystem.WithNMemoryChannels(4) ++
30+
new chipyard.config.WithSystemBusWidth(128) ++
31+
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
32+
new chipyard.config.AbstractConfig)
33+
2434
// DOC include start: FFTRocketConfig
2535
class FFTRocketConfig extends Config(
2636
new fftgenerator.WithFFTGenerator(numPoints=8, width=16, decPt=8) ++ // add 8-point mmio fft at the default addr (0x2400) with 16bit fixed-point numbers.

generators/chipyard/src/main/scala/config/fragments/PeripheralFragments.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,7 @@ class WithSerialTLBackingMemory extends Config((site, here, up) => {
7272
)}
7373
})
7474

75+
class WithExtMemIdBits(n: Int) extends Config((site, here, up) => {
76+
case ExtMem => up(ExtMem, site).map(x => x.copy(master = x.master.copy(idBits = n)))
77+
})
78+

0 commit comments

Comments
 (0)