-
Notifications
You must be signed in to change notification settings - Fork 713
Allow "lite" Chipyard builds with a minimal subset of submodules #2212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7097bef
7704054
5afb1cd
00dff29
3692771
3bd2aef
7614371
a8ba8c4
315edcd
ddae0e0
c935741
4ea3930
1e45551
e529ec6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,21 +153,40 @@ lazy val testchipip = (project in file("generators/testchipip")) | |
.settings(libraryDependencies ++= rocketLibDeps.value) | ||
.settings(commonSettings) | ||
|
||
lazy val chipyard = (project in file("generators/chipyard")) | ||
.dependsOn(testchipip, rocketchip, boom, rocketchip_blocks, rocketchip_inclusive_cache, | ||
dsptools, rocket_dsp_utils, | ||
radiance, gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator, | ||
constellation, mempress, barf, shuttle, caliptra_aes, rerocc, | ||
compressacc, saturn, ara, firrtl2_bridge, vexiiriscv, tacit) | ||
.settings(libraryDependencies ++= rocketLibDeps.value) | ||
.settings( | ||
lazy val chipyard = { | ||
var chipyard = (project in file("generators/chipyard")) | ||
.dependsOn(testchipip, rocketchip, boom, rocketchip_blocks, rocketchip_inclusive_cache, | ||
dsptools, rocket_dsp_utils, | ||
radiance, gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator, | ||
constellation, barf, shuttle, rerocc, | ||
saturn, firrtl2_bridge, vexiiriscv, tacit) | ||
.settings(libraryDependencies ++= rocketLibDeps.value) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"org.reflections" % "reflections" % "0.10.2" | ||
) | ||
) | ||
.settings(commonSettings) | ||
.settings(Compile / unmanagedSourceDirectories += file("tools/stage/src/main/scala")) | ||
|
||
val includeAra = file("generators/ara/.git").exists() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now, why not add this for every SBT project Chipyard depends on (for most this would automatically add the dependency). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This scheme currently supports only leaf projects, so we can't blanket apply this. |
||
if (includeAra) chipyard = chipyard.dependsOn(ara) | ||
|
||
val includeCaliptraAes = file("generators/caliptra-aes-acc/.git").exists() | ||
if (includeCaliptraAes) chipyard = chipyard.dependsOn(caliptra_aes) | ||
|
||
val includeCompressAcc = file("generators/compress-acc/.git").exists() | ||
if (includeCompressAcc) chipyard = chipyard.dependsOn(compressacc) | ||
|
||
val includeMempress = file("generators/mempress/.git").exists() | ||
if (includeMempress) chipyard = chipyard.dependsOn(mempress) | ||
|
||
val includeSaturn = file("generators/saturn/.git").exists() | ||
if (includeSaturn) chipyard = chipyard.dependsOn(saturn) | ||
|
||
chipyard | ||
} | ||
|
||
lazy val compressacc = (project in file("generators/compress-acc")) | ||
.dependsOn(rocketchip) | ||
.settings(libraryDependencies ++= rocketLibDeps.value) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,29 +65,30 @@ HELP_COMMANDS += \ | |
# include additional subproject make fragments | ||
# see HELP_COMPILATION_VARIABLES | ||
######################################################################################### | ||
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)/generators/radiance/radiance.mk | ||
include $(base_dir)/tools/torture.mk | ||
Comment on lines
68
to
69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Do we want to also ignore unfound files for the other repositories? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR will eventually make those repos also optional |
||
-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/nvdla/nvdla.mk | ||
-include $(base_dir)/generators/radiance/radiance.mk | ||
|
||
|
||
######################################################################################### | ||
# Prerequisite lists | ||
######################################################################################### | ||
# 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) | ||
lookup_srcs = $(shell find -L $(1)/ -name target -prune -o \( ! -xtype l -a -iname "*.$(2)" ! -iname ".*" \) -print 2> /dev/null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make this find expression easier to read, i.e. |
||
else | ||
lookup_srcs = $(shell fd -L -t f -e $(2) . $(1)) | ||
endif | ||
|
||
# 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))) | ||
|
||
CHECK_SUBMODULES_COMMAND = echo "Checking all submodules in generators/ are initialized. Uninitialized submodules will be displayed" ; ! git submodule status $(base_dir)/generators | grep ^- | ||
CHECK_SUBMODULES_COMMAND = echo "Checking required submodules in generators/ are initialized. Uninitialized submodules will be displayed" ; ! git submodule status $(base_dir)/generators | grep '^-.*' | grep -vE "(ara|caliptra|compress|mempress|saturn)" | ||
|
||
SCALA_EXT = scala | ||
VLOG_EXT = sv v | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../ara/chipyard/AraConfigs.scala |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../caliptra-aes-acc/chipyard/CaliptraAESConfigs.scala |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../compress-acc/chipyard/CompressAccConfigs.scala |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../mempress/chipyard/MempressConfigs.scala |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../saturn/chipyard/SaturnConfigs.scala |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprisingly not horrible. I wonder if we can encode this a bit better though... maybe we can write a quick SBT plugin to do this for us for any Chipyard submodule). Dropping https://github.com/sbt/sbt-sriracha/blob/master/src/main/scala/SrirachaPlugin.scala for a reference on how to write a plugin. Or maybe we can write a quick SBT function to wrap this (like
freshProject
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SBT function seems fine.