Merge branch 'main' into tetheredsim
This commit is contained in:
2
.github/scripts/check-commit.sh
vendored
2
.github/scripts/check-commit.sh
vendored
@@ -45,7 +45,7 @@ search () {
|
||||
done
|
||||
}
|
||||
|
||||
submodules=("cva6" "boom" "ibex" "gemmini" "hwacha" "icenet" "nvdla" "rocket-chip" "sha3" "sifive-blocks" "sifive-cache" "testchipip" "riscv-sodor" "mempress")
|
||||
submodules=("cva6" "boom" "ibex" "gemmini" "hwacha" "icenet" "nvdla" "rocket-chip" "sha3" "sifive-blocks" "sifive-cache" "testchipip" "riscv-sodor" "mempress" "bar-fetchers")
|
||||
dir="generators"
|
||||
branches=("master" "main" "dev")
|
||||
search
|
||||
|
||||
5
.github/scripts/defaults.sh
vendored
5
.github/scripts/defaults.sh
vendored
@@ -28,7 +28,7 @@ REMOTE_COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache
|
||||
|
||||
# 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 chipyard-spike chipyard-clone"
|
||||
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 chipyard-clone chipyard-prefetchers"
|
||||
grouping["group-peripherals"]="chipyard-dmirocket chipyard-dmiboom chipyard-spiflashwrite chipyard-mmios chipyard-nocores chipyard-manyperipherals chipyard-chiplike chipyard-tethered"
|
||||
grouping["group-accels"]="chipyard-mempress chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla"
|
||||
grouping["group-constellation"]="chipyard-constellation"
|
||||
@@ -42,9 +42,10 @@ 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"
|
||||
mapping["chipyard-manymmioaccels"]=" CONFIG=ManyMMIOAcceleratorRocketConfig"
|
||||
mapping["chipyard-nvdla"]=" CONFIG=SmallNVDLARocketConfig"
|
||||
mapping["chipyard-nvdla"]=" CONFIG=SmallNVDLARocketConfig verilog"
|
||||
mapping["chipyard-hetero"]=" CONFIG=LargeBoomAndRocketConfig"
|
||||
mapping["chipyard-boom"]=" CONFIG=MediumBoomCosimConfig"
|
||||
mapping["chipyard-dmiboom"]=" CONFIG=dmiMediumBoomCosimConfig"
|
||||
|
||||
3
.github/scripts/run-tests.sh
vendored
3
.github/scripts/run-tests.sh
vendored
@@ -60,6 +60,9 @@ case $1 in
|
||||
chipyard-hetero)
|
||||
run_bmark
|
||||
;;
|
||||
chipyard-prefetchers)
|
||||
make -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} run-binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv
|
||||
;;
|
||||
rocketchip)
|
||||
run_bmark
|
||||
;;
|
||||
|
||||
71
.github/workflows/chipyard-run-tests.yml
vendored
71
.github/workflows/chipyard-run-tests.yml
vendored
@@ -442,6 +442,29 @@ jobs:
|
||||
group-key: "group-cores"
|
||||
project-key: "chipyard-rocket"
|
||||
|
||||
chipyard-prefetchers-run-tests:
|
||||
name: chipyard-prefetchers-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-prefetchers"
|
||||
|
||||
chipyard-hetero-run-tests:
|
||||
name: chipyard-hetero-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
@@ -764,28 +787,28 @@ jobs:
|
||||
group-key: "group-accels"
|
||||
project-key: "chipyard-manymmioaccels"
|
||||
|
||||
chipyard-nvdla-run-tests:
|
||||
name: chipyard-nvdla-run-tests
|
||||
needs: prepare-chipyard-accels
|
||||
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-accels"
|
||||
project-key: "chipyard-nvdla"
|
||||
# chipyard-nvdla-run-tests:
|
||||
# name: chipyard-nvdla-run-tests
|
||||
# needs: prepare-chipyard-accels
|
||||
# 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-accels"
|
||||
# project-key: "chipyard-nvdla"
|
||||
|
||||
chipyard-mempress-run-tests:
|
||||
name: chipyard-mempress-run-tests
|
||||
@@ -1059,8 +1082,8 @@ jobs:
|
||||
chipyard-tethered-run-tests,
|
||||
chipyard-sha3-run-tests,
|
||||
chipyard-gemmini-run-tests,
|
||||
chipyard-manymmioaccels-run-tests,
|
||||
chipyard-nvdla-run-tests,
|
||||
chipyard-manymmioaccels-run-tests, # chipyard-nvdla-run-tests,
|
||||
chipyard-prefetchers-run-tests,
|
||||
chipyard-mempress-run-tests,
|
||||
chipyard-constellation-run-tests,
|
||||
tracegen-boom-run-tests,
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -124,3 +124,6 @@
|
||||
[submodule "software/embench/embench-iot"]
|
||||
path = software/embench/embench-iot
|
||||
url = https://github.com/embench/embench-iot.git
|
||||
[submodule "generators/bar-fetchers"]
|
||||
path = generators/bar-fetchers
|
||||
url = https://github.com/ucb-bar/bar-fetchers.git
|
||||
|
||||
@@ -153,7 +153,7 @@ lazy val chipyard = (project in file("generators/chipyard"))
|
||||
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)
|
||||
constellation, mempress, barf)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(
|
||||
libraryDependencies ++= Seq(
|
||||
@@ -168,6 +168,11 @@ lazy val mempress = (project in file("generators/mempress"))
|
||||
.settings(chiselTestSettings)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val barf = (project in file("generators/bar-fetchers"))
|
||||
.dependsOn(rocketchip)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val constellation = (project in file("generators/constellation"))
|
||||
.dependsOn(rocketchip)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
|
||||
25
common.mk
25
common.mk
@@ -68,7 +68,7 @@ include $(base_dir)/tools/torture.mk
|
||||
#########################################################################################
|
||||
# Prerequisite lists
|
||||
#########################################################################################
|
||||
# Returns a list of files in directory $1 with file extension $2.
|
||||
# Returns a list of files in directories $1 with single file extension $2.
|
||||
# If available, use 'fd' to find the list of files, which is faster than 'find'.
|
||||
ifeq ($(shell which fd 2> /dev/null),)
|
||||
lookup_srcs = $(shell find -L $(1)/ -name target -prune -o \( -iname "*.$(2)" ! -iname ".*" \) -print 2> /dev/null)
|
||||
@@ -76,9 +76,17 @@ else
|
||||
lookup_srcs = $(shell fd -L -t f -e $(2) . $(1))
|
||||
endif
|
||||
|
||||
SOURCE_DIRS = $(addprefix $(base_dir)/,generators sims/firesim/sim tools/barstools fpga/fpga-shells fpga/src)
|
||||
SCALA_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),scala)
|
||||
VLOG_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),sv) $(call lookup_srcs,$(SOURCE_DIRS),v)
|
||||
# Returns a list of files in directories $1 with *any* of the file extensions in $2
|
||||
lookup_srcs_by_multiple_type = $(foreach type,$(2),$(call lookup_srcs,$(1),$(type)))
|
||||
|
||||
SCALA_EXT = scala
|
||||
VLOG_EXT = sv v
|
||||
CHIPYARD_SOURCE_DIRS = $(addprefix $(base_dir)/,generators sims/firesim/sim fpga/fpga-shells fpga/src)
|
||||
CHIPYARD_SCALA_SOURCES = $(call lookup_srcs_by_multiple_type,$(CHIPYARD_SOURCE_DIRS),$(SCALA_EXT))
|
||||
CHIPYARD_VLOG_SOURCES = $(call lookup_srcs_by_multiple_type,$(CHIPYARD_SOURCE_DIRS),$(VLOG_EXT))
|
||||
BARSTOOLS_SOURCE_DIRS = $(addprefix $(base_dir)/,tools/barstools)
|
||||
BARSTOOLS_SCALA_SOURCES = $(call lookup_srcs_by_multiple_type,$(BARSTOOLS_SOURCE_DIRS),$(SCALA_EXT))
|
||||
BARSTOOLS_VLOG_SOURCES = $(call lookup_srcs_by_multiple_type,$(BARSTOOLS_SOURCE_DIRS),$(VLOG_EXT))
|
||||
# This assumes no SBT meta-build sources
|
||||
SBT_SOURCE_DIRS = $(addprefix $(base_dir)/,generators sims/firesim/sim tools)
|
||||
SBT_SOURCES = $(call lookup_srcs,$(SBT_SOURCE_DIRS),sbt) $(base_dir)/build.sbt $(base_dir)/project/plugins.sbt $(base_dir)/project/build.properties
|
||||
@@ -106,12 +114,12 @@ $(BOOTROM_TARGETS): $(build_dir)/bootrom.%.img: $(TESTCHIP_RSRCS_DIR)/testchipip
|
||||
#########################################################################################
|
||||
# compile scala jars
|
||||
#########################################################################################
|
||||
$(CHIPYARD_CLASSPATH_TARGETS) &: $(SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS)
|
||||
$(CHIPYARD_CLASSPATH_TARGETS) &: $(CHIPYARD_SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS)
|
||||
mkdir -p $(dir $@)
|
||||
$(call run_sbt_assembly,$(SBT_PROJECT),$(CHIPYARD_CLASSPATH))
|
||||
|
||||
# order only dependency between sbt runs needed to avoid concurrent sbt runs
|
||||
$(TAPEOUT_CLASSPATH_TARGETS) &: $(SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS) | $(CHIPYARD_CLASSPATH_TARGETS)
|
||||
$(TAPEOUT_CLASSPATH_TARGETS) &: $(BARSTOOLS_SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS) | $(CHIPYARD_CLASSPATH_TARGETS)
|
||||
mkdir -p $(dir $@)
|
||||
$(call run_sbt_assembly,tapeout,$(TAPEOUT_CLASSPATH))
|
||||
|
||||
@@ -200,19 +208,20 @@ else
|
||||
endif
|
||||
|
||||
$(MFC_LOWERING_OPTIONS):
|
||||
mkdir -p $(dir $@)
|
||||
ifeq (,$(ENABLE_YOSYS_FLOW))
|
||||
echo "$(MFC_BASE_LOWERING_OPTIONS)" > $@
|
||||
else
|
||||
echo "$(MFC_BASE_LOWERING_OPTIONS),disallowPackedArrays" > $@
|
||||
endif
|
||||
|
||||
$(FINAL_ANNO_FILE): $(EXTRA_ANNO_FILE) $(SFC_EXTRA_ANNO_FILE) $(VLOG_SOURCES) $(SFC_LEVEL)
|
||||
$(FINAL_ANNO_FILE): $(EXTRA_ANNO_FILE) $(SFC_EXTRA_ANNO_FILE) $(SFC_LEVEL)
|
||||
if [ $(shell cat $(SFC_LEVEL)) = low ]; then jq -s '[.[][]]' $(EXTRA_ANNO_FILE) $(SFC_EXTRA_ANNO_FILE) > $@; fi
|
||||
if [ $(shell cat $(SFC_LEVEL)) = none ]; then cat $(EXTRA_ANNO_FILE) > $@; fi
|
||||
touch $@
|
||||
|
||||
$(SFC_MFC_TARGETS) &: private TMP_DIR := $(shell mktemp -d -t cy-XXXXXXXX)
|
||||
$(SFC_MFC_TARGETS) &: $(TAPEOUT_CLASSPATH_TARGETS) $(FIRRTL_FILE) $(FINAL_ANNO_FILE) $(SFC_LEVEL) $(EXTRA_FIRRTL_OPTIONS) $(MFC_LOWERING_OPTIONS)
|
||||
$(SFC_MFC_TARGETS) &: $(TAPEOUT_CLASSPATH_TARGETS) $(FIRRTL_FILE) $(FINAL_ANNO_FILE) $(SFC_LEVEL) $(EXTRA_FIRRTL_OPTIONS) $(MFC_LOWERING_OPTIONS) $(CHIPYARD_VLOG_SOURCES) $(BARSTOOLS_VLOG_SOURCES)
|
||||
rm -rf $(GEN_COLLATERAL_DIR)
|
||||
$(call run_jar_scala_main,$(TAPEOUT_CLASSPATH),barstools.tapeout.transforms.GenerateModelStageMain,\
|
||||
--no-dedup \
|
||||
|
||||
9
docs/Generators/Prefetchers.rst
Normal file
9
docs/Generators/Prefetchers.rst
Normal file
@@ -0,0 +1,9 @@
|
||||
Prefetchers
|
||||
====================================
|
||||
|
||||
The BAR-fetchers library is a collection of Chisel-implemented prefetchers, designed for compatibility with Chipyard and Rocket-Chip SoCs.
|
||||
This package implements a generic prefetcher API, and example implementations of NextLine, Strided, and AMPM prefetchers.
|
||||
|
||||
Prefetchers can be instantiated in front of a L1D HellaCache, or as TileLink nodes in front of some TileLink bus.
|
||||
|
||||
An example configuration using prefetchers is found in the ``PrefetchingRocketConfig``
|
||||
@@ -34,3 +34,4 @@ so changes to the generators themselves will automatically be used when building
|
||||
NVDLA
|
||||
Sodor
|
||||
Mempress
|
||||
Prefetchers
|
||||
|
||||
1
generators/bar-fetchers
Submodule
1
generators/bar-fetchers
Submodule
Submodule generators/bar-fetchers added at 3a33d818ae
@@ -68,9 +68,9 @@ class MultiNoCConfig extends Config(
|
||||
"serial-tl" -> 0),
|
||||
outNodeMapping = ListMap(
|
||||
"error" -> 1, "l2[0]" -> 2, "pbus" -> 3, "plic" -> 4,
|
||||
"clint" -> 5, "dmInner" -> 6, "bootrom" -> 7, "tileClockGater" -> 8, "tileResetSetter" -> 9)),
|
||||
"clint" -> 5, "dmInner" -> 6, "bootrom" -> 7, "clock" -> 8)),
|
||||
NoCParams(
|
||||
topology = TerminalRouter(BidirectionalLine(10)),
|
||||
topology = TerminalRouter(BidirectionalLine(9)),
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(5) { UserVirtualChannelParams(4) }),
|
||||
routingRelation = NonblockingVirtualSubnetworksRouting(TerminalRouterRouting(BidirectionalLineRouting()), 5, 1))
|
||||
)) ++
|
||||
|
||||
@@ -118,3 +118,12 @@ class CustomIOChipTopRocketConfig extends Config(
|
||||
new chipyard.example.WithCustomIOCells ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++ // single rocket-core
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class PrefetchingRocketConfig extends Config(
|
||||
new barf.WithHellaCachePrefetcher(Seq(0), barf.SingleStridedPrefetcherParams()) ++ // strided prefetcher, sits in front of the L1D$, monitors core requests to prefetching into the L1D$
|
||||
new barf.WithTLICachePrefetcher(barf.MultiNextLinePrefetcherParams()) ++ // next-line prefetcher, sits between L1I$ and L2, monitors L1I$ misses to prefetch into L2
|
||||
new barf.WithTLDCachePrefetcher(barf.SingleAMPMPrefetcherParams()) ++ // AMPM prefetcher, sits between L1D$ and L2, monitors L1D$ misses to prefetch into L2
|
||||
new chipyard.config.WithTilePrefetchers ++ // add TL prefetchers between tiles and the sbus
|
||||
new freechips.rocketchip.subsystem.WithNonblockingL1(2) ++ // non-blocking L1D$, L1 prefetching only works with non-blocking L1D$
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++ // single rocket-core
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
@@ -9,7 +9,10 @@ import freechips.rocketchip.rocket.{RocketCoreParams, MulDivParams, DCacheParams
|
||||
|
||||
import boom.common.{BoomTileAttachParams}
|
||||
import cva6.{CVA6TileAttachParams}
|
||||
import sodor.common.{SodorTileAttachParams}
|
||||
import ibex.{IbexTileAttachParams}
|
||||
import testchipip._
|
||||
import barf.{TilePrefetchingMasterPortParams}
|
||||
|
||||
class WithL2TLBs(entries: Int) extends Config((site, here, up) => {
|
||||
case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map {
|
||||
@@ -79,3 +82,17 @@ class WithRocketDCacheScratchpad extends Config((site, here, up) => {
|
||||
}
|
||||
})
|
||||
|
||||
class WithTilePrefetchers extends Config((site, here, up) => {
|
||||
case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map {
|
||||
case tp: RocketTileAttachParams => tp.copy(crossingParams = tp.crossingParams.copy(
|
||||
master = TilePrefetchingMasterPortParams(tp.tileParams.hartId, tp.crossingParams.master)))
|
||||
case tp: BoomTileAttachParams => tp.copy(crossingParams = tp.crossingParams.copy(
|
||||
master = TilePrefetchingMasterPortParams(tp.tileParams.hartId, tp.crossingParams.master)))
|
||||
case tp: SodorTileAttachParams => tp.copy(crossingParams = tp.crossingParams.copy(
|
||||
master = TilePrefetchingMasterPortParams(tp.tileParams.hartId, tp.crossingParams.master)))
|
||||
case tp: IbexTileAttachParams => tp.copy(crossingParams = tp.crossingParams.copy(
|
||||
master = TilePrefetchingMasterPortParams(tp.tileParams.hartId, tp.crossingParams.master)))
|
||||
case tp: CVA6TileAttachParams => tp.copy(crossingParams = tp.crossingParams.copy(
|
||||
master = TilePrefetchingMasterPortParams(tp.tileParams.hartId, tp.crossingParams.master)))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@ index ec36a85f..c0c2849a 100644
|
||||
+// 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)
|
||||
constellation, mempress, barf)
|
||||
@@ -204,11 +204,11 @@ lazy val sodor = (project in file("generators/riscv-sodor"))
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
Reference in New Issue
Block a user