Merge remote-tracking branch 'origin/dev' into abe-docs-dev
This commit is contained in:
@@ -439,10 +439,20 @@ jobs:
|
|||||||
# Order and dependencies of jobs to run
|
# Order and dependencies of jobs to run
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
submodules-on-master:
|
||||||
|
jobs:
|
||||||
|
# Check to make sure submodule commits are on master branches
|
||||||
|
- commit-on-master-check
|
||||||
|
triggers:
|
||||||
|
- schedule:
|
||||||
|
cron: "0 0 * * *"
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
build-and-test-chipyard-integration:
|
build-and-test-chipyard-integration:
|
||||||
jobs:
|
jobs:
|
||||||
# check to make sure commits are on master
|
|
||||||
- commit-on-master-check
|
|
||||||
|
|
||||||
# Make the toolchains
|
# Make the toolchains
|
||||||
- install-riscv-toolchain
|
- install-riscv-toolchain
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ declare -A mapping
|
|||||||
mapping["example"]="SUB_PROJECT=example"
|
mapping["example"]="SUB_PROJECT=example"
|
||||||
mapping["boomexample"]="SUB_PROJECT=example CONFIG=DefaultBoomConfig"
|
mapping["boomexample"]="SUB_PROJECT=example CONFIG=DefaultBoomConfig"
|
||||||
mapping["boomrocketexample"]="SUB_PROJECT=example CONFIG=DefaultBoomAndRocketConfig"
|
mapping["boomrocketexample"]="SUB_PROJECT=example CONFIG=DefaultBoomAndRocketConfig"
|
||||||
mapping["boom"]="SUB_PROJECT=boom"
|
mapping["boom"]="SUB_PROJECT=example CONFIG=SmallBoomConfig"
|
||||||
mapping["rocketchip"]="SUB_PROJECT=rocketchip"
|
mapping["rocketchip"]="SUB_PROJECT=rocketchip"
|
||||||
mapping["blockdevrocketchip"]="SUB_PROJECT=example CONFIG=BlockDeviceModelRocketConfig TOP=BoomRocketTopWithBlockDevice"
|
mapping["blockdevrocketchip"]="SUB_PROJECT=example CONFIG=BlockDeviceModelRocketConfig TOP=BoomRocketTopWithBlockDevice"
|
||||||
mapping["hwacha"]="SUB_PROJECT=example CONFIG=HwachaL2Config GENERATOR_PACKAGE=hwacha"
|
mapping["hwacha"]="SUB_PROJECT=example CONFIG=HwachaL2Config GENERATOR_PACKAGE=hwacha"
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,6 +5,8 @@ target
|
|||||||
*.stamp
|
*.stamp
|
||||||
*.vcd
|
*.vcd
|
||||||
*.swp
|
*.swp
|
||||||
|
*#
|
||||||
|
*~
|
||||||
.idea
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
env.sh
|
env.sh
|
||||||
|
|||||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -42,7 +42,7 @@
|
|||||||
url = https://github.com/ucb-bar/esp-tools.git
|
url = https://github.com/ucb-bar/esp-tools.git
|
||||||
[submodule "vlsi/hammer"]
|
[submodule "vlsi/hammer"]
|
||||||
path = vlsi/hammer
|
path = vlsi/hammer
|
||||||
url = git@github.com:ucb-bar/hammer.git
|
url = https://github.com/ucb-bar/hammer.git
|
||||||
[submodule "vlsi/hammer-cad-plugins"]
|
[submodule "vlsi/hammer-cad-plugins"]
|
||||||
path = vlsi/hammer-cad-plugins
|
path = vlsi/hammer-cad-plugins
|
||||||
url = git@github.com:ucb-bar/hammer-cad-plugins
|
url = https://github.com/ucb-bar/hammer-cad-plugins.git
|
||||||
|
|||||||
15
common.mk
15
common.mk
@@ -47,16 +47,13 @@ $(FIRRTL_FILE) $(ANNO_FILE): $(SCALA_SOURCES) $(sim_files)
|
|||||||
# create verilog files rules and variables
|
# create verilog files rules and variables
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
REPL_SEQ_MEM = --infer-rw --repl-seq-mem -c:$(MODEL):-o:$(TOP_SMEMS_CONF)
|
REPL_SEQ_MEM = --infer-rw --repl-seq-mem -c:$(MODEL):-o:$(TOP_SMEMS_CONF)
|
||||||
HARNESS_REPL_SEQ_MEM = --infer-rw --repl-seq-mem -c:$(MODEL):-o:$(HARNESS_SMEMS_CONF)
|
HARNESS_CONF_FLAGS = -thconf $(HARNESS_SMEMS_CONF)
|
||||||
|
|
||||||
$(TOP_FILE) $(TOP_SMEMS_CONF) $(TOP_ANNO) $(TOP_FIR) $(sim_top_blackboxes): $(FIRRTL_FILE) $(ANNO_FILE)
|
TOP_TARGETS = $(TOP_FILE) $(TOP_SMEMS_CONF) $(TOP_ANNO) $(TOP_FIR) $(sim_top_blackboxes)
|
||||||
cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateTop -o $(TOP_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(MODEL) -faf $(ANNO_FILE) -tsaof $(TOP_ANNO) -tsf $(TOP_FIR) $(REPL_SEQ_MEM) -td $(build_dir)"
|
HARNESS_TARGETS = $(HARNESS_FILE) $(HARNESS_SMEMS_CONF) $(HARNESS_ANNO) $(HARNESS_FIR) $(sim_harness_blackboxes)
|
||||||
grep -v ".*\.h" $(build_dir)/firrtl_black_box_resource_files.f > $(sim_top_blackboxes)
|
|
||||||
|
|
||||||
# note: this depends on sim_top_blackboxes to avoid race condition where firrtl_black_box_resource_files.f is created at the same time
|
$(TOP_TARGETS) $(HARNESS_TARGETS): $(FIRRTL_FILE) $(ANNO_FILE)
|
||||||
$(HARNESS_FILE) $(HARNESS_SMEMS_CONF) $(HARNESS_ANNO) $(HARNESS_FIR) $(sim_harness_blackboxes): $(FIRRTL_FILE) $(ANNO_FILE) $(sim_top_blackboxes)
|
cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateTopAndHarness -o $(TOP_FILE) -tho $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(VLOG_MODEL) -faf $(ANNO_FILE) -tsaof $(TOP_ANNO) -tdf $(sim_top_blackboxes) -tsf $(TOP_FIR) -thaof $(HARNESS_ANNO) -hdf $(sim_harness_blackboxes) -thf $(HARNESS_FIR) $(REPL_SEQ_MEM) $(HARNESS_CONF_FLAGS) -td $(build_dir)"
|
||||||
cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateHarness -o $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(VLOG_MODEL) -faf $(ANNO_FILE) -thaof $(HARNESS_ANNO) -thf $(HARNESS_FIR) $(HARNESS_REPL_SEQ_MEM) -td $(build_dir)"
|
|
||||||
grep -v ".*\.h" $(build_dir)/firrtl_black_box_resource_files.f > $(sim_harness_blackboxes)
|
|
||||||
|
|
||||||
# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
|
# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
|
||||||
MACROCOMPILER_MODE ?= --mode synflops
|
MACROCOMPILER_MODE ?= --mode synflops
|
||||||
@@ -70,7 +67,7 @@ $(HARNESS_SMEMS_FILE) $(HARNESS_SMEMS_FIR): $(HARNESS_SMEMS_CONF)
|
|||||||
########################################################################################
|
########################################################################################
|
||||||
# remove duplicate files in blackbox/simfiles
|
# remove duplicate files in blackbox/simfiles
|
||||||
########################################################################################
|
########################################################################################
|
||||||
$(sim_common_files): $(sim_top_blackboxes) $(sim_harness_blackboxes) $(sim_files)
|
$(sim_common_files): $(sim_files) $(sim_top_blackboxes) $(sim_harness_blackboxes)
|
||||||
awk '{print $1;}' $^ | sort -u > $@
|
awk '{print $1;}' $^ | sort -u > $@
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
|||||||
50
docs/Advanced-Usage/DTM-Debugging.rst
Normal file
50
docs/Advanced-Usage/DTM-Debugging.rst
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
Debugging with DTM/JTAG
|
||||||
|
===============================
|
||||||
|
|
||||||
|
By default, Chipyard is not setup to use the Debug Test Module (DTM) to bringup the core.
|
||||||
|
Instead, Chipyard uses TSI commands to bringup the core (which normally results in a faster simulation).
|
||||||
|
TSI simulations use the SimSerial interface to directly write the test binary into memory, while the DTM
|
||||||
|
executes a small loop of code to write the test binary byte-wise into memory.
|
||||||
|
However, if you want to use JTAG, you must do the following steps to setup a DTM enabled system.
|
||||||
|
|
||||||
|
Creating a DTM/JTAG Config
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
First, a DTM config must be created for the system that you want to create.
|
||||||
|
This involves specifying the SoC top-level to add a DTM as well as configuring that DTM to use JTAG.
|
||||||
|
|
||||||
|
.. code-block:: scala
|
||||||
|
|
||||||
|
class DTMBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
|
In this example, the ``WithDTMBoomRocketTop`` mixin specifies that the top-level SoC will instantiate a DTM.
|
||||||
|
The ``WithJtagDTM`` will configure that instantiated DTM to use JTAG as the bringup method (note: this can be removed if you want a DTM-only bringup).
|
||||||
|
The rest of the mixins specify the rest of the system (cores, accelerators, etc).
|
||||||
|
|
||||||
|
Starting the DTM Simulation
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
After creating the config, call the ``make`` command like the following:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
cd sims/verilator
|
||||||
|
# or
|
||||||
|
cd sims/vcs
|
||||||
|
|
||||||
|
make CONFIG=DTMBoomConfig TOP=BoomRocketTopWithDTM MODEL=TestHarnessWithDTM
|
||||||
|
|
||||||
|
In this example, this will use the config that you previously specified, as well as set the other parameters that are needed to satisfy the build system.
|
||||||
|
After that point, you should have a JTAG enabled simulation that you can attach to using OpenOCD and GDB!
|
||||||
|
|
||||||
|
Debugging with JTAG
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
Please refer to the following resources on how to debug with JTAG.
|
||||||
|
|
||||||
|
* https://github.com/chipsalliance/rocket-chip#-debugging-with-gdb
|
||||||
|
* https://github.com/riscv/riscv-isa-sim#debugging-with-gdb
|
||||||
38
docs/Advanced-Usage/Resources.rst
Normal file
38
docs/Advanced-Usage/Resources.rst
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
Accessing Scala Resources
|
||||||
|
===============================
|
||||||
|
|
||||||
|
A simple way to copy over a source file to the build directory to be used for a simulation compile or VLSI flow is to use the ``setResource`` or ``addResource`` functions given by FIRRTL.
|
||||||
|
They can be used in the following way:
|
||||||
|
|
||||||
|
.. code-block:: scala
|
||||||
|
|
||||||
|
class SimSerial(w: Int) extends BlackBox with HasBlackBoxResource {
|
||||||
|
val io = IO(new Bundle {
|
||||||
|
val clock = Input(Clock())
|
||||||
|
val reset = Input(Bool())
|
||||||
|
val serial = Flipped(new SerialIO(w))
|
||||||
|
val exit = Output(Bool())
|
||||||
|
})
|
||||||
|
|
||||||
|
setResource("/testchipip/vsrc/SimSerial.v")
|
||||||
|
setResource("/testchipip/csrc/SimSerial.cc")
|
||||||
|
}
|
||||||
|
|
||||||
|
In this example, the ``SimSerial`` files will be copied from a specific folder (in this case the ``path/to/testchipip/src/main/resources/testchipip/...``) to the build folder.
|
||||||
|
The ``set/addResource`` path retrieves resources from the ``src/main/resources`` directory.
|
||||||
|
So to get an item at ``src/main/resources/fileA.v`` you can use ``setResource("/fileA.v")``.
|
||||||
|
However, one caveat of this approach is that to retrieve the file during the FIRRTL compile, you must have that project in the FIRRTL compiler's classpath.
|
||||||
|
Thus, you need to add the SBT project as a dependency to the FIRRTL compiler in the Chipyard ``build.sbt``, which in Chipyards case is the ``tapeout`` project.
|
||||||
|
For example, you added a new project called ``myAwesomeAccel`` in the Chipyard ``build.sbt``.
|
||||||
|
Then you can add it as a ``dependsOn`` dependency to the ``tapeout`` project.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: scala
|
||||||
|
|
||||||
|
lazy val myAwesomeAccel = (project in file("generators/myAwesomeAccelFolder"))
|
||||||
|
.dependsOn(rocketchip)
|
||||||
|
.settings(commonSettings)
|
||||||
|
|
||||||
|
lazy val tapeout = conditionalDependsOn(project in file("./tools/barstools/tapeout/"))
|
||||||
|
.dependsOn(myAwesomeAccel)
|
||||||
|
.settings(commonSettings)
|
||||||
@@ -4,3 +4,9 @@ Advanced Usage
|
|||||||
The following sections are advanced topics about how to use Chipyard and special features of the framework.
|
The following sections are advanced topics about how to use Chipyard and special features of the framework.
|
||||||
They expect you to know about Chisel, Parameters, Configs, etc.
|
They expect you to know about Chisel, Parameters, Configs, etc.
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Advanced Usage:
|
||||||
|
|
||||||
|
DTM-Debugging
|
||||||
|
Resources
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
.. _build-a-chip:
|
||||||
|
|
||||||
Building A Chip
|
Building A Chip
|
||||||
==============================
|
==============================
|
||||||
TODO
|
TODO
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
.. _chipyard-components:
|
||||||
|
|
||||||
Chipyard Components
|
Chipyard Components
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
.. _adding-an-accelerator:
|
||||||
|
|
||||||
Adding An Accelerator/Device
|
Adding An Accelerator/Device
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,14 @@ Start by fetching Chipyard's sources. Run:
|
|||||||
cd chipyard
|
cd chipyard
|
||||||
./scripts/init-submodules-no-riscv-tools.sh
|
./scripts/init-submodules-no-riscv-tools.sh
|
||||||
|
|
||||||
This will have initialized submodules and installed the RISC-V tools and
|
This will have initialized the git submodules.
|
||||||
other dependencies.
|
|
||||||
|
|
||||||
Installing the RISC-V Tools
|
Installing the RISC-V Tools
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
We need to install the RISC-V toolchain in order to be able to run RISC-V programs using the Chipyard infrastructure.
|
We need to install the RISC-V toolchain in order to be able to run RISC-V programs using the Chipyard infrastructure.
|
||||||
This will take about 20-30 minutes. You can expedite the process by setting a ``make`` environment variable to use parallel cores: ``export MAKEFLAGS=-j8``.
|
This will take about 20-30 minutes. You can expedite the process by setting a ``make`` environment variable to use parallel cores: ``export MAKEFLAGS=-j8``.
|
||||||
TO build the toolchains, you should run:
|
To build the toolchains, you should run:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@@ -34,9 +33,9 @@ What's Next?
|
|||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
This depends on what you are planning to do with Chipyard.
|
This depends on what you are planning to do with Chipyard.
|
||||||
- If you want to learn about the structure of Chipyard, go to <>.
|
- If you want to learn about the structure of Chipyard, go to :ref:`chipyard-components`.
|
||||||
- If you intend to build one of the vanilla Chipyard examples, go to <> and follow the instructions.
|
- If you intend to build one of the vanilla Chipyard examples, go to :ref:`build-a-chip` and follow the instructions.
|
||||||
- If you intend to add a new accelerator, go to <> and follow the instructions.
|
- If you intend to add a new accelerator, go to :ref:`adding-an-accelerator` and follow the instructions.
|
||||||
- If you intend to run a simulation of one of the vanilla Chipyard examples, go to :ref:`sw-rtl-sim-intro` and follow the instructions.
|
- If you intend to run a simulation of one of the vanilla Chipyard examples, go to :ref:`sw-rtl-sim-intro` and follow the instructions.
|
||||||
- If you intend to run a simulation of a custom Chipyard SoC Configuration, go to <> and follow the instructions.
|
- If you intend to run a simulation of a custom Chipyard SoC Configuration, go to <> and follow the instructions.
|
||||||
- If you intend to run a full-system FireSim simulation, go to :ref:`firesim-sim-intro` and follow the instructions.
|
- If you intend to run a full-system FireSim simulation, go to :ref:`firesim-sim-intro` and follow the instructions.
|
||||||
|
|||||||
@@ -46,6 +46,13 @@ New to Chipyard? Jump to the :ref:`Chipyard Basics` page for more info.
|
|||||||
:numbered:
|
:numbered:
|
||||||
Customization/index
|
Customization/index
|
||||||
|
|
||||||
|
:maxdepth: 3
|
||||||
|
:caption: Advanced Usage:
|
||||||
|
:numbered:
|
||||||
|
Advanced-Usage/index
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
|||||||
Submodule generators/boom updated: 848795715f...4e9d496d36
90
generators/example/src/main/scala/BoomConfigs.scala
Normal file
90
generators/example/src/main/scala/BoomConfigs.scala
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import chisel3._
|
||||||
|
|
||||||
|
import freechips.rocketchip.config.{Config}
|
||||||
|
import freechips.rocketchip.subsystem.{WithJtagDTM}
|
||||||
|
|
||||||
|
import boom.common._
|
||||||
|
|
||||||
|
// ---------------------
|
||||||
|
// BOOM Configs
|
||||||
|
// ---------------------
|
||||||
|
|
||||||
|
class SmallBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
|
class MediumBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.MediumBoomConfig)
|
||||||
|
|
||||||
|
class LargeBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.LargeBoomConfig)
|
||||||
|
|
||||||
|
class MegaBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.MegaBoomConfig)
|
||||||
|
|
||||||
|
class jtagSmallBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
|
class jtagMediumBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.MediumBoomConfig)
|
||||||
|
|
||||||
|
class jtagLargeBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.LargeBoomConfig)
|
||||||
|
|
||||||
|
class jtagMegaBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.MegaBoomConfig)
|
||||||
|
|
||||||
|
class SmallDualBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallDualBoomConfig)
|
||||||
|
|
||||||
|
class TracedSmallBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.TracedSmallBoomConfig)
|
||||||
|
|
||||||
|
class SmallRV32UnifiedBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallRV32UnifiedBoomConfig)
|
||||||
|
|
||||||
|
// --------------------------
|
||||||
|
// BOOM + Rocket Configs
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
class SmallBoomAndRocketConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallBoomAndRocketConfig)
|
||||||
|
|
||||||
|
class MediumBoomAndRocketConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.MediumBoomAndRocketConfig)
|
||||||
|
|
||||||
|
class DualMediumBoomAndDualRocketConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.DualMediumBoomAndDualRocketConfig)
|
||||||
@@ -58,6 +58,15 @@ class WithNormalBoomRocketTop extends Config((site, here, up) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to specify a top level BOOM and/or Rocket system with DTM
|
||||||
|
*/
|
||||||
|
class WithDTMBoomRocketTop extends Config((site, here, up) => {
|
||||||
|
case BuildBoomRocketTopWithDTM => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||||
|
Module(LazyModule(new BoomRocketTopWithDTM()(p)).module)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to specify a top level BOOM and/or Rocket system with PWM
|
* Class to specify a top level BOOM and/or Rocket system with PWM
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ class HwachaL2Config extends Config(
|
|||||||
|
|
||||||
class BaseBoomConfig extends Config(
|
class BaseBoomConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.LargeBoomConfig)
|
new boom.common.LargeBoomConfig)
|
||||||
|
|
||||||
class SmallBaseBoomConfig extends Config(
|
class SmallBaseBoomConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.SmallBoomConfig)
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
class DefaultBoomConfig extends Config(
|
class DefaultBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
@@ -132,7 +132,7 @@ class DualCoreBoomConfig extends Config(
|
|||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
@@ -142,14 +142,14 @@ class DualCoreSmallBoomConfig extends Config(
|
|||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithSmallBooms ++
|
new boom.common.WithSmallBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class RV32UnifiedBoomConfig extends Config(
|
class RV32UnifiedBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.SmallRV32UnifiedBoomConfig)
|
new boom.common.SmallRV32UnifiedBoomConfig)
|
||||||
|
|
||||||
class BoomL2Config extends Config(
|
class BoomL2Config extends Config(
|
||||||
new WithInclusiveCache ++
|
new WithInclusiveCache ++
|
||||||
@@ -161,22 +161,22 @@ class BoomL2Config extends Config(
|
|||||||
|
|
||||||
class BaseBoomAndRocketConfig extends Config(
|
class BaseBoomAndRocketConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(1) ++
|
new boom.common.WithNBoomCores(1) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class SmallBaseBoomAndRocketConfig extends Config(
|
class SmallBaseBoomAndRocketConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithSmallBooms ++
|
new boom.common.WithSmallBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(1) ++
|
new boom.common.WithNBoomCores(1) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
@@ -223,11 +223,11 @@ class GPIOBoomAndRocketConfig extends Config(
|
|||||||
class DualCoreBoomAndOneRocketConfig extends Config(
|
class DualCoreBoomAndOneRocketConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
@@ -237,12 +237,12 @@ class DualBoomAndOneHwachaRocketConfig extends Config(
|
|||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new WithMultiRoCC ++
|
new WithMultiRoCC ++
|
||||||
new WithMultiRoCCHwacha(0) ++ // put Hwacha just on hart0 which was renumbered to Rocket
|
new WithMultiRoCCHwacha(0) ++ // put Hwacha just on hart0 which was renumbered to Rocket
|
||||||
new boom.system.WithRenumberHarts(rocketFirst = true) ++
|
new boom.common.WithRenumberHarts(rocketFirst = true) ++
|
||||||
new hwacha.DefaultHwachaConfig ++
|
new hwacha.DefaultHwachaConfig ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
@@ -250,12 +250,12 @@ class DualBoomAndOneHwachaRocketConfig extends Config(
|
|||||||
class RV32BoomAndRocketConfig extends Config(
|
class RV32BoomAndRocketConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithBoomRV32 ++
|
new boom.common.WithBoomRV32 ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(1) ++
|
new boom.common.WithNBoomCores(1) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithRV32 ++
|
new freechips.rocketchip.subsystem.WithRV32 ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import chisel3._
|
|||||||
import freechips.rocketchip.config.{Parameters}
|
import freechips.rocketchip.config.{Parameters}
|
||||||
import freechips.rocketchip.util.{GeneratorApp}
|
import freechips.rocketchip.util.{GeneratorApp}
|
||||||
|
|
||||||
import boom.system.{BoomTilesKey, TestSuiteHelper}
|
|
||||||
|
|
||||||
object Generator extends GeneratorApp {
|
object Generator extends GeneratorApp {
|
||||||
// add unique test suites
|
// add unique test suites
|
||||||
override def addTestSuites {
|
override def addTestSuites {
|
||||||
|
|||||||
@@ -8,14 +8,19 @@ import firrtl.transforms.{BlackBoxResourceAnno, BlackBoxSourceHelper}
|
|||||||
import freechips.rocketchip.diplomacy.LazyModule
|
import freechips.rocketchip.diplomacy.LazyModule
|
||||||
import freechips.rocketchip.config.{Field, Parameters}
|
import freechips.rocketchip.config.{Field, Parameters}
|
||||||
import freechips.rocketchip.util.GeneratorApp
|
import freechips.rocketchip.util.GeneratorApp
|
||||||
|
import freechips.rocketchip.devices.debug.{Debug}
|
||||||
|
|
||||||
// --------------------------
|
// -------------------------------
|
||||||
// BOOM and/or Rocket Test Harness
|
// BOOM and/or Rocket Test Harness
|
||||||
// --------------------------
|
// -------------------------------
|
||||||
|
|
||||||
case object BuildBoomRocketTop extends Field[(Clock, Bool, Parameters) => BoomRocketTopModule[BoomRocketTop]]
|
case object BuildBoomRocketTop extends Field[(Clock, Bool, Parameters) => BoomRocketTopModule[BoomRocketTop]]
|
||||||
|
case object BuildBoomRocketTopWithDTM extends Field[(Clock, Bool, Parameters) => BoomRocketTopWithDTMModule[BoomRocketTopWithDTM]]
|
||||||
|
|
||||||
class BoomRocketTestHarness(implicit val p: Parameters) extends Module {
|
/**
|
||||||
|
* Test harness using TSI to bringup the system
|
||||||
|
*/
|
||||||
|
class TestHarness(implicit val p: Parameters) extends Module {
|
||||||
val io = IO(new Bundle {
|
val io = IO(new Bundle {
|
||||||
val success = Output(Bool())
|
val success = Output(Bool())
|
||||||
})
|
})
|
||||||
@@ -24,6 +29,7 @@ class BoomRocketTestHarness(implicit val p: Parameters) extends Module {
|
|||||||
override def desiredName = "TestHarness"
|
override def desiredName = "TestHarness"
|
||||||
|
|
||||||
val dut = p(BuildBoomRocketTop)(clock, reset.toBool, p)
|
val dut = p(BuildBoomRocketTop)(clock, reset.toBool, p)
|
||||||
|
|
||||||
dut.debug := DontCare
|
dut.debug := DontCare
|
||||||
dut.connectSimAXIMem()
|
dut.connectSimAXIMem()
|
||||||
dut.connectSimAXIMMIO()
|
dut.connectSimAXIMMIO()
|
||||||
@@ -41,5 +47,41 @@ class BoomRocketTestHarness(implicit val p: Parameters) extends Module {
|
|||||||
axi.w.bits := DontCare
|
axi.w.bits := DontCare
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
io.success := dut.connectSimSerial()
|
io.success := dut.connectSimSerial()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test harness using the Debug Test Module (DTM) to bringup the system
|
||||||
|
*/
|
||||||
|
class TestHarnessWithDTM(implicit p: Parameters) extends Module
|
||||||
|
{
|
||||||
|
val io = IO(new Bundle {
|
||||||
|
val success = Output(Bool())
|
||||||
|
})
|
||||||
|
|
||||||
|
// force Chisel to rename module
|
||||||
|
override def desiredName = "TestHarness"
|
||||||
|
|
||||||
|
val dut = p(BuildBoomRocketTopWithDTM)(clock, reset.toBool, p)
|
||||||
|
|
||||||
|
dut.reset := reset.asBool | dut.debug.ndreset
|
||||||
|
dut.connectSimAXIMem()
|
||||||
|
dut.connectSimAXIMMIO()
|
||||||
|
dut.dontTouchPorts()
|
||||||
|
dut.tieOffInterrupts()
|
||||||
|
dut.l2_frontend_bus_axi4.foreach(axi => {
|
||||||
|
axi.tieoff()
|
||||||
|
experimental.DataMirror.directionOf(axi.ar.ready) match {
|
||||||
|
case core.ActualDirection.Input =>
|
||||||
|
axi.r.bits := DontCare
|
||||||
|
axi.b.bits := DontCare
|
||||||
|
case core.ActualDirection.Output =>
|
||||||
|
axi.aw.bits := DontCare
|
||||||
|
axi.ar.bits := DontCare
|
||||||
|
axi.w.bits := DontCare
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Debug.connectDebug(dut.debug, clock, reset.asBool, io.success)
|
||||||
|
}
|
||||||
|
|||||||
142
generators/example/src/main/scala/TestSuites.scala
Normal file
142
generators/example/src/main/scala/TestSuites.scala
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import scala.collection.mutable.{LinkedHashSet}
|
||||||
|
|
||||||
|
import freechips.rocketchip.subsystem.{RocketTilesKey}
|
||||||
|
import freechips.rocketchip.tile.{XLen}
|
||||||
|
import freechips.rocketchip.config.{Parameters}
|
||||||
|
import freechips.rocketchip.util.{GeneratorApp}
|
||||||
|
import freechips.rocketchip.system.{TestGeneration, RegressionTestSuite}
|
||||||
|
|
||||||
|
import boom.system.{BoomTilesKey}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of pre-chosen regression tests
|
||||||
|
*/
|
||||||
|
object RegressionTestSuites
|
||||||
|
{
|
||||||
|
val rv64RegrTestNames = LinkedHashSet(
|
||||||
|
"rv64ud-v-fcvt",
|
||||||
|
"rv64ud-p-fdiv",
|
||||||
|
"rv64ud-v-fadd",
|
||||||
|
"rv64uf-v-fadd",
|
||||||
|
"rv64um-v-mul",
|
||||||
|
"rv64mi-p-breakpoint",
|
||||||
|
"rv64uc-v-rvc",
|
||||||
|
"rv64ud-v-structural",
|
||||||
|
"rv64si-p-wfi",
|
||||||
|
"rv64um-v-divw",
|
||||||
|
"rv64ua-v-lrsc",
|
||||||
|
"rv64ui-v-fence_i",
|
||||||
|
"rv64ud-v-fcvt_w",
|
||||||
|
"rv64uf-v-fmin",
|
||||||
|
"rv64ui-v-sb",
|
||||||
|
"rv64ua-v-amomax_d",
|
||||||
|
"rv64ud-v-move",
|
||||||
|
"rv64ud-v-fclass",
|
||||||
|
"rv64ua-v-amoand_d",
|
||||||
|
"rv64ua-v-amoxor_d",
|
||||||
|
"rv64si-p-sbreak",
|
||||||
|
"rv64ud-v-fmadd",
|
||||||
|
"rv64uf-v-ldst",
|
||||||
|
"rv64um-v-mulh",
|
||||||
|
"rv64si-p-dirty")
|
||||||
|
|
||||||
|
val rv32RegrTestNames = LinkedHashSet(
|
||||||
|
"rv32mi-p-ma_addr",
|
||||||
|
"rv32mi-p-csr",
|
||||||
|
"rv32ui-p-sh",
|
||||||
|
"rv32ui-p-lh",
|
||||||
|
"rv32uc-p-rvc",
|
||||||
|
"rv32mi-p-sbreak",
|
||||||
|
"rv32ui-p-sll")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper functions to add BOOM or Rocket tests
|
||||||
|
*/
|
||||||
|
object TestSuiteHelper
|
||||||
|
{
|
||||||
|
import freechips.rocketchip.system.DefaultTestSuites._
|
||||||
|
import RegressionTestSuites._
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add BOOM tests (asm, bmark, regression)
|
||||||
|
*/
|
||||||
|
def addBoomTestSuites(implicit p: Parameters) = {
|
||||||
|
val xlen = p(XLen)
|
||||||
|
p(BoomTilesKey).find(_.hartId == 0).map { tileParams =>
|
||||||
|
val coreParams = tileParams.core
|
||||||
|
val vm = coreParams.useVM
|
||||||
|
val env = if (vm) List("p","v") else List("p")
|
||||||
|
coreParams.fpu foreach { case cfg =>
|
||||||
|
if (xlen == 32) {
|
||||||
|
TestGeneration.addSuites(env.map(rv32uf))
|
||||||
|
if (cfg.fLen >= 64) {
|
||||||
|
TestGeneration.addSuites(env.map(rv32ud))
|
||||||
|
}
|
||||||
|
} else if (cfg.fLen >= 64) {
|
||||||
|
TestGeneration.addSuites(env.map(rv64ud))
|
||||||
|
TestGeneration.addSuites(env.map(rv64uf))
|
||||||
|
TestGeneration.addSuite(rv32udBenchmarks)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (coreParams.useAtomics) {
|
||||||
|
if (tileParams.dcache.flatMap(_.scratch).isEmpty) {
|
||||||
|
TestGeneration.addSuites(env.map(if (xlen == 64) rv64ua else rv32ua))
|
||||||
|
} else {
|
||||||
|
TestGeneration.addSuites(env.map(if (xlen == 64) rv64uaSansLRSC else rv32uaSansLRSC))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (coreParams.useCompressed) TestGeneration.addSuites(env.map(if (xlen == 64) rv64uc else rv32uc))
|
||||||
|
val (rvi, rvu) =
|
||||||
|
if (xlen == 64) ((if (vm) rv64i else rv64pi), rv64u)
|
||||||
|
else ((if (vm) rv32i else rv32pi), rv32u)
|
||||||
|
|
||||||
|
TestGeneration.addSuites(rvi.map(_("p")))
|
||||||
|
TestGeneration.addSuites(rvu.map(_("p")))
|
||||||
|
TestGeneration.addSuites((if (vm) List("v") else List()).flatMap(env => rvu.map(_(env))))
|
||||||
|
TestGeneration.addSuite(benchmarks)
|
||||||
|
TestGeneration.addSuite(new RegressionTestSuite(if (xlen == 64) rv64RegrTestNames else rv32RegrTestNames))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Rocket tests (asm, bmark, regression)
|
||||||
|
*/
|
||||||
|
def addRocketTestSuites(implicit p: Parameters) = {
|
||||||
|
val xlen = p(XLen)
|
||||||
|
p(RocketTilesKey).find(_.hartId == 0).map { tileParams =>
|
||||||
|
val coreParams = tileParams.core
|
||||||
|
val vm = coreParams.useVM
|
||||||
|
val env = if (vm) List("p","v") else List("p")
|
||||||
|
coreParams.fpu foreach { case cfg =>
|
||||||
|
if (xlen == 32) {
|
||||||
|
TestGeneration.addSuites(env.map(rv32uf))
|
||||||
|
if (cfg.fLen >= 64)
|
||||||
|
TestGeneration.addSuites(env.map(rv32ud))
|
||||||
|
} else {
|
||||||
|
TestGeneration.addSuite(rv32udBenchmarks)
|
||||||
|
TestGeneration.addSuites(env.map(rv64uf))
|
||||||
|
if (cfg.fLen >= 64)
|
||||||
|
TestGeneration.addSuites(env.map(rv64ud))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (coreParams.useAtomics) {
|
||||||
|
if (tileParams.dcache.flatMap(_.scratch).isEmpty)
|
||||||
|
TestGeneration.addSuites(env.map(if (xlen == 64) rv64ua else rv32ua))
|
||||||
|
else
|
||||||
|
TestGeneration.addSuites(env.map(if (xlen == 64) rv64uaSansLRSC else rv32uaSansLRSC))
|
||||||
|
}
|
||||||
|
if (coreParams.useCompressed) TestGeneration.addSuites(env.map(if (xlen == 64) rv64uc else rv32uc))
|
||||||
|
val (rvi, rvu) =
|
||||||
|
if (xlen == 64) ((if (vm) rv64i else rv64pi), rv64u)
|
||||||
|
else ((if (vm) rv32i else rv32pi), rv32u)
|
||||||
|
|
||||||
|
TestGeneration.addSuites(rvi.map(_("p")))
|
||||||
|
TestGeneration.addSuites((if (vm) List("v") else List()).flatMap(env => rvu.map(_(env))))
|
||||||
|
TestGeneration.addSuite(benchmarks)
|
||||||
|
TestGeneration.addSuite(new RegressionTestSuite(if (xlen == 64) rv64RegrTestNames else rv32RegrTestNames))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,9 +12,9 @@ import testchipip._
|
|||||||
|
|
||||||
import sifive.blocks.devices.gpio._
|
import sifive.blocks.devices.gpio._
|
||||||
|
|
||||||
// -------------------------------
|
// ------------------------------------
|
||||||
// BOOM and/or Rocket Top Level Systems
|
// BOOM and/or Rocket Top Level Systems
|
||||||
// -------------------------------
|
// ------------------------------------
|
||||||
|
|
||||||
class BoomRocketTop(implicit p: Parameters) extends boom.system.BoomRocketSystem
|
class BoomRocketTop(implicit p: Parameters) extends boom.system.BoomRocketSystem
|
||||||
with HasNoDebug
|
with HasNoDebug
|
||||||
@@ -67,3 +67,12 @@ class BoomRocketTopWithGPIO(implicit p: Parameters) extends BoomRocketTop
|
|||||||
class BoomRocketTopWithGPIOModule(l: BoomRocketTopWithGPIO)
|
class BoomRocketTopWithGPIOModule(l: BoomRocketTopWithGPIO)
|
||||||
extends BoomRocketTopModule(l)
|
extends BoomRocketTopModule(l)
|
||||||
with HasPeripheryGPIOModuleImp
|
with HasPeripheryGPIOModuleImp
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class BoomRocketTopWithDTM(implicit p: Parameters) extends boom.system.BoomRocketSystem
|
||||||
|
{
|
||||||
|
override lazy val module = new BoomRocketTopWithDTMModule(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
class BoomRocketTopWithDTMModule[+L <: BoomRocketTopWithDTM](l: L) extends boom.system.BoomRocketSystemModule(l)
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ cd $RDIR
|
|||||||
echo "export CHIPYARD_TOOLCHAIN_SOURCED=1" > env.sh
|
echo "export CHIPYARD_TOOLCHAIN_SOURCED=1" > env.sh
|
||||||
echo "export RISCV=$RISCV" >> env.sh
|
echo "export RISCV=$RISCV" >> env.sh
|
||||||
echo "export PATH=$RISCV/bin:$RDIR/$DTCversion:\$PATH" >> env.sh
|
echo "export PATH=$RISCV/bin:$RDIR/$DTCversion:\$PATH" >> env.sh
|
||||||
echo "export LD_LIBRARY_PATH=$RISCV/lib" >> env.sh
|
echo "export LD_LIBRARY_PATH=$RISCV/lib\${LD_LIBRARY_PATH:+":${LD_LIBRARY_PATH}"}" >> env.sh
|
||||||
echo "Toolchain Build Complete!"
|
echo "Toolchain Build Complete!"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Submodule tools/barstools updated: 82636b3ff4...26096e07f6
Submodule tools/firrtl updated: 99ae1d6649...84a1c7b1f7
14
variables.mk
14
variables.mk
@@ -29,7 +29,7 @@ SUB_PROJECT ?= example
|
|||||||
|
|
||||||
ifeq ($(SUB_PROJECT),example)
|
ifeq ($(SUB_PROJECT),example)
|
||||||
SBT_PROJECT ?= example
|
SBT_PROJECT ?= example
|
||||||
MODEL ?= BoomRocketTestHarness
|
MODEL ?= TestHarness
|
||||||
VLOG_MODEL ?= TestHarness
|
VLOG_MODEL ?= TestHarness
|
||||||
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
||||||
CONFIG ?= DefaultRocketConfig
|
CONFIG ?= DefaultRocketConfig
|
||||||
@@ -38,18 +38,6 @@ ifeq ($(SUB_PROJECT),example)
|
|||||||
TB ?= TestDriver
|
TB ?= TestDriver
|
||||||
TOP ?= BoomRocketTop
|
TOP ?= BoomRocketTop
|
||||||
endif
|
endif
|
||||||
# for BOOM developers
|
|
||||||
ifeq ($(SUB_PROJECT),boom)
|
|
||||||
SBT_PROJECT ?= boom
|
|
||||||
MODEL ?= TestHarness
|
|
||||||
VLOG_MODEL ?= TestHarness
|
|
||||||
MODEL_PACKAGE ?= boom.system
|
|
||||||
CONFIG ?= LargeBoomConfig
|
|
||||||
CONFIG_PACKAGE ?= boom.system
|
|
||||||
GENERATOR_PACKAGE ?= boom.system
|
|
||||||
TB ?= TestDriver
|
|
||||||
TOP ?= BoomRocketSystem
|
|
||||||
endif
|
|
||||||
# for Rocket-chip developers
|
# for Rocket-chip developers
|
||||||
ifeq ($(SUB_PROJECT),rocketchip)
|
ifeq ($(SUB_PROJECT),rocketchip)
|
||||||
SBT_PROJECT ?= rocketchip
|
SBT_PROJECT ?= rocketchip
|
||||||
|
|||||||
147
vlsi/Makefile
147
vlsi/Makefile
@@ -14,109 +14,94 @@ sim_dir=$(abspath .)
|
|||||||
#########################################################################################
|
#########################################################################################
|
||||||
include $(base_dir)/variables.mk
|
include $(base_dir)/variables.mk
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
# vlsi types and rules
|
||||||
|
#########################################################################################
|
||||||
|
sim_name ?= vcs # needed for GenerateSimFiles, but is unused
|
||||||
|
tech_name ?=
|
||||||
|
tech_dir ?= $(vlsi_dir)/hammer-$(tech_name)-plugin/$(tech_name)
|
||||||
|
SMEMS_COMP ?= $(tech_dir)/sram-compiler.json
|
||||||
|
SMEMS_CACHE ?= $(tech_dir)/sram-cache.json
|
||||||
|
SMEMS_HAMMER ?= $(build_dir)/$(long_name).mems.hammer.json
|
||||||
|
MACROCOMPILER_MODE ?= -l $(SMEMS_CACHE) -hir $(SMEMS_HAMMER)
|
||||||
|
OBJ_DIR ?= $(vlsi_dir)/build
|
||||||
|
ENV_YML ?= $(vlsi_dir)/bwrc-env.yml
|
||||||
|
INPUT_CONFS ?= example.yml $(dir $(tech_dir))/bwrc.yml
|
||||||
|
HAMMER_EXEC ?= ./example-vlsi
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
# general rules
|
||||||
|
#########################################################################################
|
||||||
|
ALL_RTL = $(TOP_FILE) $(TOP_SMEMS_FILE) $(extra_v_includes)
|
||||||
|
extra_v_includes = $(build_dir)/EICG_wrapper.v
|
||||||
|
|
||||||
|
.PHONY: default verilog
|
||||||
|
default: all
|
||||||
|
|
||||||
|
all: drc lvs
|
||||||
|
|
||||||
|
verilog: $(ALL_RTL)
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# import other necessary rules and variables
|
# import other necessary rules and variables
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
include $(base_dir)/common.mk
|
include $(base_dir)/common.mk
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# vlsi types and rules
|
# srams
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
SRAM_GENERATOR_CONF = $(build_dir)/sram_generator-input.yml
|
||||||
|
SRAM_CONF=$(build_dir)/sram_generator-output.json
|
||||||
|
|
||||||
#sim_name is unused, but GenerateSimFiles expects it
|
## SRAM Generator
|
||||||
sim_name ?= vcs
|
.PHONY: sram_generator srams
|
||||||
tech_name ?=
|
srams: sram_generator
|
||||||
tech_dir ?= $(vlsi_dir)/hammer-$(tech_name)-plugin/$(tech_name)
|
sram_generator: $(SRAM_CONF)
|
||||||
SMEMS_COMP ?= $(tech_dir)/sram-compiler.json
|
|
||||||
SMEMS_HAMMER ?= $(build_dir)/$(long_name).mems.hammer.json
|
|
||||||
MACROCOMPILER_MODE ?= -l $(SMEMS_COMP) --use-compiler -hir $(SMEMS_HAMMER)
|
|
||||||
OBJ_DIR ?= $(vlsi_dir)/build
|
|
||||||
ENV_YML ?= $(vlsi_dir)/bwrc-env.yml
|
|
||||||
INPUT_CONFS ?= example.yml $(dir $(tech_dir))/bwrc.yml
|
|
||||||
HAMMER_EXEC ?= ./example-vlsi
|
|
||||||
|
|
||||||
ROCKET_SRC_DIR=$(ROCKETCHIP_DIR)/src/main/resources/vsrc
|
# This should be built alongside $(SMEMS_FILE)
|
||||||
|
$(SMEMS_HAMMER): $(SMEMS_FILE)
|
||||||
|
|
||||||
ROCKET_SRCS = \
|
$(SRAM_GENERATOR_CONF): $(SMEMS_HAMMER)
|
||||||
$(ROCKET_SRC_DIR)/ClockDivider2.v \
|
mkdir -p $(dir $@)
|
||||||
$(ROCKET_SRC_DIR)/ClockDivider3.v \
|
echo "vlsi.inputs.sram_parameters: '$(SMEMS_HAMMER)'" >> $@
|
||||||
$(ROCKET_SRC_DIR)/AsyncResetReg.v \
|
echo "vlsi.inputs.sram_parameters_meta: [\"transclude\", \"json2list\"]">> $@
|
||||||
$(ROCKET_SRC_DIR)/plusarg_reader.v \
|
|
||||||
$(ROCKET_SRC_DIR)/EICG_wrapper.v \
|
|
||||||
|
|
||||||
ALL_RTL = $(ROCKET_SRCS) $(TOP_FILE) $(TOP_SMEMS_FILE)
|
$(SRAM_CONF): $(SRAM_GENERATOR_CONF)
|
||||||
|
cd $(vlsi_dir) && $(HAMMER_EXEC) -e $(ENV_YML) $(foreach x,$(INPUT_CONFS) $(SRAM_GENERATOR_CONF), -p $(x)) --obj_dir $(build_dir) sram_generator
|
||||||
|
cd $(vlsi_dir) && cp output.json $@
|
||||||
|
|
||||||
CLOCK_DOMAINS = $(build_dir)/$(long_name).domains
|
#########################################################################################
|
||||||
|
# synthesis input configuration
|
||||||
|
#########################################################################################
|
||||||
|
SYN_CONF = $(OBJ_DIR)/inputs.yml
|
||||||
|
GENERATED_CONFS = $(SYN_CONF) $(SRAM_CONF)
|
||||||
|
|
||||||
.PHONY: default
|
$(SYN_CONF): $(ALL_RTL) $(extra_v_includes) $(sim_top_blackboxes)
|
||||||
default: all
|
|
||||||
|
|
||||||
all: drc lvs
|
|
||||||
|
|
||||||
|
|
||||||
###################################################### SYN ############################################################
|
|
||||||
|
|
||||||
SYNTH_CONF = $(OBJ_DIR)/inputs.yml
|
|
||||||
|
|
||||||
$(SYNTH_CONF):
|
|
||||||
mkdir -p $(dir $@)
|
mkdir -p $(dir $@)
|
||||||
echo "synthesis.inputs:" > $@
|
echo "synthesis.inputs:" > $@
|
||||||
echo " top_module: $(TOP)" >> $@
|
echo " top_module: $(TOP)" >> $@
|
||||||
echo " input_files:" >> $@
|
echo " input_files:" >> $@
|
||||||
for x in $(ALL_RTL); do \
|
for x in $(ALL_RTL) $(extra_v_includes) `cat $(sim_top_blackboxes)`; do \
|
||||||
echo ' - "'$$x'"' >> $@; \
|
echo ' - "'$$x'"' >> $@; \
|
||||||
done
|
done
|
||||||
|
|
||||||
GENERATED_CONFS=$(SYNTH_CONF) $(SRAM_CONF)
|
#########################################################################################
|
||||||
|
# AUTO BUILD FLOW
|
||||||
|
#########################################################################################
|
||||||
|
|
||||||
.PHONY: syn synthesis
|
.PHONY: buildfile
|
||||||
syn: $(OBJ_DIR)/syn-rundir/$(TOP).mapped.v
|
buildfile: $(OBJ_DIR)/hammer.d
|
||||||
synthesis: syn
|
# Tip: Set HAMMER_D_DEPS to an empty string to avoid unnecessary RTL rebuilds
|
||||||
|
# TODO: make this dependency smarter so that we don't need this at all
|
||||||
|
HAMMER_D_DEPS ?= $(GENERATED_CONFS)
|
||||||
|
$(OBJ_DIR)/hammer.d: $(HAMMER_D_DEPS)
|
||||||
|
$(HAMMER_EXEC) -e $(ENV_YML) $(foreach x,$(INPUT_CONFS) $(GENERATED_CONFS), -p $(x)) --obj_dir $(OBJ_DIR) build
|
||||||
|
|
||||||
$(OBJ_DIR)/syn-rundir/$(TOP).mapped.v $(OBJ_DIR)/syn-rundir/syn-output.json: $(ENV_YML) $(INPUT_CONFS) $(GENERATED_CONFS) $(ALL_RTL)
|
-include $(OBJ_DIR)/hammer.d
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(HAMMER_EXEC) -e $(ENV_YML) $(foreach x,$(INPUT_CONFS) $(GENERATED_CONFS), -p $(x)) --obj_dir $(OBJ_DIR) syn
|
|
||||||
|
|
||||||
$(OBJ_DIR)/par-input.json: $(OBJ_DIR)/syn-rundir/syn-output.json
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(HAMMER_EXEC) -e $(ENV_YML) $(foreach x,$(INPUT_CONFS) $<, -p $(x)) -o $@ syn_to_par
|
|
||||||
|
|
||||||
###################################################### PAR ############################################################
|
|
||||||
|
|
||||||
.PHONY: par place-and-route
|
|
||||||
par: $(OBJ_DIR)/par-rundir/$(TOP).gds
|
|
||||||
place-and-route: par
|
|
||||||
|
|
||||||
$(OBJ_DIR)/par-rundir/$(TOP).gds $(OBJ_DIR)/par-rundir/par-output.json: $(OBJ_DIR)/par-input.json $(OBJ_DIR)/syn-rundir/$(TOP).mapped.v
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(HAMMER_EXEC) -e $(ENV_YML) -p $< --obj_dir $(OBJ_DIR) par
|
|
||||||
|
|
||||||
$(OBJ_DIR)/drc-input.json: $(OBJ_DIR)/par-input.json $(OBJ_DIR)/par-rundir/par-output.json
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(HAMMER_EXEC) -e $(ENV_YML) $(foreach x,$^, -p $(x)) -o $@ --obj_dir $(OBJ_DIR) par_to_drc
|
|
||||||
|
|
||||||
###################################################### DRC ############################################################
|
|
||||||
# TODO unimplemented
|
|
||||||
.PHONY: drc
|
|
||||||
drc: $(OBJ_DIR)/drc-rundir/drc_results.db
|
|
||||||
|
|
||||||
$(OBJ_DIR)/drc-rundir/drc_results.db: $(OBJ_DIR)/drc-input.json $(OBJ_DIR)/par-rundir/$(TOP).gds
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(HAMMER_EXEC) -e $(ENV_YML) -p $< --obj_dir $(OBJ_DIR) drc
|
|
||||||
|
|
||||||
###################################################### LVS ############################################################
|
|
||||||
# TODO unimplemented
|
|
||||||
$(OBJ_DIR)/lvs-input.json: $(OBJ_DIR)/par-input.json $(OBJ_DIR)/par-rundir/par-output.json
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(HAMMER_EXEC) -e $(ENV_YML) $(foreach x,$^, -p $(x)) -o $@ --obj_dir $(OBJ_DIR) par_to_lvs
|
|
||||||
|
|
||||||
.PHONY: lvs
|
|
||||||
lvs: $(OBJ_DIR)/lvs-rundir/lvs_results.rpt
|
|
||||||
|
|
||||||
$(OBJ_DIR)/lvs-rundir/lvs_results.rpt: $(OBJ_DIR)/lvs-input.json $(OBJ_DIR)/par-rundir/$(TOP).gds
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(HAMMER_EXEC) -e $(ENV_YML) -p $< --obj_dir $(OBJ_DIR) lvs
|
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
# general cleanup rule
|
||||||
|
#########################################################################################
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(OBJ_DIR) hammer-vlsi*.log __pycache__ output.json $(GENERATED_CONFS) generated-src
|
rm -rf $(OBJ_DIR) hammer-vlsi*.log __pycache__ output.json $(GENERATED_CONFS) $(gen_dir)
|
||||||
|
|||||||
Submodule vlsi/hammer updated: 873b2c1af0...a27886fb42
Reference in New Issue
Block a user