Skip to content

Commit 071e44f

Browse files
authored
Merge branch 'ab/merge' into lg/fix_hwpe_subsys
2 parents 9e74601 + 861d02c commit 071e44f

21 files changed

+505
-331
lines changed

Bender.lock

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,6 @@ packages:
107107
Git: https://github.com/pulp-platform/fpu_div_sqrt_mvp.git
108108
dependencies:
109109
- common_cells
110-
fpu_interco:
111-
revision: b5f7a315929308823cacd81e1e4898f1eeecfc64
112-
version: null
113-
source:
114-
Git: https://github.com/pulp-platform/fpu_interco.git
115-
dependencies:
116-
- fpnew
117-
- riscv
118110
hci:
119111
revision: aed9005c761827c6cbff2ea9a15f9cc37acd1169
120112
version: null
@@ -209,7 +201,7 @@ packages:
209201
- axi_slice
210202
redmule:
211203
revision: 9223ccc932e21d0667e9c2d30831db41eec9299e
212-
version: null
204+
version:
213205
source:
214206
Git: https://github.com/pulp-platform/redmule.git
215207
dependencies:

Bender.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ dependencies:
2222
hier-icache: { git: "https://github.com/pulp-platform/hier-icache.git", rev: "2886cb2a46cea3e2bd2d979b505d88fadfbe150c" } # branch: astral
2323
cluster_icache: { git: "https://github.com/pulp-platform/cluster_icache.git", rev: "dd0e8f3497903a9ca99fc9f349d5a4f688ceb3ae" } # branch: michaero/astral_reliability
2424
cluster_peripherals: { git: "https://github.com/pulp-platform/cluster_peripherals.git", rev: 0b8e8ab } # branch: fc/hci-v2
25-
fpu_interco: { git: "https://github.com/pulp-platform/fpu_interco.git", rev: "b5f7a315929308823cacd81e1e4898f1eeecfc64" } # branch: astral
2625
axi: { git: "https://github.com/pulp-platform/axi.git", version: 0.39.3 }
2726
timer_unit: { git: "https://github.com/pulp-platform/timer_unit.git", version: 1.0.2 }
2827
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.35.0 }
@@ -34,9 +33,9 @@ dependencies:
3433
hci: { git: "https://github.com/pulp-platform/hci.git", rev: aed9005 } # branch: lg/ecc_fix_no_hwpe
3534
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.4.4 }
3635
redundancy_cells: { git: "https://github.com/pulp-platform/redundancy_cells.git", rev: 49e714b97a19a7aaddf064ae2757c8f02d1f62dc } # branch: astral-v0
37-
redmule: { git: "https://github.com/pulp-platform/redmule.git", rev: 9223ccc } # branch: astral-hci-v2.1
36+
redmule: { git: "https://github.com/pulp-platform/redmule.git", rev: astral-v1.0 }
3837
neureka: { git: "https://github.com/pulp-platform/neureka.git", rev: 94528df } # branch: fc/astral-v1.0-rebased
39-
softex: { git: "https://github.com/belanoa/softex.git" , rev: 11dd29e85d40e29fea0481b471f1c0cc967df1a4} # branch: hci_ecc
38+
softex: { git: "https://github.com/belanoa/softex.git" , rev: astral-v1.0 }
4039

4140
export_include_dirs:
4241
- include
@@ -80,6 +79,7 @@ sources:
8079
TRACE_EXECUTION: ~
8180
# Level 3
8281
- rtl/pulp_cluster.sv
82+
- rtl/pulp_cluster_wrap.sv
8383

8484
- target: test
8585
files:
@@ -91,3 +91,8 @@ sources:
9191
files:
9292
- include/pulp_interfaces.sv
9393

94+
- target: pulp_standalone_synth
95+
files:
96+
- nonfree/gf12/sourcecode/tc_sram.sv
97+
- nonfree/gf12/sourcecode/tc_clk.sv
98+

Makefile

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
ROOT_DIR = $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
66

7+
HOSTNAME := $(shell hostname)
8+
ETH_HOST = $(shell echo $(HOSTNAME) | grep -q "\.ee\.ethz\.ch$$" && echo 1 || echo 0)
9+
ifeq ($(ETH_HOST),1)
10+
QUESTA ?= questa-2023.4-zr
11+
else
712
QUESTA ?=
13+
endif
14+
815
BENDER ?= bender
916

1017
VSIM ?= $(QUESTA) vsim
@@ -19,12 +26,6 @@ REGRESSIONS := $(ROOT_DIR)/regression_tests
1926

2027
VLOG_ARGS += -suppress vlog-2583 -suppress vlog-13314 -suppress vlog-13233 -timescale \"1 ns / 1 ps\" \"+incdir+$(shell pwd)/include\"
2128

22-
##########
23-
# Bender #
24-
##########
25-
26-
include bender.mk
27-
2829
define generate_vsim
2930
echo 'set ROOT [file normalize [file dirname [info script]]/$3]' > $1
3031
$(BENDER) script vsim --vlog-arg="$(VLOG_ARGS)" $2 | grep -v "set ROOT" >> $1
@@ -74,7 +75,7 @@ sw-clean:
7475

7576
## Clone pulp-runtime as SW stack
7677
PULP_RUNTIME_REMOTE ?= https://github.com/pulp-platform/pulp-runtime.git
77-
PULP_RUNTIME_COMMIT ?= a5bc02e # branch: upstream-features
78+
PULP_RUNTIME_COMMIT ?= 272b0da # branch: upstream-features
7879

7980
pulp-runtime:
8081
git clone $(PULP_RUNTIME_REMOTE) $@
@@ -101,21 +102,22 @@ regression_tests:
101102
# Build and simulation #
102103
########################
103104

104-
.PHONY: sim_clean compile build run
105+
.PHONY: sim-clean compile build run
105106

106-
$(BENDER):
107-
curl --proto '=https' \
108-
--tlsv1.2 https://pulp-platform.github.io/bender/init -sSf | sh -s -- 0.24.0
109-
mv bender $(BENDER)
110-
111-
sim_clean:
107+
sim-clean:
112108
rm -rf scripts/compile.tcl
113109
rm -rf work
114110

111+
include bender-common.mk
112+
include bender-sim.mk
115113
scripts/compile.tcl: | Bender.lock
116-
$(call generate_vsim, $@, $(bender_defs) $(bender_targs),..)
114+
$(call generate_vsim, $@, $(common_defs) $(common_targs) $(sim_defs) $(sim_targs),..)
117115
echo 'vlog "$(realpath $(ROOT_DIR))/tb/dpi/elfloader.cpp" -ccflags "-std=c++11"' >> $@
118116

117+
include bender-synth.mk
118+
scripts/synth-compile.tcl: | Bender.lock
119+
$(BENDER) script synopsys $(common_targs) $(common_defs) $(synth_targs) $(synth_defs) > $@
120+
119121
$(library):
120122
$(QUESTA) vlib $(library)
121123

@@ -128,7 +130,7 @@ build: compile
128130
$(VOPT) $(compile_flag) -suppress 3053 -suppress 8885 -work $(library) $(top_level) -o $(top_level)_optimized +acc
129131

130132
run:
131-
$(VSIM) +permissive $(questa-flags) $(uvm-flags) $(QUESTASIM_FLAGS) $(questa-cmd) -suppress 3053 -suppress 8885 -lib $(library) +MAX_CYCLES=$(max_cycles) +UVM_TESTNAME=$(test_case) +APP=$(elf-bin) +notimingchecks +nospecify -t 1ps \
133+
$(VSIM) +permissive -suppress 3053 -suppress 8885 -lib $(library) +MAX_CYCLES=$(max_cycles) +UVM_TESTNAME=$(test_case) +APP=$(elf-bin) +notimingchecks +nospecify -t 1ps \
132134
${top_level}_optimized +permissive-off ++$(elf-bin) ++$(target-options) ++$(cl-bin) | tee sim.log
133135

134136
####################

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ not a complete overview of all signals, this is meant as a slightly more
1313
detailed overview that can assist in development. Please be aware that the
1414
schematic may not be 100% accurate.
1515

16+
## Dependencies
17+
18+
To *build* the cluster, you will need:
19+
20+
- Bender `>= 0.24.0`
21+
- GNU Make `>= 3.82`
22+
- Python `>= 3.9`
23+
- RISCV GCC `>= 11.2.0`
24+
25+
We use [Bender](https://github.com/pulp-platform/bender) for hardware IP and dependency management; for more information on using Bender, please see its documentation. You can install Bender directly through the Rust package manager Cargo:
26+
27+
```
28+
cargo install bender
29+
```
30+
1631
## Simulation
1732

1833
It is possible to run benchmarks on the cluster, either within
@@ -28,31 +43,25 @@ Warning: requires QuestaSim 2022.3 or newer.
2843
RISCV GCC toolchain](https://github.com/pulp-platform/pulp-riscv-gcc) to use
2944
a pre-built release. (At IIS, this is set up by the env script in step 4.)
3045

31-
2. We need RV64 toolchain to compile DPI libraries. To this purpose, export the
32-
RV64 toolchain to a `RISCV` env variable and also export your questa
33-
installation path to a `QUESTASIM_HOME` env variable. Please refer to [RISC-V
34-
GNU toolchain](https://github.com/riscv-collab/riscv-gnu-toolchain/) to use a
35-
pre-built RV64 toolchain release.
36-
37-
3. Compile the hw:
46+
2. Compile the hw:
3847
```
3948
make checkout
4049
make scripts/compile.tcl
4150
make build
4251
```
4352

44-
4. Download the sw stack and bare-metal tests:
53+
3. Download the sw stack and bare-metal tests:
4554
```
4655
make pulp-runtime
4756
make regression_tests
4857
```
4958

50-
5. Source the environment:
59+
4. Source the environment:
5160
```
5261
source env/env.sh
5362
```
5463

55-
6. Run the tests. Choose any test among the `parallel_bare_tests` and the
64+
5. Run the tests. Choose any test among the `parallel_bare_tests` and the
5665
`mchan_tests`, move into the related folder and do:
5766

5867
```

bender-common.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2023 ETH Zurich and University of Bologna
2+
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
5+
common_defs += -D FEATURE_ICACHE_STAT
6+
common_defs += -D PRIVATE_ICACHE
7+
common_defs += -D HIERARCHY_ICACHE_32BIT
8+
common_defs += -D ICAHE_USE_FF
9+
bender_defs += -D TRACE_EXECUTION
10+
common_defs += -D CLUSTER_ALIAS
11+
common_defs += -D USE_PULP_PARAMETERS
12+
13+
common_targs += -t rtl
14+
common_targs += -t mchan
15+
common_targs += -t cluster_standalone
16+
common_targs += -t scm_use_fpga_scm
17+
common_targs += -t cv32e40p_use_ff_regfile

bender-sim.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2023 ETH Zurich and University of Bologna
2+
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
5+
sim_defs += -D TRACE_EXECUTION
6+
7+
sim_targs += -t test

bender-synth.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2023 ETH Zurich and University of Bologna
2+
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
5+
synth_defs :=
6+
7+
synth_targs := -t pulp_standalone_synth

bender.mk

Lines changed: 0 additions & 19 deletions
This file was deleted.

env/astral-env.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@
55
# set up environment variables for rtl simulation, pulp-runtime and freertos
66
ROOTD=$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")/.." && pwd)
77

8-
# If at IIS, set up appropriate questa version.
9-
if test -f /etc/iis.version; then
10-
export QUESTA=questa-2023.4-zr
11-
fi
12-
13-
export QUESTA=questa-2023.4-zr
14-
export VLOG="$QUESTA vlog"
15-
export VLIB="$QUESTA vlib"
16-
export VMAP="$QUESTA vmap"
17-
export VCOM="$QUESTA vcom"
18-
export VOPT="$QUESTA vopt"
19-
export VSIM="$QUESTA vsim"
20-
export PULP_RUNTIME_GCC_TOOLCHAIN=/usr/pack/riscv-1.0-kgf/pulp-gcc-1.0.16
8+
if (hostname | grep -qE "\.ee\.ethz\.ch$") ; then
9+
export PULP_RUNTIME_GCC_TOOLCHAIN=/usr/pack/riscv-1.0-kgf/pulp-gcc-1.0.16
10+
end
2111

2212
source "$ROOTD/pulp-runtime/configs/astral-cluster.sh"
2313
source "$ROOTD/scripts/vsim.sh"

env/carfield-env.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@
55
# set up environment variables for rtl simulation, pulp-runtime and freertos
66
ROOTD=$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")/.." && pwd)
77

8-
# If at IIS, set up appropriate questa version.
9-
if test -f /etc/iis.version; then
10-
export QUESTA=questa-2023.4-zr
8+
if (hostname | grep -qE "\.ee\.ethz\.ch$") ; then
9+
export PULP_RUNTIME_GCC_TOOLCHAIN=/usr/pack/riscv-1.0-kgf/pulp-gcc-1.0.16
1110
fi
1211

13-
export QUESTA=questa-2023.4-zr
14-
export VLOG="$QUESTA vlog"
15-
export VLIB="$QUESTA vlib"
16-
export VMAP="$QUESTA vmap"
17-
export VCOM="$QUESTA vcom"
18-
export VOPT="$QUESTA vopt"
19-
export VSIM="$QUESTA vsim"
20-
export PULP_RUNTIME_GCC_TOOLCHAIN=/usr/pack/riscv-1.0-kgf/pulp-gcc-1.0.16
21-
2212
source "$ROOTD/pulp-runtime/configs/carfield-cluster.sh"
2313
source "$ROOTD/scripts/vsim.sh"

0 commit comments

Comments
 (0)