Skip to content

Commit 71df12a

Browse files
authored
env: Migrate to uv (#101)
* env: Replace pip with uv * deps: Bump cheshire * ci: Fixes and improvements for uv * iis-env.sh: Update tool versions * Makefile: Fixes and improvements * docs: Update README.md * pyproject.toml: Use `pytorch-cpu` * ci: Checkout bender before creating venv * deps: Bump floo_noc * license: Update annotation for lock files * uv: Update lockfile * uv: Use published floogen * deps: Bump cheshire * uv: Add cheshire as workspace dependency * deps: Bump cheshire * sw: Fix define from rawheader output * make: Remove duplicate recipe * tb: Fix raw address names * py: Package `experiments` properly * ci: Bump PD commit * ci: Try again to interrupt * Bender.yml: Add default remote * ci: Bump PD commit * pyproject.toml: Remove whitespaces * deps: Bump chesire * deps: Bump common_verification * env: Revert back QuestaSim version * pyproject.toml: Add instructions on how to modify floogen * deps: Bump peakrdl rawheader * rdl: Shorten the rawheader svh addresses
1 parent cacdc3a commit 71df12a

19 files changed

Lines changed: 3009 additions & 134 deletions

File tree

.gitlab-ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ stages:
1717
# Sources the environment variables for the IIS environment
1818
.init-env:
1919
before_script:
20+
# Hard link cached python packages since the UV cache directory
21+
# is configured to be on the same filesystem as the build directory in the CI.
22+
- export UV_CACHE_DIR=$CI_BUILDS_DIR/../cache/uv
23+
- export UV_LINK_MODE=hardlink
2024
- source iis-env.sh
2125

2226
##################
@@ -26,6 +30,7 @@ stages:
2630
init-deps:
2731
stage: init
2832
extends:
33+
- .init-env
2934
- .init-deps-tpl
3035
artifacts:
3136
paths:
@@ -65,8 +70,8 @@ vsim-compile:
6570
- .init-env
6671
needs:
6772
- generate-rtl
68-
variables:
69-
FLOO_GEN_ARGS: --no-format
73+
extends:
74+
- .init-env
7075
script:
7176
- make vsim-compile | tee compile.log 2>&1
7277
- '! grep "\*\* Error" compile.log'
@@ -136,6 +141,7 @@ sim-exps:
136141

137142
subpipe:
138143
stage: build
144+
interruptible: true
139145
needs:
140146
- init-deps
141147
trigger:

.gitlab/common.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
variables:
66
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
7-
PD_COMMIT: "65800b0f2d1c7d331feaffbd83bfe2d8086453e0"
7+
PD_COMMIT: "4828594842a7955a8d3a3077ac6454443565da27"
88
SPU_COMMIT: "c2e8815487bd713624d74ef3e3e0465196b6d67f"
99

1010
# Check the cache for bender and python dependencies
@@ -13,31 +13,17 @@ variables:
1313
key:
1414
files:
1515
- Bender.lock
16-
- requirements.txt
1716
paths:
1817
- .bender
19-
- .cache/pip
2018
policy: pull
2119

2220
# Update the cache with bender and python dependencies
2321
.init-deps-tpl:
2422
script:
25-
# Check out the biggest bender dependencies serially
26-
# to avoid rate limiting issues
27-
# TODO(fischeti): Remove once bender supports rate limiting
28-
- bender path cheshire
29-
- bender path cva6
30-
- bender path ibex
31-
- bender path floo_noc
32-
- bender path idma
33-
- bender path cluster_interconnect
34-
- bender path snitch_cluster
35-
# Collect bender sourcess
36-
- bender checkout
37-
# Install the python venv
38-
- source iis-env.sh
3923
# Initialize the PD repository
4024
- make init-pd
25+
# Collect bender sources
26+
- bender checkout
4127
cache:
4228
# inherit all global cache settings
4329
<<: *global_cache

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

Bender.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ packages:
8888
- common_cells
8989
- register_interface
9090
cheshire:
91-
revision: 4a3932e1bfb8ab72b2d934d65667caefbe2884fc
91+
revision: da7babeeb96aa4778a37d0131b28b3b004222ab1
9292
version: null
9393
source:
9494
Git: https://github.com/pulp-platform/cheshire.git
@@ -154,7 +154,7 @@ packages:
154154
- common_verification
155155
- tech_cells_generic
156156
common_verification:
157-
revision: 5fd30c18a6be6f664d1ef9e44d04956fb4e3364e
157+
revision: fb1885f48ea46164a10568aeff51884389f67ae3
158158
version: 0.2.5
159159
source:
160160
Git: https://github.com/pulp-platform/common_verification.git
@@ -207,8 +207,8 @@ packages:
207207
Path: .deps/fhg_spu_cluster
208208
dependencies: []
209209
floo_noc:
210-
revision: 4c98673d3761dd8909a742012b799039331826a4
211-
version: null
210+
revision: 959fb172670a7910fcee94c2d82e460c07c0a24c
211+
version: 0.8.0
212212
source:
213213
Git: https://github.com/pulp-platform/FlooNoC.git
214214
dependencies:

Bender.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@ package:
77
authors:
88
- "Tim Fischer <fischeti@iis.ee.ethz.ch>"
99

10+
remotes:
11+
pulp: "https://github.com/pulp-platform"
12+
1013
dependencies:
11-
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: "0.4.5" }
12-
axi: { git: "https://github.com/colluca/axi.git", rev: "multicast" }
13-
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", rev: "snitch" }
14-
cheshire: { git: "https://github.com/pulp-platform/cheshire.git", rev: "main" }
15-
snitch_cluster: { git: "https://github.com/pulp-platform/snitch_cluster.git", rev: "main" }
16-
floo_noc: { git: "https://github.com/pulp-platform/FlooNoC.git", rev: "reduction-vc-rebase" }
14+
register_interface: "0.4.5"
15+
axi: "0.39.9"
16+
floo_noc: { version: "0.8.0", upstream_name: "FlooNoC" }
17+
apb: "0.2.4"
18+
common_cells: "1.39.0"
19+
snitch_cluster: { git: "https://github.com/pulp-platform/snitch_cluster.git", rev: "main" }
20+
cheshire: { git: "https://github.com/pulp-platform/cheshire.git", rev: "main" }
1721
obi: { git: "https://github.com/pulp-platform/obi.git", rev: "acfcd0f80c7539aa8da7821a66d9acf2074a5b4e" }
1822
redmule: { git: "https://github.com/pulp-platform/redmule.git", rev: "picobello" }
1923
hci: { git: "https://github.com/pulp-platform/hci.git", rev: "06fcba671e060f2e1b03b7ebe2d3e719f1557099" }
2024
datamover: { git: "https://github.com/pulp-platform/datamover.git", rev: "5df9c9bd9e10ad020763c4291c571adf35ef4ae2" } # branch: transpose
21-
apb: { git: "https://github.com/pulp-platform/apb.git", version: "0.2.4" }
2225
apb_fll_if: { git: "https://github.com/pulp-platform/apb_fll_if.git", rev: "structs" }
2326
axi_obi: { path: "hw/axi_obi" }
2427
picobello-pd: { path: "./pd" }
@@ -27,6 +30,7 @@ dependencies:
2730
workspace:
2831
package_links:
2932
.deps/snitch_cluster: snitch_cluster
33+
.deps/cheshire: cheshire
3034

3135
sources:
3236
# Source files grouped in levels. Files in level 0 have no dependencies on files in this

Makefile

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ L2_TILES = $(shell $(FLOO_GEN) query -c $(FLOO_CFG) endpoints.l2_spm.num 2>/dev/
3434
BENDER_YML = $(PB_ROOT)/Bender.yml
3535
BENDER_LOCK = $(PB_ROOT)/Bender.lock
3636

37-
$(PB_GEN_DIR):
38-
mkdir -p $@
39-
4037
################
4138
# Bender flags #
4239
################
4340

4441
COMMON_TARGS += -t rtl -t cva6 -t cv64a6_imafdchsclic_sv39_wb -t snitch_cluster -t pb_gen_rtl
4542
SIM_TARGS += -t simulation -t test -t idma_test
4643

44+
# Get rid of non-existing PD path dependency warnings
45+
BENDER += --suppress W22
46+
4747
#############
4848
# systemRDL #
4949
#############
@@ -72,7 +72,7 @@ $(PB_GEN_DIR)/pb_addrmap.h: $(PB_GEN_DIR)/picobello_addrmap.rdl $(PB_RDL_ALL)
7272
$(PEAKRDL) c-header $< $(PEAKRDL_INCLUDES) $(PEAKRDL_DEFINES) -o $@ -i -b ltoh
7373

7474
$(PB_GEN_DIR)/pb_addrmap.svh: $(PB_RDL_ALL)
75-
$(PEAKRDL) raw-header $< -o $@ $(PEAKRDL_INCLUDES) $(PEAKRDL_DEFINES) --format svh
75+
$(PEAKRDL) raw-header $< -o $@ $(PEAKRDL_INCLUDES) $(PEAKRDL_DEFINES) --format svh --no-prefix
7676

7777
PB_RDL_HW_ALL += $(PB_GEN_DIR)/pb_soc_regs.sv
7878
PB_RDL_HW_ALL += $(PB_GEN_DIR)/pb_soc_regs_pkg.sv
@@ -111,7 +111,7 @@ include $(SN_ROOT)/make/common.mk
111111
include $(SN_ROOT)/make/rtl.mk
112112

113113
$(SN_CFG): $(FLOO_CFG)
114-
@sed -i 's/nr_clusters: .*/nr_clusters: $(SN_CLUSTERS),/' $<
114+
@sed -i 's/nr_clusters: .*/nr_clusters: $(SN_CLUSTERS),/' $@
115115

116116
.PHONY: sn-hw-clean sn-hw-all
117117

@@ -132,7 +132,7 @@ ifeq ($(shell $(VERIBLE_FMT) --version >/dev/null 2>&1 && echo OK),OK)
132132
endif
133133

134134
floo-hw-all: $(PB_GEN_DIR)/floo_picobello_noc_pkg.sv
135-
$(PB_GEN_DIR)/floo_picobello_noc_pkg.sv: $(FLOO_CFG) | $(PB_GEN_DIR)
135+
$(PB_GEN_DIR)/floo_picobello_noc_pkg.sv: $(FLOO_CFG)
136136
$(FLOO_GEN) pkg -c $(FLOO_CFG) -o $(PB_GEN_DIR) $(FLOO_GEN_FLAGS)
137137

138138

@@ -213,27 +213,12 @@ $(call sn_include_deps)
213213
# Misc #
214214
########
215215

216-
BASE_PYTHON ?= python
217-
PIP_CACHE_DIR ?= $(PB_ROOT)/.cache/pip
218216

219-
.PHONY: dvt-flist python-venv python-venv-clean verible-fmt
217+
.PHONY: dvt-flist verible-fmt
220218

221219
dvt-flist:
222220
$(BENDER) script flist-plus $(COMMON_TARGS) $(SIM_TARGS) > .dvt/default.build
223221

224-
python-venv: .venv
225-
.venv:
226-
$(BASE_PYTHON) -m venv $@
227-
. $@/bin/activate && \
228-
python -m pip install --upgrade pip "setuptools<81" && \
229-
python -m pip install --no-build-isolation --cache-dir $(PIP_CACHE_DIR) -r requirements.txt && \
230-
python -m pip install --cache-dir $(PIP_CACHE_DIR) $(shell $(BENDER) path floo_noc) --no-deps && \
231-
python -m pip install --cache-dir $(PIP_CACHE_DIR) -e "$(shell $(BENDER) path snitch_cluster)[kernels]"
232-
233-
python-venv-clean:
234-
rm -rf .venv
235-
rm -rf $(PIP_CACHE_DIR)
236-
237222
verible-fmt:
238223
$(VERIBLE_FMT) $(VERIBLE_FMT_ARGS) $(shell $(BENDER) script flist $(SIM_TARGS) --no-deps)
239224

README.md

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

55
*picobello* is developed as part of the [PULP (Parallel Ultra-Low Power) project](https://pulp-platform.org/), a joint effort between ETH Zurich and the University of Bologna. *picobello* is also supported by the [EUPilot project](https://eupilot.eu), under the name MLS.
66

7-
## 🚧 Getting started (currently in early development)
7+
## Getting started
88

99
### Environment setup for IIS-members
1010

@@ -24,17 +24,15 @@ For non-IIS members, there is some additional setup required to get the environm
2424

2525
The first requirement you need to install is `bender`. Check the [installation page](https://github.com/pulp-platform/bender/tree/master?tab=readme-ov-file#installation) on how to set it up.
2626

27-
#### Virtual Python environment
27+
#### Python environment
2828

29-
You need to have a python>=3.11 installed, in order to create the virtual python environment:
29+
To generate certain source files with python you need to have [uv](https://docs.astral.sh/uv/) installed, which will create the virtual environment and install the required dependencies. To set up the environment, run:
3030

3131
```bash
32-
make python-venv
32+
uv sync --locked
3333
source .venv/bin/activate
3434
```
3535

36-
By default, it will use the `python` in your `$PATH`. If you want to use a specific python version, you can set the `BASE_PYTHON` environment variable accordingly.
37-
3836
#### Toolchains
3937

4038
Picobello requires two different toolchains at the moment:

REUSE.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@
44

55
version = 1
66

7-
# Project documentation and tool configuration files that cannot carry SPDX headers
7+
# READMEs and other documentation files that are ugly to carry SPDX headers
88
[[annotations]]
99
path = [
1010
"README.md",
1111
"MLSYS.md",
12-
"Bender.lock",
1312
"experiments/multicast/README.md",
1413
"hw/axi_obi/Readme.md",
1514
]
1615
SPDX-FileCopyrightText = "2025 ETH Zurich and University of Bologna"
1716
SPDX-License-Identifier = "SHL-0.51"
17+
18+
# Project tool version configuration files that cannot carry SPDX headers
19+
[[annotations]]
20+
path = [
21+
"Bender.lock",
22+
".python-version",
23+
"uv.lock",
24+
]
25+
SPDX-FileCopyrightText = "2025 ETH Zurich and University of Bologna"
26+
SPDX-License-Identifier = "SHL-0.51"

experiments/__init__.py

Whitespace-only changes.

experiments/picobello/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2025 ETH Zurich and University of Bologna.
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
from .picobello import *

0 commit comments

Comments
 (0)