Skip to content

Commit 62b96bf

Browse files
committed
Revert "Merge pull request #57 from pulp-platform/revert-55-bender_integration"
This reverts commit 3c86456, reversing changes made to 7e44cc6.
1 parent 3c86456 commit 62b96bf

26 files changed

+379
-291
lines changed

.gitignore

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,14 @@
55
/sim/modelsim*
66
/sim/ncompile/*
77
!/sim/ncompile/build.mk
8-
/tests/*/
8+
/tests/*/
9+
/pulp-runtime
10+
/regression_tests
11+
12+
# Bender
13+
/bender
14+
/.bender
15+
/sim/compile.tcl
16+
/sim/transcript
17+
/sim/work
18+
/working_dir

.gitlab-ci.yml

+21-17
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ fetch_std:
4343
- cp -r regression_tests/hello/* regression_tests/hellohyper/
4444
- source setup/vsim.sh
4545
- echo "Fetching IPs"
46-
- ./update-ips
46+
- make checkout
4747
- echo "Fetching vips"
4848
- ./rtl/vip/get-vips.sh --yes --gitlab
4949
artifacts:
5050
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
5151
paths:
52-
- ips/*
52+
- .bender/*
53+
- bender
54+
- Bender.lock
5355
- sim/*
54-
- ipstools/*
55-
- .cached_ipdb.json
5656
- rtl/vip/*
5757
- regression_tests/*
5858

5959
b&t_rtl_std:
6060
stage: build_and_test
6161
before_script:
62-
- echo "Generate scripts with DPI and VIP support"
63-
- ./generate-scripts
62+
- echo "Generate scripts without DPI and VIP support"
63+
- make scripts
6464
- echo "Compiling RTL model and DPI libraries"
6565
- make build
6666
- echo "Fetching Runtime"
@@ -75,11 +75,12 @@ b&t_rtl_std:
7575
artifacts:
7676
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
7777
paths:
78+
- .bender/*
79+
- bender
80+
- Bender.lock
7881
- regression_tests/*
7982
- tests/*
80-
- ips/*
8183
- sim/*
82-
- ipstools/*
8384
- rtl/*
8485
reports:
8586
junit: regression_tests/simplified-runtime.xml
@@ -89,7 +90,7 @@ b&t_rtl_vip:
8990
stage: build_and_test_vips
9091
before_script:
9192
- echo "Generate scripts with DPI and VIP support"
92-
- ./generate-scripts --rt-dpi --i2c-vip --flash-vip --i2s-vip --hyper-vip --use-vip --verbose
93+
- make scripts-vips
9394
- echo "Compiling RTL model and DPI libraries"
9495
- make build
9596
- echo "Fetching Runtime"
@@ -104,10 +105,11 @@ b&t_rtl_vip:
104105
artifacts:
105106
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
106107
paths:
108+
- .bender/*
109+
- bender
110+
- Bender.lock
107111
- regression_tests/*
108-
- ips/*
109112
- sim/*
110-
- ipstools/*
111113
- rtl/*
112114
reports:
113115
junit: regression_tests/simplified-periph-runtime.xml
@@ -116,7 +118,7 @@ b&t_rtl_boot:
116118
stage: build_and_test_boot
117119
before_script:
118120
- echo "Generate scripts with DPI and VIP support"
119-
- ./generate-scripts --rt-dpi --i2c-vip --flash-vip --i2s-vip --hyper-vip --use-vip --verbose
121+
- make scripts-vips
120122
- echo "Compiling RTL model and DPI libraries"
121123
- make build
122124
- echo "Fetching Runtime"
@@ -131,10 +133,11 @@ b&t_rtl_boot:
131133
artifacts:
132134
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
133135
paths:
136+
- .bender/*
137+
- bender
138+
- Bender.lock
134139
- regression_tests/*
135-
- ips/*
136140
- sim/*
137-
- ipstools/*
138141
- rtl/*
139142
reports:
140143
junit: regression_tests/boot-runtime.xml
@@ -144,7 +147,7 @@ b&t_rtl_psram:
144147
stage: build_and_test_psram
145148
before_script:
146149
- echo "Generate scripts with DPI and VIP support"
147-
- ./generate-scripts --psram-vip
150+
- make scripts-psram
148151
- echo "Compiling RTL model and DPI libraries"
149152
- make build
150153
- echo "Fetching Runtime"
@@ -159,10 +162,11 @@ b&t_rtl_psram:
159162
artifacts:
160163
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
161164
paths:
165+
- .bender/*
166+
- bender
167+
- Bender.lock
162168
- regression_tests/*
163-
- ips/*
164169
- sim/*
165-
- ipstools/*
166170
- rtl/*
167171
reports:
168172
junit: regression_tests/simplified-psram-runtime.xml

Bender.yml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
package:
2+
name: pulp
3+
authors:
4+
- "Robert Balas <[email protected]>"
5+
- "Germain Haugou <[email protected]>"
6+
- "Angelo Garofalo <[email protected]>"
7+
- "Michael Rogenmoser <[email protected]>"
8+
- "Pasquale Davide Schiavone <[email protected]>"
9+
- "Antonio Pullini <[email protected]>"
10+
- "Francesco Conti <[email protected]>"
11+
12+
dependencies:
13+
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.22.1 }
14+
tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.5 }
15+
jtag_pulp: { git: "https://github.com/pulp-platform/jtag_pulp.git", rev: "v0.1" }
16+
pulp_soc: { git: "https://github.com/pulp-platform/pulp_soc.git", version: 3.0.0 }
17+
pulp_cluster: { git: "https://github.com/pulp-platform/pulp_cluster.git", rev: "e71ff80ab1e661a1ba4df78eceae42caeec074ad" }
18+
tbtools: { git: "https://github.com/pulp-platform/tbtools.git", version: 0.2.1 }
19+
20+
export_include_dirs:
21+
- rtl/includes
22+
23+
sources:
24+
# Source files grouped in levels. Files in level 0 have no dependencies on files in this
25+
# package. Files in level 1 only depend on files in level 0, files in level 2 on files in
26+
# levels 1 and 0, etc. Files within a level are ordered alphabetically.
27+
# Level 0
28+
# Open models
29+
- target: any(test,simulation)
30+
files:
31+
- rtl/vip/spi_master_padframe.sv
32+
- rtl/vip/uart_tb_rx.sv
33+
- rtl/vip/camera/cam_vip.sv
34+
35+
# S25FS256_model (SPI Flash)
36+
- target: all(any(test,simulation), flash_vip)
37+
defines:
38+
SPEEDSIM: ~
39+
files:
40+
- rtl/vip/spi_flash/S25fs256s/model/s25fs256s.v
41+
42+
# 24FC1025 model (I2C flash)
43+
- target: all(any(test,simulation), i2c_vip)
44+
defines:
45+
SPEEDSIM: ~
46+
files:
47+
- rtl/vip/i2c_eeprom/24FC1025.v
48+
49+
# hyper models
50+
- target: all(any(test,simulation), hyper_vip)
51+
defines:
52+
SPEEDSIM: ~
53+
files:
54+
- rtl/vip/hyperflash_model/s26ks512s.v
55+
- rtl/vip/hyperram_model/s27ks0641.v
56+
57+
# psram model
58+
- target: all(any(test, simulation), psram_vip)
59+
defines:
60+
SPEEDSIM: ~
61+
files:
62+
- rtl/vip/psram_model/*.vp_modelsim
63+
64+
# i2s model
65+
- target: all(any(test,simulation), i2s_vip)
66+
defines:
67+
SPEEDSIM: ~
68+
files:
69+
- rtl/vip/i2s/i2c_if.v
70+
- rtl/vip/i2s/i2s_vip_channel.sv
71+
- rtl/vip/i2s/i2s_vip.sv
72+
73+
- rtl/pulp/cluster_domain.sv
74+
- rtl/pulp/jtag_tap_top.sv
75+
- rtl/pulp/pad_control.sv
76+
- rtl/pulp/pad_frame.sv
77+
- rtl/pulp/rtc_clock.sv
78+
- rtl/pulp/rtc_date.sv
79+
- rtl/pulp/soc_domain.sv
80+
# Level 1
81+
- rtl/pulp/safe_domain.sv
82+
# Level 2
83+
- rtl/pulp/pulp.sv
84+
85+
# TB
86+
- target: any(test, simulation)
87+
files:
88+
# TB Level 0
89+
- rtl/tb/riscv_pkg.sv
90+
- rtl/tb/SimDTM.sv
91+
- rtl/tb/SimJTAG.sv
92+
- rtl/tb/tb_clk_gen.sv
93+
- rtl/tb/tb_fs_handler.sv
94+
# TB Level 1
95+
- rtl/tb/jtag_pkg.sv
96+
# TB Level 2
97+
- rtl/tb/pulp_tap_pkg.sv
98+
# TB Level 3
99+
- rtl/tb/tb_pulp.sv

Makefile

+101-7
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,102 @@ $(foreach file, $(INSTALL_FILES), $(eval $(call declareInstallFile,$(file))))
3131

3232
BRANCH ?= master
3333

34+
VLOG_ARGS += -suppress 2583 -suppress 13314
35+
BENDER_SIM_BUILD_DIR = sim
36+
BENDER_FPGA_SCRIPTS_DIR = fpga/pulp/tcl/generated
37+
38+
.PHONY: checkout
39+
ifndef IPAPPROX
40+
checkout: bender
41+
./bender update
42+
touch Bender.lock
43+
44+
Bender.lock: bender
45+
./bender update
46+
touch Bender.lock
47+
48+
else
3449
checkout:
3550
./update-ips
51+
endif
52+
$(MAKE) scripts
3653

3754
# generic clean and build targets for the platform
55+
.PHONY: clean
3856
clean:
39-
rm -rf $(VSIM_PATH)
40-
cd sim && $(MAKE) clean
41-
57+
$(MAKE) -C sim IPAPPROX=$(IPAPPROX) clean
58+
59+
60+
.PHONY: scripts
61+
## Generate scripts for all tools
62+
ifndef IPAPPROX
63+
scripts: scripts-bender-vsim # scripts-bender-fpga
64+
65+
scripts-bender-vsim: | Bender.lock
66+
echo 'set ROOT [file normalize [file dirname [info script]]/..]' > $(BENDER_SIM_BUILD_DIR)/compile.tcl
67+
./bender script vsim \
68+
--vlog-arg="$(VLOG_ARGS)" --vcom-arg="" \
69+
-t rtl -t test \
70+
| grep -v "set ROOT" >> $(BENDER_SIM_BUILD_DIR)/compile.tcl
71+
72+
# scripts-bender-fpga: | Bender.lock
73+
# mkdir -p fpga/pulp/tcl/generated
74+
# ./bender script vivado -t fpga -t xilinx > $(BENDER_FPGA_SCRIPTS_DIR)/compile.tcl
75+
76+
$(BENDER_SIM_BUILD_DIR)/compile.tcl: Bender.lock
77+
echo 'set ROOT [file normalize [file dirname [info script]]/..]' > $(BENDER_SIM_BUILD_DIR)/compile.tcl
78+
./bender script vsim \
79+
--vlog-arg="$(VLOG_ARGS)" --vcom-arg="" \
80+
-t rtl -t test \
81+
| grep -v "set ROOT" >> $(BENDER_SIM_BUILD_DIR)/compile.tcl
82+
83+
scripts-bender-vsim-vips: | Bender.lock
84+
echo 'set ROOT [file normalize [file dirname [info script]]/..]' > $(BENDER_SIM_BUILD_DIR)/compile.tcl
85+
./bender script vsim \
86+
--vlog-arg="$(VLOG_ARGS)" --vcom-arg="" \
87+
-t rtl -t test -t rt_dpi -t i2c_vip -t flash_vip -t i2s_vip -t hyper_vip -t use_vips \
88+
| grep -v "set ROOT" >> $(BENDER_SIM_BUILD_DIR)/compile.tcl
89+
90+
scripts-bender-vsim-psram: | Bender.lock
91+
echo 'set ROOT [file normalize [file dirname [info script]]/..]' > $(BENDER_SIM_BUILD_DIR)/compile.tcl
92+
./bender script vsim \
93+
--vlog-arg="$(VLOG_ARGS)" --vcom-arg="" \
94+
-t rtl -t test -t psram_vip \
95+
| grep -v "set ROOT" >> $(BENDER_SIM_BUILD_DIR)/compile.tcl
96+
97+
else
98+
scripts:
99+
./generate-scripts
100+
endif
101+
102+
scripts-vips:
103+
ifndef IPAPPROX
104+
$(MAKE) scripts-bender-vsim-vips
105+
else
106+
./generate-scripts --rt-dpi --i2c-vip --flash-vip --i2s-vip --hyper-vip --use-vip --verbose
107+
endif
108+
109+
scripts-psram:
110+
ifndef IPAPPROX
111+
$(MAKE) scripts-bender-vsim-psram
112+
else
113+
./generate-scripts --psram-vip
114+
endif
115+
116+
.PHONY: build
117+
## Build the RTL model for vsim
118+
ifndef IPAPPROX
119+
build: $(BENDER_SIM_BUILD_DIR)/compile.tcl
120+
@test -f Bender.lock || { echo "ERROR: Bender.lock file does not exist. Did you run make checkout in bender mode?"; exit 1; }
121+
@test -f $(BENDER_SIM_BUILD_DIR)/compile.tcl || { echo "ERROR: sim/compile.tcl file does not exist. Did you run make scripts in bender mode?"; exit 1; }
122+
$(MAKE) -C sim all
123+
cp -r rtl/tb/* $(VSIM_PATH)
124+
else
42125
build:
43-
# cd sim && $(MAKE) lib build opt
44-
# cp -r rtl/tb/* $(VSIM_PATH)
45-
cd sim && $(MAKE) clean all
126+
@[ "$$(ls -A ips/)" ] || { echo "ERROR: ips/ is an empty directory. Did you run ./update-ips?"; exit 1; }
127+
$(MAKE) -C sim IPAPPROX=$(IPAPPROX) all
128+
cp -r rtl/tb/* $(VSIM_PATH)
129+
endif
46130

47131
# sdk specific targets
48132
install: $(INSTALL_HEADERS)
@@ -91,7 +175,7 @@ sdk-gitlab:
91175

92176
# simplified runtime for PULP that doesn't need the sdk
93177
pulp-runtime:
94-
git clone https://github.com/pulp-platform/pulp-runtime.git -b v0.0.4
178+
git clone https://github.com/pulp-platform/pulp-runtime.git -b v0.0.11
95179

96180
# the gitlab runner needs a special configuration to be able to access the
97181
# dependent git repositories
@@ -162,3 +246,13 @@ test-local-runtime:
162246
source pulp-runtime/configs/pulp.sh; \
163247
cd tests && ../pulp-runtime/scripts/bwruntests.py --proc-verbose -v --report-junit -t 600 --yaml -o simplified-runtime.xml runtime-tests.yaml
164248

249+
bender:
250+
ifeq (,$(wildcard ./bender))
251+
curl --proto '=https' --tlsv1.2 -sSf https://pulp-platform.github.io/bender/init \
252+
| bash -s -- 0.22.0
253+
touch bender
254+
endif
255+
256+
.PHONY: bender-rm
257+
bender-rm:
258+
rm -f bender

0 commit comments

Comments
 (0)