Merge pull request #211 from ucb-bar/clean_configs
Cleanup configs | take ownership of Heterogeneous subsystem | improve verilator compile time
This commit is contained in:
@@ -117,35 +117,6 @@ jobs:
|
|||||||
key: example-{{ .Branch }}-{{ .Revision }}
|
key: example-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project"
|
- "/home/riscvuser/project"
|
||||||
prepare-boomexample:
|
|
||||||
docker:
|
|
||||||
- image: riscvboom/riscvboom-images:0.0.10
|
|
||||||
environment:
|
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
|
||||||
TERM: dumb
|
|
||||||
steps:
|
|
||||||
- add_ssh_keys:
|
|
||||||
fingerprints:
|
|
||||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Create hash of toolchains
|
|
||||||
command: |
|
|
||||||
.circleci/create-hash.sh
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- verilator-installed-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
|
||||||
- run:
|
|
||||||
name: Building the boomexample subproject using Verilator
|
|
||||||
command: .circleci/do-rtl-build.sh boomexample
|
|
||||||
no_output_timeout: 120m
|
|
||||||
- save_cache:
|
|
||||||
key: boomexample-{{ .Branch }}-{{ .Revision }}
|
|
||||||
paths:
|
|
||||||
- "/home/riscvuser/project"
|
|
||||||
prepare-boomrocketexample:
|
prepare-boomrocketexample:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.10
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
@@ -170,7 +141,7 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Building the boomrocketexample subproject using Verilator
|
name: Building the boomrocketexample subproject using Verilator
|
||||||
command: .circleci/do-rtl-build.sh boomrocketexample
|
command: .circleci/do-rtl-build.sh boomrocketexample
|
||||||
no_output_timeout: 120m
|
no_output_timeout: 240m
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
key: boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
@@ -315,30 +286,6 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Run example tests
|
name: Run example tests
|
||||||
command: .circleci/run-tests.sh example
|
command: .circleci/run-tests.sh example
|
||||||
boomexample-run-tests:
|
|
||||||
docker:
|
|
||||||
- image: riscvboom/riscvboom-images:0.0.10
|
|
||||||
environment:
|
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
|
||||||
TERM: dumb
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Create hash of toolchains
|
|
||||||
command: |
|
|
||||||
.circleci/create-hash.sh
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- boomexample-{{ .Branch }}-{{ .Revision }}
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- verilator-installed-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
|
||||||
- run:
|
|
||||||
name: Run boomexample tests
|
|
||||||
command: .circleci/run-tests.sh boomexample
|
|
||||||
boomrocketexample-run-tests:
|
boomrocketexample-run-tests:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.10
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
@@ -468,11 +415,6 @@ workflows:
|
|||||||
- install-riscv-toolchain
|
- install-riscv-toolchain
|
||||||
- install-verilator
|
- install-verilator
|
||||||
|
|
||||||
- prepare-boomexample:
|
|
||||||
requires:
|
|
||||||
- install-riscv-toolchain
|
|
||||||
- install-verilator
|
|
||||||
|
|
||||||
- prepare-boomrocketexample:
|
- prepare-boomrocketexample:
|
||||||
requires:
|
requires:
|
||||||
- install-riscv-toolchain
|
- install-riscv-toolchain
|
||||||
@@ -505,10 +447,6 @@ workflows:
|
|||||||
requires:
|
requires:
|
||||||
- prepare-example
|
- prepare-example
|
||||||
|
|
||||||
- boomexample-run-tests:
|
|
||||||
requires:
|
|
||||||
- prepare-boomexample
|
|
||||||
|
|
||||||
- boomrocketexample-run-tests:
|
- boomrocketexample-run-tests:
|
||||||
requires:
|
requires:
|
||||||
- prepare-boomrocketexample
|
- prepare-boomrocketexample
|
||||||
|
|||||||
@@ -36,9 +36,8 @@ LOCAL_SIM_DIR=$LOCAL_CHIPYARD_DIR/sims/verilator
|
|||||||
# key value store to get the build strings
|
# key value store to get the build strings
|
||||||
declare -A mapping
|
declare -A mapping
|
||||||
mapping["example"]="SUB_PROJECT=example"
|
mapping["example"]="SUB_PROJECT=example"
|
||||||
mapping["boomexample"]="SUB_PROJECT=example CONFIG=DefaultBoomConfig"
|
mapping["boomrocketexample"]="SUB_PROJECT=example CONFIG=LargeBoomAndRocketConfig"
|
||||||
mapping["boomrocketexample"]="SUB_PROJECT=example CONFIG=DefaultBoomAndRocketConfig"
|
|
||||||
mapping["boom"]="SUB_PROJECT=example CONFIG=SmallBoomConfig"
|
mapping["boom"]="SUB_PROJECT=example CONFIG=SmallBoomConfig"
|
||||||
mapping["rocketchip"]="SUB_PROJECT=rocketchip"
|
mapping["rocketchip"]="SUB_PROJECT=rocketchip"
|
||||||
mapping["blockdevrocketchip"]="SUB_PROJECT=example CONFIG=SimBlockDeviceRocketConfig TOP=BoomRocketTopWithBlockDevice"
|
mapping["blockdevrocketchip"]="SUB_PROJECT=example CONFIG=SimBlockDeviceRocketConfig TOP=TopWithBlockDevice"
|
||||||
mapping["hwacha"]="SUB_PROJECT=example CONFIG=HwachaL2Config GENERATOR_PACKAGE=hwacha"
|
mapping["hwacha"]="SUB_PROJECT=example CONFIG=HwachaRocketConfig GENERATOR_PACKAGE=hwacha"
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ This involves specifying the SoC top-level to add a DTM as well as configuring t
|
|||||||
.. code-block:: scala
|
.. code-block:: scala
|
||||||
|
|
||||||
class DTMBoomConfig extends Config(
|
class DTMBoomConfig extends Config(
|
||||||
new WithDTMBoomRocketTop ++
|
new WithDTMTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new WithJtagDTM ++
|
new WithJtagDTM ++
|
||||||
new boom.common.SmallBoomConfig)
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
In this example, the ``WithDTMBoomRocketTop`` mixin specifies that the top-level SoC will instantiate a DTM.
|
In this example, the ``WithDTMTop`` 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 ``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).
|
The rest of the mixins specify the rest of the system (cores, accelerators, etc).
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ After creating the config, call the ``make`` command like the following:
|
|||||||
# or
|
# or
|
||||||
cd sims/vcs
|
cd sims/vcs
|
||||||
|
|
||||||
make CONFIG=DTMBoomConfig TOP=BoomRocketTopWithDTM MODEL=TestHarnessWithDTM
|
make CONFIG=DTMBoomConfig TOP=TopWithDTM 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.
|
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!
|
After that point, you should have a JTAG enabled simulation that you can attach to using OpenOCD and GDB!
|
||||||
|
|||||||
@@ -58,12 +58,6 @@ Therefore, in order to simulate a simple Rocket-based example system we can use:
|
|||||||
|
|
||||||
make SUB_PROJECT=example
|
make SUB_PROJECT=example
|
||||||
|
|
||||||
Alternatively, if we would like to simulate a simple BOOM-based example system we can use:
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
make SUB_PROJECT=exampleboom
|
|
||||||
|
|
||||||
Once the simulator has been constructed, we would like to run RISC-V programs on it.
|
Once the simulator has been constructed, we would like to run RISC-V programs on it.
|
||||||
In the simulation directory, we will find an executable file called ``<...>-<package>-<config>``.
|
In the simulation directory, we will find an executable file called ``<...>-<package>-<config>``.
|
||||||
We run this executable with our target RISC-V program as a command line argument in one of two ways.
|
We run this executable with our target RISC-V program as a command line argument in one of two ways.
|
||||||
|
|||||||
@@ -15,18 +15,18 @@ The following example shows a dual core BOOM with a single core Rocket.
|
|||||||
.. code-block:: scala
|
.. code-block:: scala
|
||||||
|
|
||||||
class DualBoomAndOneRocketConfig extends Config(
|
class DualBoomAndOneRocketConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.system.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.DefaultBoomConfig ++
|
new boom.common.LargeBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.system.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)
|
||||||
|
|
||||||
In this example, the ``WithNBoomCores`` and ``WithNBigCores`` mixins set up the default parameters for the multiple BOOM and Rocket cores, respectively.
|
In this example, the ``WithNBoomCores`` and ``WithNBigCores`` mixins set up the default parameters for the multiple BOOM and Rocket cores, respectively.
|
||||||
However, for BOOM, an extra mixin called ``DefaultBoomConfig`` is added to override the default parameters with a different set of more common default parameters.
|
However, for BOOM, an extra mixin called ``LargeBoomConfig`` is added to override the default parameters with a different set of more common default parameters.
|
||||||
This mixin applies to all BOOM cores in the system and changes the parameters for each.
|
This mixin applies to all BOOM cores in the system and changes the parameters for each.
|
||||||
|
|
||||||
Great! Now you have a heterogeneous setup with BOOMs and Rockets.
|
Great! Now you have a heterogeneous setup with BOOMs and Rockets.
|
||||||
@@ -62,7 +62,7 @@ Then you could use this new mixin like the following.
|
|||||||
.. code-block:: scala
|
.. code-block:: scala
|
||||||
|
|
||||||
class SixCoreConfig extends Config(
|
class SixCoreConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new WithHeterCoresSetup ++
|
new WithHeterCoresSetup ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
@@ -78,12 +78,12 @@ An example of adding a Hwacha to all tiles in the system is below.
|
|||||||
.. code-block:: scala
|
.. code-block:: scala
|
||||||
|
|
||||||
class DualBoomAndRocketWithHwachasConfig extends Config(
|
class DualBoomAndRocketWithHwachasConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new hwacha.DefaultHwachaConfig ++
|
new hwacha.DefaultHwachaConfig ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.system.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.DefaultBoomConfig ++
|
new boom.common.LargeBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.system.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
@@ -103,14 +103,14 @@ An example is shown below with two BOOM cores, and one Rocket tile with a RoCC a
|
|||||||
.. code-block:: scala
|
.. code-block:: scala
|
||||||
|
|
||||||
class DualBoomAndOneHwachaRocketConfig extends Config(
|
class DualBoomAndOneHwachaRocketConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
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.system.WithRenumberHarts(rocketFirst = true) ++
|
||||||
new hwacha.DefaultHwachaConfig ++
|
new hwacha.DefaultHwachaConfig ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.DefaultBoomConfig ++
|
new boom.common.LargeBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.system.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ The Chipyard framework can download, build, and execute simulations using Verila
|
|||||||
To run a simulation using Verilator, perform the following steps:
|
To run a simulation using Verilator, perform the following steps:
|
||||||
|
|
||||||
To compile the example design, run ``make`` in the ``sims/verilator`` directory.
|
To compile the example design, run ``make`` in the ``sims/verilator`` directory.
|
||||||
This will elaborate the ``DefaultRocketConfig`` in the example project.
|
This will elaborate the ``RocketConfig`` in the example project.
|
||||||
|
|
||||||
An executable called ``simulator-example-DefaultRocketConfig`` will be produced.
|
An executable called ``simulator-example-RocketConfig`` will be produced.
|
||||||
This executable is a simulator that has been compiled based on the design that was built.
|
This executable is a simulator that has been compiled based on the design that was built.
|
||||||
You can then use this executable to run any compatible RV64 code.
|
You can then use this executable to run any compatible RV64 code.
|
||||||
For instance, to run one of the riscv-tools assembly tests.
|
For instance, to run one of the riscv-tools assembly tests.
|
||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
./simulator-example-DefaultRocketConfig $RISCV/riscv64-unknown-elf/share/riscv-tests/isa/rv64ui-p-simple
|
./simulator-example-RocketConfig $RISCV/riscv64-unknown-elf/share/riscv-tests/isa/rv64ui-p-simple
|
||||||
|
|
||||||
If you later create your own project, you can use environment variables to build an alternate configuration.
|
If you later create your own project, you can use environment variables to build an alternate configuration.
|
||||||
|
|
||||||
@@ -50,16 +50,16 @@ To run a simulation using VCS, perform the following steps:
|
|||||||
Make sure that the VCS simulator is on your ``PATH``.
|
Make sure that the VCS simulator is on your ``PATH``.
|
||||||
|
|
||||||
To compile the example design, run make in the ``sims/vcs`` directory.
|
To compile the example design, run make in the ``sims/vcs`` directory.
|
||||||
This will elaborate the ``DefaultRocketConfig`` in the example project.
|
This will elaborate the ``RocketConfig`` in the example project.
|
||||||
|
|
||||||
An executable called ``simulator-example-DefaultRocketConfig`` will be produced.
|
An executable called ``simulator-example-RocketConfig`` will be produced.
|
||||||
This executable is a simulator that has been compiled based on the design that was built.
|
This executable is a simulator that has been compiled based on the design that was built.
|
||||||
You can then use this executable to run any compatible RV64 code.
|
You can then use this executable to run any compatible RV64 code.
|
||||||
For instance, to run one of the riscv-tools assembly tests.
|
For instance, to run one of the riscv-tools assembly tests.
|
||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
./simulator-example-DefaultRocketConfig $RISCV/riscv64-unknown-elf/share/riscv-tests/isa/rv64ui-p-simple
|
./simulator-example-RocketConfig $RISCV/riscv64-unknown-elf/share/riscv-tests/isa/rv64ui-p-simple
|
||||||
|
|
||||||
If you later create your own project, you can use environment variables to build an alternate configuration.
|
If you later create your own project, you can use environment variables to build an alternate configuration.
|
||||||
|
|
||||||
|
|||||||
Submodule generators/boom updated: 4e9d496d36...7b68d748b6
@@ -3,88 +3,57 @@ package example
|
|||||||
import chisel3._
|
import chisel3._
|
||||||
|
|
||||||
import freechips.rocketchip.config.{Config}
|
import freechips.rocketchip.config.{Config}
|
||||||
import freechips.rocketchip.subsystem.{WithJtagDTM}
|
|
||||||
|
|
||||||
import boom.common._
|
|
||||||
|
|
||||||
// ---------------------
|
// ---------------------
|
||||||
// BOOM Configs
|
// BOOM Configs
|
||||||
// ---------------------
|
// ---------------------
|
||||||
|
|
||||||
class SmallBoomConfig extends Config(
|
class SmallBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++ // use normal top
|
||||||
new WithBootROM ++
|
new WithBootROM ++ // use testchipip bootrom
|
||||||
new boom.common.SmallBoomConfig)
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++ // use SiFive L2 cache
|
||||||
|
new boom.common.WithSmallBooms ++ // 1-wide BOOM
|
||||||
|
new boom.common.WithNBoomCores(1) ++ // single-core
|
||||||
|
new freechips.rocketchip.system.BaseConfig) // "base" rocketchip system
|
||||||
|
|
||||||
class MediumBoomConfig extends Config(
|
class MediumBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.common.MediumBoomConfig)
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithMediumBooms ++ // 2-wide BOOM
|
||||||
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class LargeBoomConfig extends Config(
|
class LargeBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.common.LargeBoomConfig)
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithLargeBooms ++ // 3-wide BOOM
|
||||||
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class MegaBoomConfig extends Config(
|
class MegaBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.common.MegaBoomConfig)
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithMegaBooms ++ // 4-wide BOOM
|
||||||
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class jtagSmallBoomConfig extends Config(
|
class DualSmallBoomConfig extends Config(
|
||||||
new WithDTMBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new WithJtagDTM ++
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
new boom.common.SmallBoomConfig)
|
new boom.common.WithSmallBooms ++
|
||||||
|
new boom.common.WithNBoomCores(2) ++ // dual-core
|
||||||
class jtagMediumBoomConfig extends Config(
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
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(
|
class SmallRV32UnifiedBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.common.SmallRV32UnifiedBoomConfig)
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithoutBoomFPU ++ // no floating point
|
||||||
// --------------------------
|
new boom.common.WithUnifiedMemIntIQs ++ // use unified mem+int issue queues
|
||||||
// BOOM + Rocket Configs
|
new boom.common.WithSmallBooms ++
|
||||||
// --------------------------
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
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)
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import freechips.rocketchip.diplomacy.{LazyModule, ValName}
|
|||||||
import freechips.rocketchip.devices.tilelink.BootROMParams
|
import freechips.rocketchip.devices.tilelink.BootROMParams
|
||||||
import freechips.rocketchip.tile.{XLen, BuildRoCC, TileKey, LazyRoCC}
|
import freechips.rocketchip.tile.{XLen, BuildRoCC, TileKey, LazyRoCC}
|
||||||
|
|
||||||
import boom.system.{BoomTilesKey}
|
import boom.common.{BoomTilesKey}
|
||||||
|
|
||||||
import testchipip._
|
import testchipip._
|
||||||
|
|
||||||
@@ -52,43 +52,43 @@ class WithGPIO extends Config((site, here, up) => {
|
|||||||
/**
|
/**
|
||||||
* Class to specify a "plain" top level BOOM and/or Rocket system
|
* Class to specify a "plain" top level BOOM and/or Rocket system
|
||||||
*/
|
*/
|
||||||
class WithNormalBoomRocketTop extends Config((site, here, up) => {
|
class WithTop extends Config((site, here, up) => {
|
||||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
case BuildTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||||
Module(LazyModule(new BoomRocketTop()(p)).module)
|
Module(LazyModule(new Top()(p)).module)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to specify a top level BOOM and/or Rocket system with DTM
|
* Class to specify a top level BOOM and/or Rocket system with DTM
|
||||||
*/
|
*/
|
||||||
class WithDTMBoomRocketTop extends Config((site, here, up) => {
|
class WithDTMTop extends Config((site, here, up) => {
|
||||||
case BuildBoomRocketTopWithDTM => (clock: Clock, reset: Bool, p: Parameters) => {
|
case BuildTopWithDTM => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||||
Module(LazyModule(new BoomRocketTopWithDTM()(p)).module)
|
Module(LazyModule(new TopWithDTM()(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
|
||||||
*/
|
*/
|
||||||
class WithPWMBoomRocketTop extends Config((site, here, up) => {
|
class WithPWMTop extends Config((site, here, up) => {
|
||||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
case BuildTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||||
Module(LazyModule(new BoomRocketTopWithPWMTL()(p)).module)
|
Module(LazyModule(new TopWithPWMTL()(p)).module)
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to specify a top level BOOM and/or Rocket system with a PWM AXI4
|
* Class to specify a top level BOOM and/or Rocket system with a PWM AXI4
|
||||||
*/
|
*/
|
||||||
class WithPWMAXI4BoomRocketTop extends Config((site, here, up) => {
|
class WithPWMAXI4Top extends Config((site, here, up) => {
|
||||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
case BuildTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||||
Module(LazyModule(new BoomRocketTopWithPWMAXI4()(p)).module)
|
Module(LazyModule(new TopWithPWMAXI4()(p)).module)
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to specify a top level BOOM and/or Rocket system with a block device
|
* Class to specify a top level BOOM and/or Rocket system with a block device
|
||||||
*/
|
*/
|
||||||
class WithBlockDeviceModelBoomRocketTop extends Config((site, here, up) => {
|
class WithBlockDeviceModelTop extends Config((site, here, up) => {
|
||||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
case BuildTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||||
val top = Module(LazyModule(new BoomRocketTopWithBlockDevice()(p)).module)
|
val top = Module(LazyModule(new TopWithBlockDevice()(p)).module)
|
||||||
top.connectBlockDeviceModel()
|
top.connectBlockDeviceModel()
|
||||||
top
|
top
|
||||||
}
|
}
|
||||||
@@ -97,9 +97,9 @@ class WithBlockDeviceModelBoomRocketTop extends Config((site, here, up) => {
|
|||||||
/**
|
/**
|
||||||
* Class to specify a top level BOOM and/or Rocket system with a simulator block device
|
* Class to specify a top level BOOM and/or Rocket system with a simulator block device
|
||||||
*/
|
*/
|
||||||
class WithSimBlockDeviceBoomRocketTop extends Config((site, here, up) => {
|
class WithSimBlockDeviceTop extends Config((site, here, up) => {
|
||||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
case BuildTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||||
val top = Module(LazyModule(new BoomRocketTopWithBlockDevice()(p)).module)
|
val top = Module(LazyModule(new TopWithBlockDevice()(p)).module)
|
||||||
top.connectSimBlockDevice(clock, reset)
|
top.connectSimBlockDevice(clock, reset)
|
||||||
top
|
top
|
||||||
}
|
}
|
||||||
@@ -108,9 +108,9 @@ class WithSimBlockDeviceBoomRocketTop extends Config((site, here, up) => {
|
|||||||
/**
|
/**
|
||||||
* Class to specify a top level BOOM and/or Rocket system with GPIO
|
* Class to specify a top level BOOM and/or Rocket system with GPIO
|
||||||
*/
|
*/
|
||||||
class WithGPIOBoomRocketTop extends Config((site, here, up) => {
|
class WithGPIOTop extends Config((site, here, up) => {
|
||||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
case BuildTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||||
val top = Module(LazyModule(new BoomRocketTopWithGPIO()(p)).module)
|
val top = Module(LazyModule(new TopWithGPIO()(p)).module)
|
||||||
for (gpio <- top.gpio) {
|
for (gpio <- top.gpio) {
|
||||||
for (pin <- gpio.pins) {
|
for (pin <- gpio.pins) {
|
||||||
pin.i.ival := false.B
|
pin.i.ival := false.B
|
||||||
|
|||||||
@@ -1,266 +0,0 @@
|
|||||||
package example
|
|
||||||
|
|
||||||
import chisel3._
|
|
||||||
|
|
||||||
import freechips.rocketchip.config.{Config}
|
|
||||||
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32, WithExtMemSize, WithNBanks, WithInclusiveCache}
|
|
||||||
|
|
||||||
import testchipip._
|
|
||||||
|
|
||||||
// --------------
|
|
||||||
// Rocket Configs
|
|
||||||
// --------------
|
|
||||||
|
|
||||||
class BaseRocketConfig extends Config(
|
|
||||||
new WithBootROM ++
|
|
||||||
new freechips.rocketchip.system.DefaultConfig)
|
|
||||||
|
|
||||||
class DefaultRocketConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new BaseRocketConfig)
|
|
||||||
|
|
||||||
class HwachaConfig extends Config(
|
|
||||||
new hwacha.DefaultHwachaConfig ++
|
|
||||||
new DefaultRocketConfig)
|
|
||||||
|
|
||||||
class RoccRocketConfig extends Config(
|
|
||||||
new WithRoccExample ++
|
|
||||||
new DefaultRocketConfig)
|
|
||||||
|
|
||||||
class PWMRocketConfig extends Config(
|
|
||||||
new WithPWMBoomRocketTop ++
|
|
||||||
new BaseRocketConfig)
|
|
||||||
|
|
||||||
class PWMAXI4RocketConfig extends Config(
|
|
||||||
new WithPWMAXI4BoomRocketTop ++
|
|
||||||
new BaseRocketConfig)
|
|
||||||
|
|
||||||
class SimBlockDeviceRocketConfig extends Config(
|
|
||||||
new WithBlockDevice ++
|
|
||||||
new WithSimBlockDeviceBoomRocketTop ++
|
|
||||||
new BaseRocketConfig)
|
|
||||||
|
|
||||||
class BlockDeviceModelRocketConfig extends Config(
|
|
||||||
new WithBlockDevice ++
|
|
||||||
new WithBlockDeviceModelBoomRocketTop ++
|
|
||||||
new BaseRocketConfig)
|
|
||||||
|
|
||||||
class GPIORocketConfig extends Config(
|
|
||||||
new WithGPIO ++
|
|
||||||
new WithGPIOBoomRocketTop ++
|
|
||||||
new BaseRocketConfig)
|
|
||||||
|
|
||||||
class DualCoreRocketConfig extends Config(
|
|
||||||
new WithNBigCores(2) ++
|
|
||||||
new DefaultRocketConfig)
|
|
||||||
|
|
||||||
class RV32RocketConfig extends Config(
|
|
||||||
new WithRV32 ++
|
|
||||||
new DefaultRocketConfig)
|
|
||||||
|
|
||||||
class GB1MemoryConfig extends Config(
|
|
||||||
new WithExtMemSize((1<<30) * 1L) ++
|
|
||||||
new DefaultRocketConfig)
|
|
||||||
|
|
||||||
class RocketL2Config extends Config(
|
|
||||||
new WithInclusiveCache ++
|
|
||||||
new DefaultRocketConfig)
|
|
||||||
|
|
||||||
class HwachaL2Config extends Config(
|
|
||||||
new hwacha.DefaultHwachaConfig ++
|
|
||||||
new WithInclusiveCache ++
|
|
||||||
new DefaultRocketConfig)
|
|
||||||
|
|
||||||
// ------------
|
|
||||||
// BOOM Configs
|
|
||||||
// ------------
|
|
||||||
|
|
||||||
class BaseBoomConfig extends Config(
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.LargeBoomConfig)
|
|
||||||
|
|
||||||
class SmallBaseBoomConfig extends Config(
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.SmallBoomConfig)
|
|
||||||
|
|
||||||
class DefaultBoomConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new BaseBoomConfig)
|
|
||||||
|
|
||||||
class SmallDefaultBoomConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new SmallBaseBoomConfig)
|
|
||||||
|
|
||||||
class HwachaBoomConfig extends Config(
|
|
||||||
new hwacha.DefaultHwachaConfig ++
|
|
||||||
new DefaultBoomConfig)
|
|
||||||
|
|
||||||
class RoccBoomConfig extends Config(
|
|
||||||
new WithRoccExample ++
|
|
||||||
new DefaultBoomConfig)
|
|
||||||
|
|
||||||
class PWMBoomConfig extends Config(
|
|
||||||
new WithPWMBoomRocketTop ++
|
|
||||||
new BaseBoomConfig)
|
|
||||||
|
|
||||||
class PWMAXI4BoomConfig extends Config(
|
|
||||||
new WithPWMAXI4BoomRocketTop ++
|
|
||||||
new BaseBoomConfig)
|
|
||||||
|
|
||||||
class SimBlockDeviceBoomConfig extends Config(
|
|
||||||
new WithBlockDevice ++
|
|
||||||
new WithSimBlockDeviceBoomRocketTop ++
|
|
||||||
new BaseBoomConfig)
|
|
||||||
|
|
||||||
class BlockDeviceModelBoomConfig extends Config(
|
|
||||||
new WithBlockDevice ++
|
|
||||||
new WithBlockDeviceModelBoomRocketTop ++
|
|
||||||
new BaseBoomConfig)
|
|
||||||
|
|
||||||
class GPIOBoomConfig extends Config(
|
|
||||||
new WithGPIO ++
|
|
||||||
new WithGPIOBoomRocketTop ++
|
|
||||||
new BaseBoomConfig)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Slightly different looking configs since we need to override
|
|
||||||
* the `WithNBoomCores` with the DefaultBoomConfig params
|
|
||||||
*/
|
|
||||||
class DualCoreBoomConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.WithRVC ++
|
|
||||||
new boom.common.WithLargeBooms ++
|
|
||||||
new boom.common.BaseBoomConfig ++
|
|
||||||
new boom.common.WithNBoomCores(2) ++
|
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
|
||||||
|
|
||||||
class DualCoreSmallBoomConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.WithRVC ++
|
|
||||||
new boom.common.WithSmallBooms ++
|
|
||||||
new boom.common.BaseBoomConfig ++
|
|
||||||
new boom.common.WithNBoomCores(2) ++
|
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
|
||||||
|
|
||||||
class RV32UnifiedBoomConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.SmallRV32UnifiedBoomConfig)
|
|
||||||
|
|
||||||
class BoomL2Config extends Config(
|
|
||||||
new WithInclusiveCache ++
|
|
||||||
new SmallDefaultBoomConfig)
|
|
||||||
|
|
||||||
// ---------------------
|
|
||||||
// BOOM and Rocket Configs
|
|
||||||
// ---------------------
|
|
||||||
|
|
||||||
class BaseBoomAndRocketConfig extends Config(
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.WithRenumberHarts ++
|
|
||||||
new boom.common.WithRVC ++
|
|
||||||
new boom.common.WithLargeBooms ++
|
|
||||||
new boom.common.BaseBoomConfig ++
|
|
||||||
new boom.common.WithNBoomCores(1) ++
|
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
|
||||||
|
|
||||||
class SmallBaseBoomAndRocketConfig extends Config(
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.WithRenumberHarts ++
|
|
||||||
new boom.common.WithRVC ++
|
|
||||||
new boom.common.WithSmallBooms ++
|
|
||||||
new boom.common.BaseBoomConfig ++
|
|
||||||
new boom.common.WithNBoomCores(1) ++
|
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
|
||||||
|
|
||||||
class DefaultBoomAndRocketConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new BaseBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class SmallDefaultBoomAndRocketConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new SmallBaseBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class HwachaBoomAndRocketConfig extends Config(
|
|
||||||
new hwacha.DefaultHwachaConfig ++
|
|
||||||
new DefaultBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class RoccBoomAndRocketConfig extends Config(
|
|
||||||
new WithRoccExample ++
|
|
||||||
new DefaultBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class PWMBoomAndRocketConfig extends Config(
|
|
||||||
new WithPWMBoomRocketTop ++
|
|
||||||
new BaseBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class PWMAXI4BoomAndRocketConfig extends Config(
|
|
||||||
new WithPWMAXI4BoomRocketTop ++
|
|
||||||
new BaseBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class SimBlockDeviceBoomAndRocketConfig extends Config(
|
|
||||||
new WithBlockDevice ++
|
|
||||||
new WithSimBlockDeviceBoomRocketTop ++
|
|
||||||
new BaseBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class BlockDeviceModelBoomAndRocketConfig extends Config(
|
|
||||||
new WithBlockDevice ++
|
|
||||||
new WithBlockDeviceModelBoomRocketTop ++
|
|
||||||
new BaseBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class GPIOBoomAndRocketConfig extends Config(
|
|
||||||
new WithGPIO ++
|
|
||||||
new WithGPIOBoomRocketTop ++
|
|
||||||
new BaseBoomAndRocketConfig)
|
|
||||||
|
|
||||||
class DualCoreBoomAndOneRocketConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.WithRenumberHarts ++
|
|
||||||
new boom.common.WithRVC ++
|
|
||||||
new boom.common.WithLargeBooms ++
|
|
||||||
new boom.common.BaseBoomConfig ++
|
|
||||||
new boom.common.WithNBoomCores(2) ++
|
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
|
||||||
|
|
||||||
class DualBoomAndOneHwachaRocketConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new WithBootROM ++
|
|
||||||
new WithMultiRoCC ++
|
|
||||||
new WithMultiRoCCHwacha(0) ++ // put Hwacha just on hart0 which was renumbered to Rocket
|
|
||||||
new boom.common.WithRenumberHarts(rocketFirst = true) ++
|
|
||||||
new hwacha.DefaultHwachaConfig ++
|
|
||||||
new boom.common.WithRVC ++
|
|
||||||
new boom.common.WithLargeBooms ++
|
|
||||||
new boom.common.BaseBoomConfig ++
|
|
||||||
new boom.common.WithNBoomCores(2) ++
|
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
|
||||||
|
|
||||||
class RV32BoomAndRocketConfig extends Config(
|
|
||||||
new WithNormalBoomRocketTop ++
|
|
||||||
new WithBootROM ++
|
|
||||||
new boom.common.WithRenumberHarts ++
|
|
||||||
new boom.common.WithBoomRV32 ++
|
|
||||||
new boom.common.WithRVC ++
|
|
||||||
new boom.common.WithLargeBooms ++
|
|
||||||
new boom.common.BaseBoomConfig ++
|
|
||||||
new boom.common.WithNBoomCores(1) ++
|
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
|
||||||
new freechips.rocketchip.subsystem.WithRV32 ++
|
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
|
||||||
|
|
||||||
class DualCoreRocketL2Config extends Config(
|
|
||||||
new WithInclusiveCache ++
|
|
||||||
new DualCoreRocketConfig)
|
|
||||||
94
generators/example/src/main/scala/HeteroConfigs.scala
Normal file
94
generators/example/src/main/scala/HeteroConfigs.scala
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import chisel3._
|
||||||
|
|
||||||
|
import freechips.rocketchip.config.{Config}
|
||||||
|
|
||||||
|
// ---------------------
|
||||||
|
// Heterogenous Configs
|
||||||
|
// ---------------------
|
||||||
|
|
||||||
|
class LargeBoomAndRocketConfig extends Config(
|
||||||
|
new WithTop ++ // default top
|
||||||
|
new WithBootROM ++ // default bootrom
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++ // use SiFive l2
|
||||||
|
new boom.common.WithRenumberHarts ++ // avoid hartid overlap
|
||||||
|
new boom.common.WithLargeBooms ++ // 3-wide boom
|
||||||
|
new boom.common.WithNBoomCores(1) ++ // single-core boom
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++ // single-core rocket
|
||||||
|
new freechips.rocketchip.system.BaseConfig) // "base" rocketchip system
|
||||||
|
|
||||||
|
class SmallBoomAndRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithRenumberHarts ++
|
||||||
|
new boom.common.WithSmallBooms ++ // 1-wide boom
|
||||||
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class HwachaLargeBoomAndHwachaRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new hwacha.DefaultHwachaConfig ++ // add hwacha to all harts
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithRenumberHarts ++
|
||||||
|
new boom.common.WithLargeBooms ++
|
||||||
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class RoccLargeBoomAndRoccRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithRoccExample ++ // add example rocc accelerator to all harts
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithRenumberHarts ++
|
||||||
|
new boom.common.WithLargeBooms ++
|
||||||
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class DualLargeBoomAndRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithRenumberHarts ++
|
||||||
|
new boom.common.WithLargeBooms ++
|
||||||
|
new boom.common.WithNBoomCores(2) ++ // 2-boom cores
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class DualLargeBoomAndHwachaRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new WithMultiRoCC ++ // support heterogeneous rocc
|
||||||
|
new WithMultiRoCCHwacha(2) ++ // put hwacha on hart-2 (rocket)
|
||||||
|
new boom.common.WithRenumberHarts ++
|
||||||
|
new boom.common.WithLargeBooms ++
|
||||||
|
new boom.common.WithNBoomCores(2) ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class LargeBoomAndRV32RocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithRenumberHarts ++
|
||||||
|
new boom.common.WithLargeBooms ++
|
||||||
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.subsystem.WithRV32 ++ // use 32-bit rocket
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class DualLargeBoomAndDualRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new boom.common.WithRenumberHarts ++
|
||||||
|
new boom.common.WithLargeBooms ++
|
||||||
|
new boom.common.WithNBoomCores(2) ++ // 2 boom cores
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(2) ++ // 2 rocket cores
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
102
generators/example/src/main/scala/RocketConfigs.scala
Normal file
102
generators/example/src/main/scala/RocketConfigs.scala
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import chisel3._
|
||||||
|
|
||||||
|
import freechips.rocketchip.config.{Config}
|
||||||
|
|
||||||
|
// --------------
|
||||||
|
// Rocket Configs
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
class RocketConfig extends Config(
|
||||||
|
new WithTop ++ // use default top
|
||||||
|
new WithBootROM ++ // use default bootrom
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++ // use Sifive L2 cache
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++ // single rocket-core
|
||||||
|
new freechips.rocketchip.system.BaseConfig) // "base" rocketchip system
|
||||||
|
|
||||||
|
class HwachaRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new hwacha.DefaultHwachaConfig ++ // use Hwacha vector accelerator
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class RoccRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithRoccExample ++ // use example RoCC-based accelerator
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class jtagRocketConfig extends Config(
|
||||||
|
new WithDTMTop ++ // use top with dtm
|
||||||
|
new freechips.rocketchip.subsystem.WithJtagDTM ++ // add jtag/DTM module to coreplex
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class PWMRocketConfig extends Config(
|
||||||
|
new WithPWMTop ++ // use top with tilelink-controlled PWM
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class PWMRAXI4ocketConfig extends Config(
|
||||||
|
new WithPWMAXI4Top ++ // use top with axi4-controlled PWM
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class SimBlockDeviceRocketConfig extends Config(
|
||||||
|
new testchipip.WithBlockDevice ++ // add block-device module to peripherybus
|
||||||
|
new WithSimBlockDeviceTop ++ // use top with block-device IOs and connect to simblockdevice
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class BlockDeviceModelRocketConfig extends Config(
|
||||||
|
new testchipip.WithBlockDevice ++ // add block-device module to periphery bus
|
||||||
|
new WithBlockDeviceModelTop ++ // use top with block-device IOs and connect to a blockdevicemodel
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class GPIORocketConfig extends Config(
|
||||||
|
new WithGPIO ++ // add GPIOs to the peripherybus
|
||||||
|
new WithGPIOTop ++ // use top with GPIOs
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class DualCoreRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(2) ++ // dual-core (2 RocketTiles)
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class RV32RocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithRV32 ++ // set RocketTiles to be 32-bit
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
|
class GB1MemoryRocketConfig extends Config(
|
||||||
|
new WithTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||||
|
new freechips.rocketchip.subsystem.WithExtMemSize((1<<30) * 1L) ++ // use 2GB simulated external memory
|
||||||
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@ 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 BuildTop extends Field[(Clock, Bool, Parameters) => TopModule[Top]]
|
||||||
case object BuildBoomRocketTopWithDTM extends Field[(Clock, Bool, Parameters) => BoomRocketTopWithDTMModule[BoomRocketTopWithDTM]]
|
case object BuildTopWithDTM extends Field[(Clock, Bool, Parameters) => TopWithDTMModule[TopWithDTM]]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test harness using TSI to bringup the system
|
* Test harness using TSI to bringup the system
|
||||||
@@ -28,7 +28,7 @@ class TestHarness(implicit val p: Parameters) extends Module {
|
|||||||
// force Chisel to rename module
|
// force Chisel to rename module
|
||||||
override def desiredName = "TestHarness"
|
override def desiredName = "TestHarness"
|
||||||
|
|
||||||
val dut = p(BuildBoomRocketTop)(clock, reset.toBool, p)
|
val dut = p(BuildTop)(clock, reset.toBool, p)
|
||||||
|
|
||||||
dut.debug := DontCare
|
dut.debug := DontCare
|
||||||
dut.connectSimAXIMem()
|
dut.connectSimAXIMem()
|
||||||
@@ -63,7 +63,7 @@ class TestHarnessWithDTM(implicit p: Parameters) extends Module
|
|||||||
// force Chisel to rename module
|
// force Chisel to rename module
|
||||||
override def desiredName = "TestHarness"
|
override def desiredName = "TestHarness"
|
||||||
|
|
||||||
val dut = p(BuildBoomRocketTopWithDTM)(clock, reset.toBool, p)
|
val dut = p(BuildTopWithDTM)(clock, reset.toBool, p)
|
||||||
|
|
||||||
dut.reset := reset.asBool | dut.debug.ndreset
|
dut.reset := reset.asBool | dut.debug.ndreset
|
||||||
dut.connectSimAXIMem()
|
dut.connectSimAXIMem()
|
||||||
|
|||||||
@@ -10,69 +10,71 @@ import freechips.rocketchip.util.DontTouch
|
|||||||
|
|
||||||
import testchipip._
|
import testchipip._
|
||||||
|
|
||||||
|
import utilities.{System, SystemModule}
|
||||||
|
|
||||||
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 Top(implicit p: Parameters) extends System
|
||||||
with HasNoDebug
|
with HasNoDebug
|
||||||
with HasPeripherySerial {
|
with HasPeripherySerial {
|
||||||
override lazy val module = new BoomRocketTopModule(this)
|
override lazy val module = new TopModule(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoomRocketTopModule[+L <: BoomRocketTop](l: L) extends boom.system.BoomRocketSystemModule(l)
|
class TopModule[+L <: Top](l: L) extends SystemModule(l)
|
||||||
with HasNoDebugModuleImp
|
with HasNoDebugModuleImp
|
||||||
with HasPeripherySerialModuleImp
|
with HasPeripherySerialModuleImp
|
||||||
with DontTouch
|
with DontTouch
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BoomRocketTopWithPWMTL(implicit p: Parameters) extends BoomRocketTop
|
class TopWithPWMTL(implicit p: Parameters) extends Top
|
||||||
with HasPeripheryPWMTL {
|
with HasPeripheryPWMTL {
|
||||||
override lazy val module = new BoomRocketTopWithPWMTLModule(this)
|
override lazy val module = new TopWithPWMTLModule(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoomRocketTopWithPWMTLModule(l: BoomRocketTopWithPWMTL) extends BoomRocketTopModule(l)
|
class TopWithPWMTLModule(l: TopWithPWMTL) extends TopModule(l)
|
||||||
with HasPeripheryPWMTLModuleImp
|
with HasPeripheryPWMTLModuleImp
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BoomRocketTopWithPWMAXI4(implicit p: Parameters) extends BoomRocketTop
|
class TopWithPWMAXI4(implicit p: Parameters) extends Top
|
||||||
with HasPeripheryPWMAXI4 {
|
with HasPeripheryPWMAXI4 {
|
||||||
override lazy val module = new BoomRocketTopWithPWMAXI4Module(this)
|
override lazy val module = new TopWithPWMAXI4Module(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoomRocketTopWithPWMAXI4Module(l: BoomRocketTopWithPWMAXI4) extends BoomRocketTopModule(l)
|
class TopWithPWMAXI4Module(l: TopWithPWMAXI4) extends TopModule(l)
|
||||||
with HasPeripheryPWMAXI4ModuleImp
|
with HasPeripheryPWMAXI4ModuleImp
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BoomRocketTopWithBlockDevice(implicit p: Parameters) extends BoomRocketTop
|
class TopWithBlockDevice(implicit p: Parameters) extends Top
|
||||||
with HasPeripheryBlockDevice {
|
with HasPeripheryBlockDevice {
|
||||||
override lazy val module = new BoomRocketTopWithBlockDeviceModule(this)
|
override lazy val module = new TopWithBlockDeviceModule(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoomRocketTopWithBlockDeviceModule(l: BoomRocketTopWithBlockDevice) extends BoomRocketTopModule(l)
|
class TopWithBlockDeviceModule(l: TopWithBlockDevice) extends TopModule(l)
|
||||||
with HasPeripheryBlockDeviceModuleImp
|
with HasPeripheryBlockDeviceModuleImp
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BoomRocketTopWithGPIO(implicit p: Parameters) extends BoomRocketTop
|
class TopWithGPIO(implicit p: Parameters) extends Top
|
||||||
with HasPeripheryGPIO {
|
with HasPeripheryGPIO {
|
||||||
override lazy val module = new BoomRocketTopWithGPIOModule(this)
|
override lazy val module = new TopWithGPIOModule(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoomRocketTopWithGPIOModule(l: BoomRocketTopWithGPIO)
|
class TopWithGPIOModule(l: TopWithGPIO)
|
||||||
extends BoomRocketTopModule(l)
|
extends TopModule(l)
|
||||||
with HasPeripheryGPIOModuleImp
|
with HasPeripheryGPIOModuleImp
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BoomRocketTopWithDTM(implicit p: Parameters) extends boom.system.BoomRocketSystem
|
class TopWithDTM(implicit p: Parameters) extends System
|
||||||
{
|
{
|
||||||
override lazy val module = new BoomRocketTopWithDTMModule(this)
|
override lazy val module = new TopWithDTMModule(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoomRocketTopWithDTMModule[+L <: BoomRocketTopWithDTM](l: L) extends boom.system.BoomRocketSystemModule(l)
|
class TopWithDTMModule[+L <: TopWithDTM](l: L) extends SystemModule(l)
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ trait HasTestSuites {
|
|||||||
"rv64ud-v-fadd",
|
"rv64ud-v-fadd",
|
||||||
"rv64uf-v-fadd",
|
"rv64uf-v-fadd",
|
||||||
"rv64um-v-mul",
|
"rv64um-v-mul",
|
||||||
// "rv64mi-p-breakpoint", // Not implemented in BOOM
|
"rv64mi-p-breakpoint",
|
||||||
// "rv64uc-v-rvc", // Not implemented in BOOM
|
"rv64uc-v-rvc",
|
||||||
"rv64ud-v-structural",
|
"rv64ud-v-structural",
|
||||||
"rv64si-p-wfi",
|
"rv64si-p-wfi",
|
||||||
"rv64um-v-divw",
|
"rv64um-v-divw",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import freechips.rocketchip.tilelink._
|
|||||||
import freechips.rocketchip.subsystem._
|
import freechips.rocketchip.subsystem._
|
||||||
import freechips.rocketchip.devices.tilelink.BootROMParams
|
import freechips.rocketchip.devices.tilelink.BootROMParams
|
||||||
import freechips.rocketchip.devices.debug.DebugModuleParams
|
import freechips.rocketchip.devices.debug.DebugModuleParams
|
||||||
import boom.system.BoomTilesKey
|
import boom.common.BoomTilesKey
|
||||||
import testchipip.{WithBlockDevice, BlockDeviceKey, BlockDeviceConfig}
|
import testchipip.{WithBlockDevice, BlockDeviceKey, BlockDeviceConfig}
|
||||||
import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
|
import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
|
||||||
import icenet._
|
import icenet._
|
||||||
@@ -136,8 +136,10 @@ class FireSimBoomConfig extends Config(
|
|||||||
new WithBlockDevice ++
|
new WithBlockDevice ++
|
||||||
new WithBoomL2TLBs(1024) ++
|
new WithBoomL2TLBs(1024) ++
|
||||||
new WithoutClockGating ++
|
new WithoutClockGating ++
|
||||||
// Using a small config because it has 64-bit system bus, and compiles quickly
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.SmallBoomConfig)
|
new boom.common.WithNBoomCores(1) ++
|
||||||
|
new freechips.rocketchip.system.BaseConfig
|
||||||
|
)
|
||||||
|
|
||||||
// A safer implementation than the one in BOOM in that it
|
// A safer implementation than the one in BOOM in that it
|
||||||
// duplicates whatever BOOMTileKey.head is present N times. This prevents
|
// duplicates whatever BOOMTileKey.head is present N times. This prevents
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import freechips.rocketchip.util.{HeterogeneousBag}
|
|||||||
import freechips.rocketchip.amba.axi4.AXI4Bundle
|
import freechips.rocketchip.amba.axi4.AXI4Bundle
|
||||||
import freechips.rocketchip.config.{Field, Parameters}
|
import freechips.rocketchip.config.{Field, Parameters}
|
||||||
import freechips.rocketchip.diplomacy.LazyModule
|
import freechips.rocketchip.diplomacy.LazyModule
|
||||||
import boom.system.{BoomRocketSubsystem, BoomRocketSubsystemModuleImp}
|
import utilities.{Subsystem, SubsystemModuleImp}
|
||||||
import icenet._
|
import icenet._
|
||||||
import testchipip._
|
import testchipip._
|
||||||
import testchipip.SerialAdapter.SERIAL_IF_WIDTH
|
import testchipip.SerialAdapter.SERIAL_IF_WIDTH
|
||||||
@@ -80,7 +80,7 @@ class FireSimNoNICModuleImp[+L <: FireSimNoNIC](l: L) extends RocketSubsystemMod
|
|||||||
with HasTraceIOImp
|
with HasTraceIOImp
|
||||||
|
|
||||||
|
|
||||||
class FireBoom(implicit p: Parameters) extends BoomRocketSubsystem
|
class FireBoom(implicit p: Parameters) extends Subsystem
|
||||||
with HasHierarchicalBusTopology
|
with HasHierarchicalBusTopology
|
||||||
with CanHaveFASEDOptimizedMasterAXI4MemPort
|
with CanHaveFASEDOptimizedMasterAXI4MemPort
|
||||||
with HasPeripheryBootROM
|
with HasPeripheryBootROM
|
||||||
@@ -94,7 +94,7 @@ class FireBoom(implicit p: Parameters) extends BoomRocketSubsystem
|
|||||||
override lazy val module = new FireBoomModuleImp(this)
|
override lazy val module = new FireBoomModuleImp(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class FireBoomModuleImp[+L <: FireBoom](l: L) extends BoomRocketSubsystemModuleImp(l)
|
class FireBoomModuleImp[+L <: FireBoom](l: L) extends SubsystemModuleImp(l)
|
||||||
with HasRTCModuleImp
|
with HasRTCModuleImp
|
||||||
with CanHaveFASEDOptimizedMasterAXI4MemPortModuleImp
|
with CanHaveFASEDOptimizedMasterAXI4MemPortModuleImp
|
||||||
with HasPeripheryBootROMModuleImp
|
with HasPeripheryBootROMModuleImp
|
||||||
@@ -106,7 +106,7 @@ class FireBoomModuleImp[+L <: FireBoom](l: L) extends BoomRocketSubsystemModuleI
|
|||||||
with HasTraceIOImp
|
with HasTraceIOImp
|
||||||
with ExcludeInvalidBoomAssertions
|
with ExcludeInvalidBoomAssertions
|
||||||
|
|
||||||
class FireBoomNoNIC(implicit p: Parameters) extends BoomRocketSubsystem
|
class FireBoomNoNIC(implicit p: Parameters) extends Subsystem
|
||||||
with HasHierarchicalBusTopology
|
with HasHierarchicalBusTopology
|
||||||
with CanHaveFASEDOptimizedMasterAXI4MemPort
|
with CanHaveFASEDOptimizedMasterAXI4MemPort
|
||||||
with HasPeripheryBootROM
|
with HasPeripheryBootROM
|
||||||
@@ -119,7 +119,7 @@ class FireBoomNoNIC(implicit p: Parameters) extends BoomRocketSubsystem
|
|||||||
override lazy val module = new FireBoomNoNICModuleImp(this)
|
override lazy val module = new FireBoomNoNICModuleImp(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class FireBoomNoNICModuleImp[+L <: FireBoomNoNIC](l: L) extends BoomRocketSubsystemModuleImp(l)
|
class FireBoomNoNICModuleImp[+L <: FireBoomNoNIC](l: L) extends SubsystemModuleImp(l)
|
||||||
with HasRTCModuleImp
|
with HasRTCModuleImp
|
||||||
with CanHaveFASEDOptimizedMasterAXI4MemPortModuleImp
|
with CanHaveFASEDOptimizedMasterAXI4MemPortModuleImp
|
||||||
with HasPeripheryBootROMModuleImp
|
with HasPeripheryBootROMModuleImp
|
||||||
|
|||||||
108
generators/utilities/src/main/scala/Subsystem.scala
Normal file
108
generators/utilities/src/main/scala/Subsystem.scala
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
//******************************************************************************
|
||||||
|
// Copyright (c) 2019 - 2019, The Regents of the University of California (Regents).
|
||||||
|
// All Rights Reserved. See LICENSE and LICENSE.SiFive for license details.
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package utilities
|
||||||
|
|
||||||
|
import chisel3._
|
||||||
|
import chisel3.internal.sourceinfo.{SourceInfo}
|
||||||
|
|
||||||
|
import freechips.rocketchip.config.{Field, Parameters}
|
||||||
|
import freechips.rocketchip.devices.tilelink._
|
||||||
|
import freechips.rocketchip.devices.debug.{HasPeripheryDebug, HasPeripheryDebugModuleImp}
|
||||||
|
import freechips.rocketchip.diplomacy._
|
||||||
|
import freechips.rocketchip.diplomaticobjectmodel.model.{OMInterrupt}
|
||||||
|
import freechips.rocketchip.diplomaticobjectmodel.logicaltree.{RocketTileLogicalTreeNode, LogicalModuleTree}
|
||||||
|
import freechips.rocketchip.tile._
|
||||||
|
import freechips.rocketchip.tilelink._
|
||||||
|
import freechips.rocketchip.interrupts._
|
||||||
|
import freechips.rocketchip.util._
|
||||||
|
import freechips.rocketchip.subsystem._
|
||||||
|
import freechips.rocketchip.amba.axi4._
|
||||||
|
|
||||||
|
import boom.common.{BoomTile, BoomTilesKey, BoomCrossingKey}
|
||||||
|
|
||||||
|
|
||||||
|
trait HasBoomAndRocketTiles extends HasTiles
|
||||||
|
with CanHavePeripheryPLIC
|
||||||
|
with CanHavePeripheryCLINT
|
||||||
|
with HasPeripheryDebug
|
||||||
|
{ this: BaseSubsystem =>
|
||||||
|
|
||||||
|
val module: HasBoomAndRocketTilesModuleImp
|
||||||
|
|
||||||
|
protected val rocketTileParams = p(RocketTilesKey)
|
||||||
|
protected val boomTileParams = p(BoomTilesKey)
|
||||||
|
// crossing can either be per tile or global (aka only 1 crossing specified)
|
||||||
|
private val rocketCrossings = perTileOrGlobalSetting(p(RocketCrossingKey), rocketTileParams.size)
|
||||||
|
private val boomCrossings = perTileOrGlobalSetting(p(BoomCrossingKey), boomTileParams.size)
|
||||||
|
|
||||||
|
// Make a tile and wire its nodes into the system,
|
||||||
|
// according to the specified type of clock crossing.
|
||||||
|
// Note that we also inject new nodes into the tile itself,
|
||||||
|
// also based on the crossing type.
|
||||||
|
val rocketTiles = rocketTileParams.zip(rocketCrossings).map { case (tp, crossing) =>
|
||||||
|
val rocket = LazyModule(new RocketTile(tp, crossing, PriorityMuxHartIdFromSeq(rocketTileParams), logicalTreeNode))
|
||||||
|
|
||||||
|
connectMasterPortsToSBus(rocket, crossing)
|
||||||
|
connectSlavePortsToCBus(rocket, crossing)
|
||||||
|
|
||||||
|
def treeNode: RocketTileLogicalTreeNode = new RocketTileLogicalTreeNode(rocket.rocketLogicalTree.getOMInterruptTargets)
|
||||||
|
LogicalModuleTree.add(logicalTreeNode, rocket.rocketLogicalTree)
|
||||||
|
|
||||||
|
rocket
|
||||||
|
}
|
||||||
|
|
||||||
|
val boomTiles = boomTileParams.zip(boomCrossings).map { case (tp, crossing) =>
|
||||||
|
val boom = LazyModule(new BoomTile(tp, crossing, PriorityMuxHartIdFromSeq(boomTileParams), logicalTreeNode))
|
||||||
|
|
||||||
|
connectMasterPortsToSBus(boom, crossing)
|
||||||
|
connectSlavePortsToCBus(boom, crossing)
|
||||||
|
|
||||||
|
def treeNode: RocketTileLogicalTreeNode = new RocketTileLogicalTreeNode(boom.rocketLogicalTree.getOMInterruptTargets)
|
||||||
|
LogicalModuleTree.add(logicalTreeNode, boom.rocketLogicalTree)
|
||||||
|
|
||||||
|
boom
|
||||||
|
}
|
||||||
|
|
||||||
|
// combine tiles and connect interrupts based on the order of harts
|
||||||
|
val boomAndRocketTiles = (rocketTiles ++ boomTiles).sortWith(_.tileParams.hartId < _.tileParams.hartId).map {
|
||||||
|
tile => {
|
||||||
|
connectInterrupts(tile, Some(debug), clintOpt, plicOpt)
|
||||||
|
|
||||||
|
tile
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def coreMonitorBundles = (rocketTiles map { t => t.module.core.rocketImpl.coreMonitorBundle}).toList ++
|
||||||
|
(boomTiles map { t => t.module.core.coreMonitorBundle}).toList
|
||||||
|
}
|
||||||
|
|
||||||
|
trait HasBoomAndRocketTilesModuleImp extends HasTilesModuleImp
|
||||||
|
with HasPeripheryDebugModuleImp
|
||||||
|
{
|
||||||
|
val outer: HasBoomAndRocketTiles
|
||||||
|
}
|
||||||
|
|
||||||
|
class Subsystem(implicit p: Parameters) extends BaseSubsystem
|
||||||
|
with HasBoomAndRocketTiles
|
||||||
|
{
|
||||||
|
val tiles = boomAndRocketTiles
|
||||||
|
override lazy val module = new SubsystemModuleImp(this)
|
||||||
|
|
||||||
|
def getOMInterruptDevice(resourceBindingsMap: ResourceBindingsMap): Seq[OMInterrupt] = Nil
|
||||||
|
}
|
||||||
|
|
||||||
|
class SubsystemModuleImp[+L <: Subsystem](_outer: L) extends BaseSubsystemModuleImp(_outer)
|
||||||
|
with HasResetVectorWire
|
||||||
|
with HasBoomAndRocketTilesModuleImp
|
||||||
|
{
|
||||||
|
tile_inputs.zip(outer.hartIdList).foreach { case(wire, i) =>
|
||||||
|
wire.hartid := i.U
|
||||||
|
wire.reset_vector := global_reset_vector
|
||||||
|
}
|
||||||
|
|
||||||
|
// create file with boom params
|
||||||
|
ElaborationArtefacts.add("""core.config""", outer.tiles.map(x => x.module.toString).mkString("\n"))
|
||||||
|
}
|
||||||
45
generators/utilities/src/main/scala/System.scala
Normal file
45
generators/utilities/src/main/scala/System.scala
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
//******************************************************************************
|
||||||
|
// Copyright (c) 2019 - 2019, The Regents of the University of California (Regents).
|
||||||
|
// All Rights Reserved. See LICENSE and LICENSE.SiFive for license details.
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package utilities
|
||||||
|
|
||||||
|
import chisel3._
|
||||||
|
|
||||||
|
import freechips.rocketchip.config.{Parameters}
|
||||||
|
import freechips.rocketchip.subsystem._
|
||||||
|
import freechips.rocketchip.tilelink._
|
||||||
|
import freechips.rocketchip.devices.tilelink._
|
||||||
|
import freechips.rocketchip.diplomacy._
|
||||||
|
import freechips.rocketchip.util.{DontTouch}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
// Base system that uses the debug test module (dtm) to bringup the core
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base top with periphery devices and ports, and a BOOM + Rocket subsystem
|
||||||
|
*/
|
||||||
|
class System(implicit p: Parameters) extends Subsystem
|
||||||
|
with HasHierarchicalBusTopology
|
||||||
|
with HasAsyncExtInterrupts
|
||||||
|
with CanHaveMasterAXI4MemPort
|
||||||
|
with CanHaveMasterAXI4MMIOPort
|
||||||
|
with CanHaveSlaveAXI4Port
|
||||||
|
with HasPeripheryBootROM
|
||||||
|
{
|
||||||
|
override lazy val module = new SystemModule(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base top module implementation with periphery devices and ports, and a BOOM + Rocket subsystem
|
||||||
|
*/
|
||||||
|
class SystemModule[+L <: System](_outer: L) extends SubsystemModuleImp(_outer)
|
||||||
|
with HasRTCModuleImp
|
||||||
|
with HasExtInterruptsModuleImp
|
||||||
|
with CanHaveMasterAXI4MemPortModuleImp
|
||||||
|
with CanHaveMasterAXI4MMIOPortModuleImp
|
||||||
|
with CanHaveSlaveAXI4PortModuleImp
|
||||||
|
with HasPeripheryBootROMModuleImp
|
||||||
|
with DontTouch
|
||||||
@@ -8,7 +8,7 @@ import freechips.rocketchip.config.{Parameters}
|
|||||||
import freechips.rocketchip.util.{GeneratorApp}
|
import freechips.rocketchip.util.{GeneratorApp}
|
||||||
import freechips.rocketchip.system.{TestGeneration, RegressionTestSuite}
|
import freechips.rocketchip.system.{TestGeneration, RegressionTestSuite}
|
||||||
|
|
||||||
import boom.system.{BoomTilesKey}
|
import boom.common.{BoomTilesKey}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of pre-chosen regression tests
|
* A set of pre-chosen regression tests
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ VERILATOR_NONCC_OPTS = \
|
|||||||
+define+PRINTF_COND=\$$c\(\"verbose\",\"\&\&\"\,\"done_reset\"\) \
|
+define+PRINTF_COND=\$$c\(\"verbose\",\"\&\&\"\,\"done_reset\"\) \
|
||||||
+define+STOP_COND=\$$c\(\"done_reset\"\) \
|
+define+STOP_COND=\$$c\(\"done_reset\"\) \
|
||||||
--assert \
|
--assert \
|
||||||
--output-split 20000 \
|
--output-split 10000 \
|
||||||
|
--output-split-cfuncs 100 \
|
||||||
$(sim_vsrcs) \
|
$(sim_vsrcs) \
|
||||||
-f $(sim_common_files)
|
-f $(sim_common_files)
|
||||||
|
|
||||||
@@ -96,11 +97,12 @@ $(model_mk_debug): $(sim_vsrcs) $(sim_common_files) $(INSTALLED_VERILATOR)
|
|||||||
#########################################################################################
|
#########################################################################################
|
||||||
# invoke make to make verilator sim rules
|
# invoke make to make verilator sim rules
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
VERILATOR_MAKEFLAGS=-j8
|
||||||
$(sim): $(model_mk)
|
$(sim): $(model_mk)
|
||||||
$(MAKE) VM_PARALLEL_BUILDS=1 -C $(model_dir) -f V$(VLOG_MODEL).mk
|
$(MAKE) $(VERILATOR_MAKEFLAGS) VM_PARALLEL_BUILDS=1 -C $(model_dir) -f V$(VLOG_MODEL).mk
|
||||||
|
|
||||||
$(sim_debug): $(model_mk_debug)
|
$(sim_debug): $(model_mk_debug)
|
||||||
$(MAKE) VM_PARALLEL_BUILDS=1 -C $(model_dir_debug) -f V$(VLOG_MODEL).mk
|
$(MAKE) $(VERILATOR_MAKEFLAGS) VM_PARALLEL_BUILDS=1 -C $(model_dir_debug) -f V$(VLOG_MODEL).mk
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# create a verilator vpd rule
|
# create a verilator vpd rule
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ ifeq ($(SUB_PROJECT),example)
|
|||||||
MODEL ?= TestHarness
|
MODEL ?= TestHarness
|
||||||
VLOG_MODEL ?= TestHarness
|
VLOG_MODEL ?= TestHarness
|
||||||
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
||||||
CONFIG ?= DefaultRocketConfig
|
CONFIG ?= RocketConfig
|
||||||
CONFIG_PACKAGE ?= $(SBT_PROJECT)
|
CONFIG_PACKAGE ?= $(SBT_PROJECT)
|
||||||
GENERATOR_PACKAGE ?= $(SBT_PROJECT)
|
GENERATOR_PACKAGE ?= $(SBT_PROJECT)
|
||||||
TB ?= TestDriver
|
TB ?= TestDriver
|
||||||
TOP ?= BoomRocketTop
|
TOP ?= Top
|
||||||
endif
|
endif
|
||||||
# for Rocket-chip developers
|
# for Rocket-chip developers
|
||||||
ifeq ($(SUB_PROJECT),rocketchip)
|
ifeq ($(SUB_PROJECT),rocketchip)
|
||||||
|
|||||||
Reference in New Issue
Block a user