Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ packages:
- common_cells
- common_verification
- tech_cells_generic
axi_stream:
revision: 54891ff40455ca94a37641b9da4604647878cc07
version: 0.1.1
source:
Git: https://github.com/pulp-platform/axi_stream.git
dependencies:
- common_cells
axi2mem:
revision: be0c696709acaee579787ba2432d26ad27640594
version: 1.0.2
Expand Down Expand Up @@ -62,10 +69,10 @@ packages:
dependencies:
- common_cells
cluster_peripherals:
revision: e464eb9ddcc39e5a50009819601c4f213b1d4ba3
version: 2.2.0
revision: 630159c9d81c41a9638163de292fbfc0682bf0e5
version: null
source:
Git: https://github.com/pulp-platform/cluster_peripherals.git
Git: https://github.com/FondazioneChipsIT/cluster_peripherals.git
dependencies:
- hci
common_cells:
Expand Down Expand Up @@ -178,11 +185,19 @@ packages:
source:
Git: https://github.com/pulp-platform/icache-intc.git
dependencies: []
obi:
revision: c2141a653c755461ff44f61d12aeb5d99fc8e760
version: 0.1.3
source:
Git: https://github.com/pulp-platform/obi.git
dependencies:
- common_cells
- common_verification
idma:
revision: c12caf59bb482fe44b27361f6924ad346b2d22fe
version: 0.6.3
revision: 2e637216e0455d77706a50d0639b86891e2a83aa
version: null
source:
Git: https://github.com/pulp-platform/iDMA.git
Git: https://github.com/FondazioneChipsIT/iDMA.git
dependencies:
- axi
- axi_stream
Expand All @@ -204,7 +219,7 @@ packages:
dependencies:
- common_cells
neureka:
revision: f4e131c86205d37882cf02ea4dd3bd141ef32d86
revision: 2e076f7d25cdfba38821ee95595bb27aec53c764
version: null
source:
Git: https://github.com/pulp-platform/neureka.git
Expand All @@ -230,8 +245,8 @@ packages:
dependencies:
- axi_slice
redmule:
revision: 78696fb0d6d429bdad2e38740792648d44095605
version: 2.0.4
revision: dbcba6b1efda24dc909ebdd4ace132f798c8c12b
version: null
source:
Git: https://github.com/pulp-platform/redmule.git
dependencies:
Expand Down
23 changes: 12 additions & 11 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ dependencies:
per2axi: { git: "https://github.com/pulp-platform/per2axi.git", rev: v1.0.5 }
cluster_interconnect: { git: "https://github.com/pulp-platform/cluster_interconnect.git", rev: v1.3.0 }
event_unit_flex: { git: "https://github.com/pulp-platform/event_unit_flex.git", rev: astral-v1.0 }
mchan: { git: "https://github.com/pulp-platform/mchan.git", rev: v1.2.4 }
idma: { git: "https://github.com/pulp-platform/iDMA.git", rev: v0.6.3 }
hier-icache: { git: "https://github.com/pulp-platform/hier-icache.git", rev: v1.3.0 }
cluster_icache: { git: "https://github.com/pulp-platform/cluster_icache.git", rev: v0.2.0 }
cluster_peripherals: { git: "https://github.com/pulp-platform/cluster_peripherals.git", rev: v2.2.0 }
axi: { git: "https://github.com/pulp-platform/axi.git", version: 0.39.3 }
timer_unit: { git: "https://github.com/pulp-platform/timer_unit.git", version: 1.0.2 }
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.35.0 }
tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.3 }
flex-v: { git: "https://github.com/pulp-platform/flex-v.git", rev: astral-v1.1 }
mchan: { git: "https://github.com/pulp-platform/mchan.git", version: =1.2.4 }
idma: { git: "https://github.com/FondazioneChipsIT/iDMA.git", rev: ChipsIt-v0.0.0 }
obi: { git: "https://github.com/pulp-platform/obi.git", version: =0.1.7 }
hier-icache: { git: "https://github.com/FondazioneChipsIT/hier-icache.git", rev: 416c5cbc7b9b8724a40da6ac6d0b19a9c6b864bc } # gl/fix_define
cluster_icache: { git: "https://github.com/FondazioneChipsIT/cluster_icache.git", rev: 57ffb22066171d89974bdec240bad13f5efac9de } # gl/fix_define
cluster_peripherals: { git: "https://github.com/FondazioneChipsIT/cluster_peripherals.git", rev: "630159c9d81c41a9638163de292fbfc0682bf0e5" } # chips-it
axi: { git: "https://github.com/pulp-platform/axi.git", version: =0.39.8 }
timer_unit: { git: "https://github.com/pulp-platform/timer_unit.git", version: =1.0.2 }
common_cells: { git: "https://github.com/FondazioneChipsIT/common_cells.git", rev: 286ffd49d9ed3409ceaef7c7fe98516e2611a1a9 } # gl/fix_define
tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: =0.2.3 }
flex-v: { git: "https://github.com/FondazioneChipsIT/flex-v.git", rev: f22937733fd058550ef847ddbf1381e821f0f9d2 } # gl/fix_pkg_import
cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: astral-v1.0 }
ibex: { git: "https://github.com/pulp-platform/ibex.git", rev: "pulpissimo-v6.1.2" }
scm: { git: "https://github.com/pulp-platform/scm.git", rev: v1.2.0 }
Expand Down Expand Up @@ -56,7 +57,7 @@ sources:
- target: mchan
files:
- rtl/mchan_wrap.sv
- target: not(mchan)
- target: idma
files:
- rtl/idma_wrap.sv
- rtl/hwpe_subsystem.sv
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.0.0
### Added
* iDMA: integrated iDMA wrap supporting up to 3D transfers with 2 physical channels and parametric burst length

### Fixed
* Testbench: fixed timeunit to ns and change clock to 500 MHz

## [Unreleased]
### Added
- Added `CHANGELOG.md`
Expand Down
73 changes: 60 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@ BENDER ?= bender
VSIM ?= $(QUESTA) vsim
VOPT ?= $(QUESTA) vopt
VLIB ?= $(QUESTA) vlib
top_level ?= pulp_cluster_tb

QSIM ?= $(QUESTA) qsim
QOPT ?= $(QUESTA) qopt
Q1VE ?= q1ve --qverify

VENV := venv

top_level ?= pulp_cluster
library ?= work
elf-bin ?= stimuli.riscv
bwruntest = $(ROOT_DIR)/pulp-runtime/scripts/bwruntests.py

REGRESSIONS := $(ROOT_DIR)/regression_tests

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

define generate_vsim
echo 'set ROOT [file normalize [file dirname [info script]]/$3]' > $1
Expand All @@ -37,7 +45,7 @@ endef
######################

NONFREE_REMOTE ?= git@iis-git.ee.ethz.ch:pulp-restricted/pulp-cluster-nonfree.git
NONFREE_COMMIT ?= beb98ce
NONFREE_COMMIT ?= aad59d36bfef6b74f03ffed28903a44cb86b9497

nonfree-init:
git clone $(NONFREE_REMOTE) nonfree
Expand All @@ -49,14 +57,13 @@ nonfree-init:

.PHONY: init

init: checkout
init: checkout generate_idma_rtl scripts/compile.tcl

.PHONY: checkout
## Checkout/update dependencies using Bender
checkout:
$(BENDER) checkout
touch Bender.lock
make scripts/compile.tcl

Bender.lock:
$(BENDER) checkout
Expand All @@ -74,8 +81,8 @@ sw-clean:
@rm -rf pulp-runtime fault_injection_sim regression_tests

## Clone pulp-runtime as SW stack
PULP_RUNTIME_REMOTE ?= https://github.com/pulp-platform/pulp-runtime.git
PULP_RUNTIME_COMMIT ?= f10670b # branch: lg/upstream
PULP_RUNTIME_REMOTE ?= https://github.com/FondazioneChipsIT/pulp-runtime.git
PULP_RUNTIME_COMMIT ?= 483c17a805b897552629e112a86ae8f23b60fb77 # branch: rg/update_runtime

pulp-runtime:
git clone $(PULP_RUNTIME_REMOTE) $@
Expand All @@ -90,8 +97,8 @@ fault_injection_sim:
cd $@ && git checkout $(FAULT_SIM_COMMIT)

## Clone regression tests
REGRESSION_TESTS_REMOTE ?= https://github.com/pulp-platform/regression_tests.git
REGRESSION_TESTS_COMMIT ?= 7fa307d # branch: lg/upstream
REGRESSION_TESTS_REMOTE ?= https://github.com/FondazioneChipsIT/regression_tests.git
REGRESSION_TESTS_COMMIT ?= 7316445ee9d9a9fbacc5b0102ce304f100c2331f # branch: rg/pulp_cluster_pr

regression_tests:
git clone $(REGRESSION_TESTS_REMOTE) $@
Expand All @@ -111,27 +118,67 @@ sim-clean:
include bender-common.mk
include bender-sim.mk
scripts/compile.tcl: | Bender.lock
$(call generate_vsim, $@, $(common_defs) $(common_targs) $(sim_defs) $(sim_targs),..)
$(call generate_vsim, $@, $(common_defs) $(common_targs) -t idma $(sim_defs) $(sim_targs),..)
echo 'vlog "$(realpath $(ROOT_DIR))/tb/dpi/elfloader.cpp" -ccflags "-std=c++11"' >> $@

scripts/compile.tcl-mchan: | Bender.lock
$(call generate_vsim, scripts/compile.tcl, $(common_defs) $(common_targs) -t mchan $(sim_defs) $(sim_targs),..)
echo 'vlog "$(realpath $(ROOT_DIR))/tb/dpi/elfloader.cpp" -ccflags "-std=c++11"' >> scripts/compile.tcl

include bender-synth.mk
scripts/synth-compile.tcl: | Bender.lock
$(BENDER) script synopsys $(common_targs) $(common_defs) $(synth_targs) $(synth_defs) > $@

scripts/compile_lint.tcl:
echo 'set ROOT $(ROOT_DIR)' > $@
$(BENDER) script vsim --vlog-arg="$(VLOG_ARGS_LINT)" $(common_defs) $(common_targs) | grep -v "set ROOT" >> $@
echo >> $@

$(library):
$(QUESTA) vlib $(library)

venv:
python3 -m venv $(VENV) && \
$(VENV)/bin/python -m pip install -U pip && \
$(VENV)/bin/python -m pip install -r $(shell bender path idma)/requirements.txt

generate_idma_rtl: venv
. "$(VENV)/bin/activate" && $(MAKE) -C $(shell bender path idma) idma_hw_all

compile: $(library)
@test -f Bender.lock || { echo "ERROR: Bender.lock file does not exist. Did you run make checkout in bender mode?"; exit 1; }
@test -f scripts/compile.tcl || { echo "ERROR: scripts/compile.tcl file does not exist. Did you run make scripts in bender mode?"; exit 1; }
$(VSIM) -c -do 'quit -code [source scripts/compile.tcl]'

build: compile
$(VOPT) $(compile_flag) -suppress 3053 -suppress 8885 -work $(library) $(top_level) -o $(top_level)_optimized +acc
build_qone: compile
$(QOPT) $(compile_flag) -debug +designfile -suppress 3053 -suppress 8885 -work $(library) $(top_level)_tb -o $(top_level)_tb_optimized


build: generate_idma_rtl compile
$(VOPT) $(compile_flag) -suppress 3053 -suppress 8885 -work $(library) $(top_level)_tb -o $(top_level)_tb_optimized +acc

compile_lint: $(library)
@test -f Bender.lock || { echo "ERROR: Bender.lock file does not exist. Did you run make checkout in bender mode?"; exit 1; }
@test -f scripts/compile_lint.tcl || { echo "ERROR: scripts/compile_lint.tcl file does not exist. Did you run make scripts in bender mode?"; exit 1; }
$(Q1VE) -od lint/comp_lint_results -c -do " \
onerror {exit}; \
do scripts/compile_lint.tcl; \
exit"

lint: compile_lint
$(Q1VE) -od lint/lint_results -c -do " \
lint methodology ip -goal release; \
lint run -d $(top_level); \
exit"

cdc: compile_lint
$(Q1VE) -od cdc_results -c -do " \
cdc run -d $(top_level); \
exit"

run:
$(VSIM) +permissive -suppress 3053 -suppress 8885 -lib $(library) +MAX_CYCLES=$(max_cycles) +UVM_TESTNAME=$(test_case) +APP=$(elf-bin) +notimingchecks +nospecify -t 1ps \
${top_level}_optimized +permissive-off ++$(elf-bin) ++$(target-options) ++$(cl-bin) | tee sim.log
${top_level}_tb_optimized +permissive-off ++$(elf-bin) ++$(target-options) ++$(cl-bin) | tee sim.log

####################
# Regression tests #
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ We use [Bender](https://github.com/pulp-platform/bender) for hardware IP and dep
cargo install bender
```

## Simulation
## QuestaSim Simulation

It is possible to run benchmarks on the cluster, either within
[PULP](https://github.com/pulp-platform/pulp) or as a separate IP. For
Expand Down Expand Up @@ -68,3 +68,21 @@ Warning: requires QuestaSim 2022.3 or newer.
```

To use the GUI, add `gui=1` to the previous command.

## QuestaOne Simulation

To simulate with the new QuestaOne flow, follow the previous steps up to the `make pulp-runtime` command, then:

1. Run the following from the pulp cluster root directory:
```
make build_qone
```

2. Go to the desired test directory in regression_tests and run the following:
```
make clean all run_qone
```
or:
```
make clean all run_qone gui=1
```
1 change: 0 additions & 1 deletion bender-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ common_defs += -D CLUSTER_ALIAS
common_defs += -D USE_PULP_PARAMETERS

common_targs += -t rtl
common_targs += -t mchan
common_targs += -t cluster_standalone
common_targs += -t scm_use_fpga_scm
common_targs += -t cv32e40p_use_ff_regfile
2 changes: 2 additions & 0 deletions bender-synth.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

synth_defs :=

# Don't add the following for linting
synth_targs := -t pulp_standalone_synth
synth_targs += -t idma
19 changes: 8 additions & 11 deletions packages/pulp_cluster_package.sv
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ package pulp_cluster_package;
NumCores: NumCores,
DmaNumPlugs: NumDmas,
DmaNumOutstandingBursts: 8,
DmaBurstLength: 256,
DmaBurstLength: 5, // Means bursts of 256 bytes: passed as 256 to mchan top, later computed inside iDMA
NumMstPeriphs: NB_MPERIPHS,
NumSlvPeriphs: NB_SPERIPHS,
ClusterAlias: 1,
Expand All @@ -227,9 +227,9 @@ package pulp_cluster_package;
HMRTmrFIxed: 0,
HMRInterleaveGrps: 1,
HMREnableRapidRecovery: 1,
HMRSeparateDataVoters:1,
HMRSeparateAxiBus:0,
HMRNumBusVoters:1,
HMRSeparateDataVoters: 1,
HMRSeparateAxiBus: 0,
HMRNumBusVoters: 1,
EnableECC: 1,
ECCInterco: 1,
iCacheNumBanks: 2,
Expand All @@ -240,19 +240,16 @@ package pulp_cluster_package;
iCachePrivateDataWidth: 32,
EnableReducedTag: 1,
L2Size: 1000*1024,
DmBaseAddr: 'h1A110000,
BootRomBaseAddr: 'h1A000000,
BootAddr: 'h1C000000,
DmBaseAddr: 'h60203000,
BootRomBaseAddr: 'h1C008080,
BootAddr: 'h1C008080,
EnablePrivateFpu: 1,
EnablePrivateFpDivSqrt: 0,
EnableSharedFpu: 0,
EnableSharedFpDivSqrt: 0,
NumSharedFpu: 0,
NumAxiIn: NumAxiSubordinatePorts,
NumAxiOut: NumAxiManagerPorts,
AxiIdInWidth: AxiSubordinateIdwidth,
AxiIdOutWidth:AxiManagerIdwidth,
AxiAddrWidth: 48,
AxiAddrWidth: 32,
AxiDataInWidth: 64,
AxiDataOutWidth: 64,
AxiUserWidth: 10,
Expand Down
Loading
Loading