Skip to content
Open
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
9 changes: 7 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ stages:
# Sources the environment variables for the IIS environment
.init-env:
before_script:
# Hard link cached python packages since the UV cache directory
# is configured to be on the same filesystem as the build directory in the CI.
- export UV_CACHE_DIR=$CI_BUILDS_DIR/../cache/uv
- export UV_LINK_MODE=hardlink
- source iis-env.sh

##################
Expand All @@ -23,6 +27,7 @@ stages:
init-deps:
stage: init
extends:
- .init-env
- .init-deps-tpl
artifacts:
paths:
Expand Down Expand Up @@ -59,8 +64,8 @@ vsim-compile:
stage: build
needs:
- generate-rtl
variables:
FLOO_GEN_ARGS: --no-format
extends:
- .init-env
script:
- make vsim-compile | tee compile.log 2>&1
- '! grep "\*\* Error" compile.log'
Expand Down
21 changes: 3 additions & 18 deletions .gitlab/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PD_COMMIT: "6c72ebfe4cbbc11bba771405212f85fd4ef603c8"
PD_COMMIT: "uv" # TODO: Merge in Gitlab
SPU_COMMIT: "c2e8815487bd713624d74ef3e3e0465196b6d67f"

# Check the cache for bender and python dependencies
Expand All @@ -13,31 +12,17 @@ variables:
key:
files:
- Bender.lock
- requirements.txt
paths:
- .bender
- .cache/pip
policy: pull

# Update the cache with bender and python dependencies
.init-deps-tpl:
script:
# Check out the biggest bender dependencies serially
# to avoid rate limiting issues
# TODO(fischeti): Remove once bender supports rate limiting
- bender path cheshire
- bender path cva6
- bender path ibex
- bender path floo_noc
- bender path idma
- bender path cluster_interconnect
- bender path snitch_cluster
# Collect bender sourcess
- bender checkout
# Install the python venv
- source iis-env.sh
# Initialize the PD repository
- make init-pd
# Collect bender sources
- bender checkout
cache:
# inherit all global cache settings
<<: *global_cache
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
6 changes: 3 additions & 3 deletions Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ packages:
- common_cells
- register_interface
cheshire:
revision: 0bebd9a2d6edb4665b00d2db9442c059692c0664
revision: 4a3932e1bfb8ab72b2d934d65667caefbe2884fc
version: null
source:
Git: https://github.com/pulp-platform/cheshire.git
Expand Down Expand Up @@ -175,7 +175,7 @@ packages:
Git: https://github.com/pulp-platform/cv32e40x.git
dependencies: []
cva6:
revision: 9338c2ca7cf1a47aef54322f89ce867825c3c8d5
revision: 4c02b24fe7c04690f626776a92274da24f80d1da
version: null
source:
Git: https://github.com/pulp-platform/cva6.git
Expand Down Expand Up @@ -225,7 +225,7 @@ packages:
Path: .bender/git/checkouts/floo_noc-051cdbf4a4876727/./pd
dependencies: []
fpnew:
revision: a8e0cba6dd50f357ece73c2c955d96efc3c6c315
revision: e5aa6a01b5bbe1675c3aa8872e1203413ded83d1
version: null
source:
Git: https://github.com/pulp-platform/cvfpu.git
Expand Down
3 changes: 2 additions & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: "0.4.5" }
axi: { git: "https://github.com/pulp-platform/axi.git", version: "0.39.6" }
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", rev: "snitch" }
cheshire: { git: "https://github.com/pulp-platform/cheshire.git", rev: "picobello" }
cheshire: { git: "https://github.com/pulp-platform/cheshire.git", rev: "main" }
snitch_cluster: { git: "https://github.com/pulp-platform/snitch_cluster.git", rev: "5d6c957c70e3824e2330d8308eb904724cd41cbe" }
floo_noc: { git: "https://github.com/pulp-platform/FlooNoC.git", version: "0.7.0" }
obi: { git: "https://github.com/pulp-platform/obi.git", rev: "acfcd0f80c7539aa8da7821a66d9acf2074a5b4e" }
Expand All @@ -27,6 +27,7 @@ dependencies:
workspace:
package_links:
.deps/snitch_cluster: snitch_cluster
.deps/floo_noc: floo_noc

sources:
# Source files grouped in levels. Files in level 0 have no dependencies on files in this
Expand Down
25 changes: 7 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ BENDER_LOCK = $(PB_ROOT)/Bender.lock
# Bender flags #
################

COMMON_TARGS += -t rtl -t cva6 -t cv64a6_imafdcsclic_sv39 -t snitch_cluster -t pb_gen_rtl
COMMON_TARGS += -t rtl -t cva6 -t cv64a6_imafdchsclic_sv39_wb -t snitch_cluster -t pb_gen_rtl
SIM_TARGS += -t simulation -t test -t idma_test

# Get rid of non-existing PD path dependency warnings
BENDER += --suppress W22

#############
# systemRDL #
#############
Expand Down Expand Up @@ -108,7 +111,7 @@ include $(SN_ROOT)/make/common.mk
include $(SN_ROOT)/make/rtl.mk

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

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

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

floo-hw-all: $(PB_GEN_DIR)/floo_picobello_noc_pkg.sv
$(PB_GEN_DIR)/floo_picobello_noc_pkg.sv: $(FLOO_CFG) | $(PB_GEN_DIR)
$(PB_GEN_DIR)/floo_picobello_noc_pkg.sv: $(FLOO_CFG)
$(FLOO_GEN) -c $(FLOO_CFG) -o $(PB_GEN_DIR) --only-pkg $(FLOO_GEN_FLAGS)


Expand Down Expand Up @@ -209,26 +212,12 @@ $(call sn_include_deps)
# Misc #
########

BASE_PYTHON ?= python
PIP_CACHE_DIR ?= $(PB_ROOT)/.cache/pip

.PHONY: dvt-flist python-venv python-venv-clean verible-fmt
.PHONY: dvt-flist verible-fmt

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

python-venv: .venv
.venv:
$(BASE_PYTHON) -m venv $@
. $@/bin/activate && \
python -m pip install --upgrade pip setuptools && \
python -m pip install --cache-dir $(PIP_CACHE_DIR) -r requirements.txt && \
python -m pip install --cache-dir $(PIP_CACHE_DIR) $(shell $(BENDER) path floo_noc) --no-deps && \
python -m pip install --cache-dir $(PIP_CACHE_DIR) "$(shell $(BENDER) path snitch_cluster)[kernels]"

python-venv-clean:
rm -rf .venv

verible-fmt:
$(VERIBLE_FMT) $(VERIBLE_FMT_ARGS) $(shell $(BENDER) script flist $(SIM_TARGS) --no-deps)

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

*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.

## 🚧 Getting started (currently in early development)
## Getting started

### Environment setup for IIS-members

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

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.

#### Virtual Python environment
#### Python environment

You need to have a python>=3.11 installed, in order to create the virtual python environment:
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:

```bash
make python-venv
uv sync --locked
source .venv/bin/activate
```

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.

#### Toolchains

Picobello requires two different toolchains at the moment:
Expand Down
20 changes: 7 additions & 13 deletions iis-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
# SPDX-License-Identifier: SHL-0.51

export VSIM="questa-2023.4 vsim"
export VOPT="questa-2023.4 vopt"
export VLIB="questa-2023.4 vlib"
export BASE_PYTHON=/usr/local/anaconda3/bin/python3.11
export VSIM="questa-2025.3 vsim"
export VOPT="questa-2025.3 vopt"
export VLIB="questa-2025.3 vlib"
export CHS_SW_GCC_BINROOT=/usr/pack/riscv-1.0-kgf/riscv64-gcc-12.2.0/bin
export VERIBLE_FMT="oseda -2025.03 verible-verilog-format"
export SN_LLVM_BINROOT=/usr/scratch2/vulcano/colluca/tools/riscv32-snitch-llvm-almalinux8-15.0.0-snitch-0.2.0/bin
export SN_LLVM_BINROOT=/usr/scratch2/vulcano/colluca/tools/riscv32-snitch-llvm-almalinux8-15.0.0-snitch-0.5.0/bin

# Create the python venv
if [ ! -d ".venv" ]; then
make python-venv
fi
bender checkout

# Activate the python venv only if not already active
if [ -z "$VIRTUAL_ENV" ] || [ "$VIRTUAL_ENV" != "$(realpath .venv)" ]; then
source .venv/bin/activate
fi
/usr/local/uv/uv sync --locked
source .venv/bin/activate
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2025 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

[project]
name = "picobello"
version = "0.1.0"
description = "whatever it means"
readme = "README.md"
requires-python = ">=3.11"

dependencies = [
"flatdict>=4.0.1",
"floogen",
"hjson>=3.1.0",
"peakrdl>=1.5.0",
"peakrdl-rawheader>=0.2.2",
"setuptools<81",
"snitch[kernels]",
]

[tool.uv.workspace]
members = [
".deps/floo_noc",
".deps/snitch_cluster",
]

[tool.uv.sources]
floogen = { workspace = true, editable = true }
snitch = { workspace = true, editable = true }
torch = [{ index = "pytorch-cpu" }]

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
29 changes: 0 additions & 29 deletions requirements.txt

This file was deleted.

Loading
Loading