Skip to content

Commit

Permalink
Rebase onto latest main.
Browse files Browse the repository at this point in the history
[LLVM] Change llvm to github version.

[MemPool-Spatz] Rebase on top of the main
Unfortunately, Spatz cannot co-exit with the Snitch FPU due to the interface conflicts.
Snitch FPU is removed in the branch.

[Clean Code] Add gitignore and remove generated data files.

[TCDM-Burst] Fix a bug that one large ROB may be generated even grouped response is not used.

[MemPool-Spatz] Fix a bug in fence handling. Add Spatz2 configurations.

[Clean Code] Fix a port mismatch of an elabortaion parameter.

Add a README for MemPool-Spatz.

Update Spatz version.

Update spatz and cluster_interconnect submodule version.

Remove unused files.

Clean unused signals and files.

fix mempool_pkg for mempool-spatz.

Update README and mempool-spatz automatic flow.

Fix some trailing zeros
  • Loading branch information
msc23h24 Diyou Shen (dishen) authored and DiyouS committed Aug 16, 2024
1 parent 859d40f commit 105b064
Show file tree
Hide file tree
Showing 59 changed files with 406 additions and 4,022 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/pulp-platform/pulp-riscv-gnu-toolchain.git
[submodule "toolchain/llvm-project"]
path = toolchain/llvm-project
url = git@iis-git.ee.ethz.ch:iis-compilers/llvm-project.git
url = https://github.com/pulp-platform/llvm-project.git
[submodule "toolchain/halide"]
path = toolchain/halide
url = https://github.com/SamuelRiedel/Halide.git
Expand Down Expand Up @@ -45,4 +45,4 @@
url = https://github.com/pulp-platform/dram_rtl_sim.git
[submodule "hardware/deps/spatz"]
path = hardware/deps/spatz
url = git@iis-git.ee.ethz.ch:spatz/spatz.git
url = https://github.com/pulp-platform/spatz.git
25 changes: 21 additions & 4 deletions Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ packages:
- common_cells
- common_verification
- tech_cells_generic
axi_riscv_atomics:
revision: 97dcb14ef057cbe5bd70dda2060b5bb9e7e04c6d
version: 0.7.0
source:
Git: https://github.com/pulp-platform/axi_riscv_atomics.git
dependencies:
- axi
- common_cells
- common_verification
cluster_interconnect:
revision: d6eb72eed6f407261c3cf115e144c14c29c824ad
revision: null
version: null
source:
Git: "https://github.com/DiyouS/cluster_interconnect.git"
Path: hardware/deps/cluster_interconnect
dependencies:
- common_cells
common_cells:
Expand Down Expand Up @@ -79,6 +88,14 @@ packages:
dependencies:
- axi
- common_cells
riscv-dbg:
revision: 122510063a02e0d012f0497ffdbafca53d4e716b
version: 0.7.0
source:
Git: https://github.com/pulp-platform/riscv-dbg.git
dependencies:
- common_cells
- tech_cells_generic
snitch:
revision: null
version: null
Expand All @@ -88,10 +105,10 @@ packages:
- axi
- common_cells
spatz:
revision: ee32f12ef0886a733b088a413743113dfafa8692
revision: null
version: null
source:
Git: git@iis-git.ee.ethz.ch:spatz/spatz.git
Path: hardware/deps/spatz
dependencies:
- axi
- axi_riscv_atomics
Expand Down
7 changes: 2 additions & 5 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ package:
dependencies:
axi: { git: "https://github.com/pulp-platform/axi.git", version: 0.39.2 }
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.33.0 }
cluster_interconnect: { git: "https://github.com/DiyouS/cluster_interconnect.git", rev: d6eb72e }
cluster_interconnect: { git: "https://github.com/pulp-platform/cluster_interconnect.git", rev: 8c6c227 }
idma: { path: "hardware/deps/idma" }
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.4.3 }
reqrsp_interface: { path: "hardware/deps/reqrsp_interface" }
snitch: { path: "hardware/deps/snitch" }
tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.13 }
spatz: { git: "git@iis-git.ee.ethz.ch:spatz/spatz.git", rev: ee32f12e }
spatz: { git: "https://github.com/pulp-platform/spatz.git", rev: a45591b }
FPnew: { git: "https://github.com/pulp-platform/cvfpu.git", rev: pulp-v0.1.3 }

workspace:
Expand All @@ -37,9 +37,6 @@ sources:
- hardware/src/axi2mem.sv
- hardware/src/bootrom.sv
- hardware/src/latch_scm.sv
- hardware/src/data_grouper.sv
- hardware/src/burst_cutter.sv
- hardware/src/burst_manager.sv
# Level 1
- hardware/src/mempool_tile.sv
# Level 2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ else
endif

ifeq ($(spatz), 1)
RV32XPULPIMG := opcodes-xpulpabs_CUSTOM opcodes-xpulpbr_CUSTOM opcodes-xpulpclip_CUSTOM opcodes-xpulpmacsi_CUSTOM opcodes-xpulpminmax_CUSTOM opcodes-xpulpslet_CUSTOM
RV32XPULPIMG := opcodes-xpulpabs_CUSTOM opcodes-xpulpbr_CUSTOM opcodes-xpulpclip_CUSTOM opcodes-xpulpmacsi_CUSTOM opcodes-xpulpminmax_CUSTOM opcodes-xpulpslet_CUSTOM
RV32XPULPIMG += opcodes-xpulpbitop_CUSTOM
MEMPOOL_ISA := opcodes-frep_CUSTOM $(RV32XPULPIMG) opcodes-xpulppostmod_CUSTOM
OPCODES := "$(MEMPOOL_ISA) opcodes-rvv opcodes-smallfloat"
Expand Down
44 changes: 31 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Otherwise, if new Xpulpimg instructions have been implemented in Snitch, but the

If `XPULPIMG` is not forced while launching `make`, it will be defaulted to the `xpulpimg` value configured in `config/config.mk`. Note that such parameter in the configuration file also defines whether the Xpulpimg extension is enabled or not in the RTL of the Snitch core, and whether such Xpulpimg functionalities have to be tested or not by the `riscv-tests` unit tests.

### Spatz Applications
### MemPool-Spatz Applications

The MemPool-Sparz requires its own applications, which stored in `software/apps/spatz_apps` folder. The `config` option is required to be set to the configuration supporting Spatz to build the Spatz applications. Please refer to the `README.md` in `config` folder to select the correct configuration. Any applications starting with `sp-` means it requires the `RVF` extension to support single-precision floating point. For these kernels, configurations with `fpu` are requried.

Expand All @@ -142,9 +142,11 @@ cd software/apps
make spatz_apps/sp-fft config=mempool_spatz4_fpu
```

To simplify this process, a `Makefile` is provided under `software/apps/spatz_apps/auto_benchmark` to generate data, build software and run simulation with one-click. However, only few applications can be executed in this way. You can have more knowledge on how to use it in the `help` target of the `Makefile`:
To simplify this process, a `Makefile` is provided under `software/apps/spatz_apps/auto_benchmark` to generate data, build software and run simulation with one-click. However, only limited applications can be executed in this way.

```bash
You can have more knowledge on how to use it in the `help` target of the `Makefile`:

```bash
# Run help target
cd software/apps
make -C spatz_apps/auto_benchmark help
Expand Down Expand Up @@ -195,16 +197,6 @@ app=hello_world make tracevis
app=hello_world make benchmark
```

To simulate the MemPool-Spatz system, Spatz's auto-generated packge needs to be built before running the simulation for the first time. The generated package is under `hardware/deps/spatz/hw/ip/spatz/src/generated/spatz_pkg.sv` Use the following commands to build and run the simulation:
```bash
# Go to the hardware folder
cd hardware
# First-Time Use Only: build Spatz package
make buildspatz
# Run the simulation with *sp-fft* binary loaded using mempool_spatz4_fpu configutation
app=spatz_apps/sp-fft config=mempool_spatz4_fpu make sim
```

You can set up the configuration of the system in the file `config/config.mk`, controlling the total number of cores, the number of cores per tile and whether the Xpulpimg extension is enabled or not in the Snitch core; the `xpulpimg` parameter also control the default core architecture considered when compiling applications for MemPool.

To simulate the MemPool system with Verilator use the same format, but with the target
Expand All @@ -225,6 +217,32 @@ To get a visualization of the traces, check out the `scripts/tracevis.py` script

We also provide Synopsys Spyglass linting scripts in the `hardware/spyglass`. Run `make lint` in the `hardware` folder, with a specific MemPool configuration, to run the tests associated with the `lint_rtl` target.

### MemPool-Spatz Simulation

To simulate the MemPool-Spatz system, Spatz's auto-generated packge needs to be built before running the simulation for the first time. The generated package is under `hardware/deps/spatz/hw/ip/spatz/src/generated/spatz_pkg.sv` Use the following commands to build and run the simulation:
```bash
# Update denpendencies before generating
bender update
# Go to the hardware folder
cd hardware
# First-Time Use Only: build Spatz package
make buildspatz
# Run the simulation with *sp-fft* binary loaded using mempool_spatz4_fpu configutation
app=spatz_apps/sp-fft config=mempool_spatz4_fpu make sim
```

We also provide a automation flow to generate the required files:
```bash
cd software/apps
make -C spatz_apps/auto_benchmark generate config=[MEMPOOL_SPATZ_CONFIGURATION]
```
Then you can generate and run the test using:
```bash
make -C spatz_apps/auto_benchmark app=[KERNEL] size=[SIZE] cores=[CORES] config=[SPATZ_CONFIGURATION] sim=[SIM_TOOL]
```
You may refer to the `help` target for more information.


## DRAMsys Co-Simulation

The MemPool system supports both on-chip SRAM or off-chip DRAM co-simulation for higher hierarchy memory transfering. For off-chip DRAM co-simulation, it incorporates the `dram_rtl_sim` tool as a submodule, build at `hardware/deps/dram_rtl_sim`. Leveraging DRAMSys5.0, it facilitates an effective co-simulation environment between RTL models and DRAMSys5.0 for the simulation of DRAM + CTRL models, with contemporary off-chip DRAM technologies (e.g., LPDDR, DDR, HBM).
Expand Down
5 changes: 1 addition & 4 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ flavors of MemPool. We currently support three flavors:
## MemPool-Spatz Configutations

Besides the above configurations, MemPool-Spatz has its own variates, under the
naming rule: `mempool-type_spatz-type_fpu_burst`.
naming rule: `mempool-type_spatz-type_fpu`.
Here is the discriptions for the selected variates, others can be easily understood
from the naming rule:
- `terapool_spatz8`: 128 cores, organized into 128 tiles with one Snitch and one Spatz8
core each. We have 1024 FUs for Spatz in total.
- `mempool_spatz2_fpu`: 128 cores, organized into 64 tiles with one Snitch and two
Spatz2 cores each. FPUs are added into Spatz. We have 256 FUs for Spatz in total.
- `minpool_spatz4_fpu_burst`: 4 cores, organized into 4 tiles with one Snitch and
one Spatz4 cores each. Support FPU, TCDM Burst, Grouped RSP and parallel burst
handling.

All MemPool-Spatz configurations does not support XPULPIMG due to the instruction
confilct with RVV.
Expand Down
8 changes: 1 addition & 7 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ xqueue_size ?= 0
################################

# Enable the XpulpIMG extension
xpulpimg ?= 1

# Enable FPU extensions
zfinx ?= 1

# Enable FPU extensions
zquarterinx ?= 0
xpulpimg ?= 0

# DivSqrt deactivated by default
xDivSqrt ?= 0
Expand Down
4 changes: 0 additions & 4 deletions config/mempool.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ num_groups ?= 4
# Number of cores per MemPool tile
num_cores_per_tile ?= 4

# Number of shared divsqrt units per MemPool tile
# Defaults to 1 if xDivSqrt is activated
num_divsqrt_per_tile ?= 1

# L1 scratchpad banking factor
banking_factor ?= 4

Expand Down
9 changes: 8 additions & 1 deletion config/mempool_spatz2_fpu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ num_cores_per_tile ?= 2
banking_factor ?= 4

# Radix for hierarchical AXI interconnect
axi_hier_radix ?= 20
axi_hier_radix ?= 17

# Number of AXI masters per group
axi_masters_per_group ?= 1
Expand All @@ -42,3 +42,10 @@ xpulpimg ?= 0

rvf ?= 1
rvd ?= 0

# L2 Banks/Channels
l2_size ?= 4194304 # 400000
l2_banks ?= 4

# Number of DMA backends in each group
dmas_per_group ?= 1 # Brust Length = 16
9 changes: 8 additions & 1 deletion config/mempool_spatz4.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ num_cores_per_tile ?= 1
banking_factor ?= 4

# Radix for hierarchical AXI interconnect
axi_hier_radix ?= 20
axi_hier_radix ?= 17

# Number of AXI masters per group
axi_masters_per_group ?= 1
Expand All @@ -39,3 +39,10 @@ n_fpu ?= 0

# Deactivate the XpulpIMG extension
xpulpimg ?= 0

# L2 Banks/Channels
l2_size ?= 4194304 # 400000
l2_banks ?= 4

# Number of DMA backends in each group
dmas_per_group ?= 1 # Brust Length = 16
9 changes: 8 additions & 1 deletion config/mempool_spatz4_fpu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ num_cores_per_tile ?= 1
banking_factor ?= 4

# Radix for hierarchical AXI interconnect
axi_hier_radix ?= 20
axi_hier_radix ?= 17

# Number of AXI masters per group
axi_masters_per_group ?= 1
Expand All @@ -41,3 +41,10 @@ n_fpu ?= 4
xpulpimg ?= 0

rvf ?= 1

# L2 Banks/Channels
l2_size ?= 4194304 # 400000
l2_banks ?= 4

# Number of DMA backends in each group
dmas_per_group ?= 1 # Brust Length = 16
52 changes: 0 additions & 52 deletions config/mempool_spatz4_fpu_burst.mk

This file was deleted.

4 changes: 0 additions & 4 deletions config/minpool.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ num_groups ?= 4
# Number of cores per MemPool tile
num_cores_per_tile ?= 4

# Number of shared divsqrt units per MemPool tile
# Defaults to 1 if xDivSqrt is activated
num_divsqrt_per_tile ?= 1

# L1 scratchpad banking factor
banking_factor ?= 4

Expand Down
7 changes: 7 additions & 0 deletions config/minpool_spatz4.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ n_fpu ?= 0

# Deactivate the XpulpIMG extension
xpulpimg ?= 0

# L2 Banks/Channels
l2_size ?= 4194304 # 400000
l2_banks ?= 4

# Number of DMA backends in each group
dmas_per_group ?= 1 # Brust Length = 16
7 changes: 7 additions & 0 deletions config/minpool_spatz4_fpu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@ rvf ?= 1

# Deactivate the XpulpIMG extension
xpulpimg ?= 0

# L2 Banks/Channels
l2_size ?= 4194304 # 400000
l2_banks ?= 4

# Number of DMA backends in each group
dmas_per_group ?= 1 # Brust Length = 16
Loading

0 comments on commit 105b064

Please sign in to comment.