Skip to content

Commit 235b47b

Browse files
authored
ci: Add elaboration flow in internal CI (#13)
* pd: Pull in internal physical design repository * hw: Fix NoC connection indexing * hw: Split memory macros in L2 mem tile * ci: Move name to make run a preqequisite for merging * hw: Restructure the mem tile * tb: Disable fast preloading Does not work anymore with split SRAM macros * tb: Use Slink as default preload mode * make: Include PD makefrag * ci: Test internal PD CI * ci: Make pd CI part of the build stage * ci: Artifact `ci.yml` file * REVERT: disable simulations * Trigger CI * Revert "Trigger CI" This reverts commit 0f8559c. * make: Fix `hw-all` target * Revert "Revert "Trigger CI"" This reverts commit 2f50479. * Revert "Revert "Revert "Trigger CI""" This reverts commit 1fce560. * make: Add python-venv build target * make: Use python venv to build sources * ci: Install and cache virtual environment * ci: Combine init jobs * ci: Debug python path * ci: Clean up * deps: Bump floo_noc * ci: Clean up * Revert "REVERT: disable simulations" This reverts commit 26d1308. * ci: Run pd flow in init stage * ci: Run subpipe independent of other stages * ci: Set build stage for pd CI * ci: Use cached dependencies for simulation job * make: Enforce copying over the plic configuration * ci: Use cache deps also for `init-pd` * deps: Bump cheshire * ci: Check for vsim compile errors * deps: Bump cheshire * cfg: Increase number of Serial Link lanes * pd: Fix PD commit for CI
1 parent 49f41ef commit 235b47b

12 files changed

+496
-74
lines changed

.github/workflows/gitlab-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ on:
1414

1515
jobs:
1616
check:
17+
name: Mirror and check
1718
runs-on: ubuntu-latest
1819
steps:
19-
- name: Mirror and check
20-
uses: pulp-platform/pulp-actions/[email protected]
20+
- uses: pulp-platform/pulp-actions/[email protected]
2121
# Skip on forks or pull requests from forks due to missing secrets.
2222
if: >
2323
github.repository == 'pulp-platform/picobello' &&

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@
77
# Dependency files
88
.bender
99

10+
# Python virtual environment
11+
.venv
12+
1013
# Generated source files
1114
.generated
1215

16+
# Physical design repository
17+
pd
18+
1319
# Software
1420
*build
1521

.gitlab-ci.yml

+65-26
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,51 @@ variables:
99
LLVM_BINROOT: /usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin
1010

1111
stages:
12+
- init
1213
- build
1314
- run
1415

15-
default:
16+
.cache-deps:
1617
cache:
1718
key:
1819
files:
1920
- Bender.lock
2021
paths:
2122
- .bender
23+
- .venv
2224
policy: pull
2325

24-
##########################
25-
# Bender collect sources #
26-
##########################
26+
##################
27+
# Initialization #
28+
##################
2729

28-
bender-collect-sources:
29-
stage: build
30+
init-deps:
31+
stage: init
3032
script:
33+
# Collect bender sourcess
3134
- bender checkout
35+
# Install the python venv
36+
- make python-venv
3237
cache:
3338
key:
3439
files:
3540
- Bender.lock
3641
paths:
3742
- .bender
43+
- .venv
3844
policy: pull-push
3945

40-
41-
###############################
42-
# Install Python dependencies #
43-
###############################
44-
45-
.install-py-deps:
46-
before_script:
47-
- bender checkout
48-
- $PYTHON -m venv .venv
49-
- source .venv/bin/activate
50-
- python -m pip install $(bender path floo_noc)
51-
- python -m pip install $(bender path snitch_cluster)
52-
- python -m pip install -r $(bender path cheshire)/requirements.txt
53-
5446
########################
5547
# Build Software Tests #
5648
########################
5749

5850
snrt-sw:
5951
stage: build
6052
extends:
61-
- .install-py-deps
53+
- .cache-deps
6254
script:
55+
- make python-venv
56+
- source .venv/bin/activate
6357
- make snrt-tests
6458
artifacts:
6559
paths:
@@ -69,26 +63,47 @@ snrt-sw:
6963
chs-sw:
7064
stage: build
7165
extends:
72-
- .install-py-deps
66+
- .cache-deps
7367
script:
68+
- make python-venv
69+
- source .venv/bin/activate
7470
- make chs-sw-tests
7571
artifacts:
7672
paths:
7773
- sw/cheshire/tests/*.elf
7874
expire_in: 1 day
7975

76+
########################
77+
# Generate RTL Sources #
78+
########################
79+
80+
generate-rtl:
81+
stage: build
82+
extends:
83+
- .cache-deps
84+
script:
85+
- make python-venv
86+
- source .venv/bin/activate
87+
- make picobello-hw-all
88+
artifacts:
89+
paths:
90+
- .bender
91+
- .generated
92+
expire_in: 1 day
93+
8094
#####################
8195
# Build Simulations #
8296
#####################
8397

8498
vsim-compile:
8599
stage: build
86-
extends:
87-
- .install-py-deps
100+
needs:
101+
- generate-rtl
88102
variables:
89103
FLOO_GEN_ARGS: --no-format
90104
script:
91-
- make vsim-compile
105+
- make vsim-compile | tee compile.log 2>&1
106+
- '! grep "\*\* Error" compile.log'
92107
artifacts:
93108
paths:
94109
- target/sim/vsim/work
@@ -112,12 +127,13 @@ vsim-compile:
112127
- { CHS_BINARY: $CHS_BUILD_DIR/helloworld.spm.elf, USTR: "Hello World!" }
113128
- { CHS_BINARY: $CHS_BUILD_DIR/simple_offload.spm.elf, SN_BINARY: $SN_BUILD_DIR/simple.elf, PRELMODE: 0 }
114129
- { CHS_BINARY: $CHS_BUILD_DIR/simple_offload.spm.elf, SN_BINARY: $SN_BUILD_DIR/simple.elf, PRELMODE: 1 }
115-
- { CHS_BINARY: $CHS_BUILD_DIR/simple_offload.spm.elf, SN_BINARY: $SN_BUILD_DIR/simple.elf, PRELMODE: 3 }
130+
# - { CHS_BINARY: $CHS_BUILD_DIR/simple_offload.spm.elf, SN_BINARY: $SN_BUILD_DIR/simple.elf, PRELMODE: 3 }
116131
- { CHS_BINARY: $CHS_BUILD_DIR/simple_offload.spm.elf, SN_BINARY: $SN_BUILD_DIR/non_null_exitcode.elf, NZ_EXIT_CODE: 224 }
117132

118133
sim-vsim:
119134
stage: run
120135
extends:
136+
- .cache-deps
121137
- .sw-tests
122138
variables:
123139
LOG_FILE: target/sim/vsim/transcript
@@ -139,3 +155,26 @@ sim-vsim:
139155
artifacts:
140156
paths:
141157
- transcript
158+
159+
###################
160+
# Physical Design #
161+
###################
162+
163+
init-pd:
164+
stage: init
165+
extends:
166+
- .cache-deps
167+
script: make init-pd
168+
artifacts:
169+
paths:
170+
- pd/ci.yml
171+
172+
subpipe:
173+
stage: build
174+
needs:
175+
- init-pd
176+
trigger:
177+
include:
178+
- artifact: pd/ci.yml
179+
job: init-pd
180+
strategy: depend

Bender.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ packages:
6969
- common_cells
7070
- register_interface
7171
cheshire:
72-
revision: 68a7836c0f8998581808efb561bd2fc275a95323
73-
version: 0.2.0
72+
revision: 9d746cced4e8fc4aa7403d7135a71ac0cf41ea82
73+
version: null
7474
source:
7575
Git: https://github.com/pulp-platform/cheshire.git
7676
dependencies:
@@ -151,7 +151,7 @@ packages:
151151
dependencies:
152152
- axi
153153
floo_noc:
154-
revision: 24dc1242fb6406687c5ac2a2e7a8ddb03d649f61
154+
revision: 5c2762f2e02017d50b5a35ee2d076a23af4b2d07
155155
version: null
156156
source:
157157
Git: https://github.com/pulp-platform/FlooNoC.git

Bender.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: "0.4.5" }
1212
axi: { git: "https://github.com/pulp-platform/axi.git", version: "0.39.6" }
1313
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: "1.37.0" }
14-
cheshire: { git: "https://github.com/pulp-platform/cheshire.git", version: "0.2.0" }
14+
cheshire: { git: "https://github.com/pulp-platform/cheshire.git", rev: "9d746cced4e8fc4aa7403d7135a71ac0cf41ea82" }
1515
floo_noc: { git: "https://github.com/pulp-platform/FlooNoC.git", rev: "main"}
1616
snitch_cluster: { git: "https://github.com/pulp-platform/snitch_cluster.git", rev: "soc-integration" }
1717

Makefile

+45-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ CLINTCORES ?= 5
3232
CHS_ROOT = $(shell $(BENDER) path cheshire)
3333
include $(CHS_ROOT)/cheshire.mk
3434

35-
$(CHS_ROOT)/hw/rv_plic.cfg.hjson: cfg/rv_plic.cfg.hjson
36-
flock -x $@ sh -c 'cp $< $@'
35+
$(CHS_ROOT)/hw/rv_plic.cfg.hjson: $(OTPROOT)/.generated2
36+
$(OTPROOT)/.generated2: cfg/rv_plic.cfg.hjson
37+
flock -x $@ sh -c "cp $< $(CHS_ROOT)/hw/" && touch $@
38+
39+
$(CHS_ROOT)/hw/serial_link.hjson: $(CHS_SLINK_DIR)/.generated2
40+
$(CHS_SLINK_DIR)/.generated2: cfg/serial_link.hjson
41+
flock -x $@ sh -c "cp $< $(CHS_ROOT)/hw/" && touch $@
3742

3843
##################
3944
# Snitch Cluster #
@@ -73,6 +78,26 @@ floo-clean:
7378
floo-install-floogen:
7479
$(PYTHON) -m pip install $(shell $(BENDER) path floo_noc)
7580

81+
###################
82+
# Physical Design #
83+
###################
84+
85+
PD_REMOTE ?= [email protected]:picobello/picobello-pd.git
86+
PD_COMMIT ?= cd9f7dd2be136b02a620a99126c3e0c2c659e98f
87+
PD_DIR = $(PB_ROOT)/pd
88+
89+
.PHONY: init-pd clean-pd
90+
91+
init-pd: $(PD_DIR)
92+
$(PD_DIR):
93+
git clone $(PD_REMOTE) $(PD_DIR)
94+
cd $(PD_DIR) && git checkout $(PD_COMMIT)
95+
96+
clean-pd:
97+
rm -rf $(PD_DIR)
98+
99+
-include $(PD_DIR)/pd.mk
100+
76101
#########################
77102
# General Phony targets #
78103
#########################
@@ -84,7 +109,9 @@ PB_HW_ALL += $(PB_GEN_DIR)/floo_picobello_noc.sv
84109

85110
.PHONY: picobello-hw-all picobello-clean clean
86111

87-
picobello-hw-all all: $(PICOBELLO_HW_ALL)
112+
picobello-hw-all all: .venv
113+
source .venv/bin/activate && \
114+
$(MAKE) $(PB_HW_ALL)
88115

89116
picobello-clean clean: sn-clean-wrapper floo-clean
90117
rm -rf $(BENDER_ROOT)
@@ -109,11 +136,23 @@ include $(PB_ROOT)/target/sim/vsim/vsim.mk
109136

110137
include $(SN_ROOT)/target/common/common.mk
111138

112-
.PHONY dvt-flist:
139+
.PHONY: dvt-flist python-venv python-venv-clean
113140

114141
dvt-flist:
115142
$(BENDER) script flist-plus $(COMMON_TARGS) $(SIM_TARGS) > .dvt/default.build
116143

144+
python-venv: .venv
145+
.venv:
146+
$(PYTHON) -m venv $@
147+
source $@/bin/activate && \
148+
python -m pip install --upgrade pip && \
149+
python -m pip install $(shell $(BENDER) path floo_noc) && \
150+
python -m pip install $(shell $(BENDER) path snitch_cluster) && \
151+
python -m pip install -r $(shell $(BENDER) path cheshire)/requirements.txt
152+
153+
python-venv-clean:
154+
rm -rf .venv
155+
117156
#################
118157
# Documentation #
119158
#################
@@ -159,3 +198,5 @@ help:
159198
@echo -e "${Green}traces ${Black}Generate the better readable traces in .logs/trace_hart_<hart_id>.txt."
160199
@echo -e "${Green}annotate ${Black}Annotate the better readable traces in .logs/trace_hart_<hart_id>.s with the source code related with the retired instructions."
161200
@echo -e "${Green}dvt-flist ${Black}Generate a file list for the VSCode DVT plugin."
201+
@echo -e "${Green}python-venv ${Black}Create a Python virtual environment and install the required packages."
202+
@echo -e "${Green}python-venv-clean ${Black}Remove the Python virtual environment."

0 commit comments

Comments
 (0)