Skip to content

Commit 2ba10fa

Browse files
committed
Update Taskfile
* Fix some style-guide issues * Add bondpads while the generator script is not ready * Move firmware and fpga commands to namespaces Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
1 parent ebf4747 commit 2ba10fa

File tree

9 files changed

+226
-94
lines changed

9 files changed

+226
-94
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ Start by generating the necessary files for the ECPIX5 Board, then synthesize th
7272

7373
.. code-block:: text
7474
75-
task fpga-prepare fpga-synthesize
75+
task fpga:prepare fpga:synthesize
7676
7777
Next, program the ECP5 FPGA with the synthesized bitstream.
7878

7979
.. code-block:: text
8080
81-
task fpga-flash
81+
task fpga:flash
8282
8383
ASIC Flow
8484
#########

REUSE.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ SPDX-License-Identifier = "CERN-OHL-W-2.0"
1919
path = "software/*/spi.layout"
2020
SPDX-FileCopyrightText = "2025 aesc silicon"
2121
SPDX-License-Identifier = "Apache-2.0"
22+
23+
[[annotations]]
24+
path = "tmp/*/*"
25+
SPDX-FileCopyrightText = "2026 aesc silicon"
26+
SPDX-License-Identifier = "CERN-OHL-W-2.0"

Taskfile.firmware.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: 2026 aesc silicon
2+
#
3+
# SPDX-License-Identifier: CERN-OHL-W-2.0
4+
# yaml-language-server: $schema=https://taskfile.dev/schema.json
5+
6+
version: '3'
7+
8+
tasks:
9+
compile:
10+
desc: Compiles bare metal firmwares.
11+
cmds:
12+
- task: ':lib-baremetal-firmware'
13+
vars:
14+
board: "{{.TECH}}"
15+
app: "bootrom"
16+
- task: ':lib-baremetal-firmware'
17+
vars:
18+
board: "{{.TECH}}"
19+
app: "demo"
20+
- "{{ .RUN }} './software/{{ .package }}/gen_image_container.sh'"
21+
22+
flash:
23+
desc: Programs the SPI flash with the compiled firmware image.
24+
cmds:
25+
- "flashrom -p buspirate_spi:dev=/dev/serial/by-id/usb-Bus_Pirate_Bus_Pirate_5_5buspirate-if02,spispeed=8M -c MT25QL256 -l software/{{ .package }}/spi.layout -i flash -n -w {{ .BUILD_ROOT}}/{{ .SOC }}/{{ .TECH }}/firmware/image_container.img"

Taskfile.fpga.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-FileCopyrightText: 2026 aesc silicon
2+
#
3+
# SPDX-License-Identifier: CERN-OHL-W-2.0
4+
# yaml-language-server: $schema=https://taskfile.dev/schema.json
5+
6+
version: '3'
7+
8+
tasks:
9+
default:
10+
desc: Runs the full FPGA flow - prepare, synthesize, and flash.
11+
cmds:
12+
- task: prepare
13+
- task: synthesize
14+
- task: flash
15+
16+
prepare:
17+
desc: Produces the Verilog file and metadata needed for FPGA operations.
18+
cmds:
19+
- task: ':lib-generate'
20+
vars:
21+
board: "ECPIX5"
22+
23+
synthesize:
24+
desc: Generates the FPGA bitstream by synthesizing the design.
25+
cmds:
26+
- task: ':lib-synthesize-fpga'
27+
vars:
28+
board: "ECPIX5"
29+
vendor: "Lattice"
30+
31+
flash:
32+
desc: Programs the FPGA with the generated bitstream.
33+
cmds:
34+
- task: ':lib-flash-bitstream'
35+
vars:
36+
board: "ECPIX5"
37+
38+
simulate:
39+
desc: Runs simulations at the RTL level. Add 'duration=n' to specify the duration in n milliseconds.
40+
cmds:
41+
- task: ':lib-simulate'
42+
vars:
43+
board: "ECPIX5"
44+
45+
view-simulation:
46+
desc: Opens the simulation with GTKWave.
47+
cmds:
48+
- task: ':lib-view-simulation'
49+
vars:
50+
board: "ECPIX5"

Taskfile.yml

Lines changed: 64 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-FileCopyrightText: 2025 aesc silicon
22
#
33
# SPDX-License-Identifier: CERN-OHL-W-2.0
4+
# yaml-language-server: $schema=https://taskfile.dev/schema.json
45

56
version: '3'
67

@@ -9,187 +10,158 @@ includes:
910
taskfile: ./modules/elements/zibal/Taskfile.yaml
1011
optional: true
1112
flatten: true
12-
13-
env:
14-
FPGA_FAMILY: ecp5
15-
FPGA_DEVICE: um5g-45k
16-
FPGA_PACKAGE: CABGA554
17-
FPGA_FREQUENCY: 50
18-
OPENFPGALOADER_BOARD: ecpix5_r03
19-
PDK: ihp-sg13g2
20-
PDK_ROOT: "{{ .PWD }}/pdks/IHP-Open-PDK/"
21-
KLAYOUT_HOME: "{{ .PWD }}/pdks/IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/"
22-
NAFARR_BASE: "{{ .PWD }}/modules/elements/nafarr/"
23-
ZIBAL_BASE: "{{ .PWD }}/modules/elements/zibal/"
24-
BUILD_ROOT: "{{ .PWD }}/build/"
25-
GCC: "/opt/elements/zephyr-sdk-0.17.0/riscv64-zephyr-elf/bin/riscv64-zephyr-elf"
26-
OPENROAD_FLOW_ROOT: "{{ .PWD }}/tools/OpenROAD-flow-scripts/flow"
13+
firmware:
14+
taskfile: ./Taskfile.firmware.yml
15+
fpga:
16+
taskfile: ./Taskfile.fpga.yml
2717

2818
vars:
2919
SOC: '{{.SOC | default "ElemRV-N"}}'
20+
TECH: '{{.TECH | default "SG13G2"}}'
3021
package:
3122
sh: echo "{{.SOC}}" | tr '[:upper:]' '[:lower:]' | tr '-' '_'
23+
PDK:
24+
sh: echo "ihp-{{.TECH}}" | tr '[:upper:]' '[:lower:]'
25+
KLAYOUT_HOME: "{{.PWD}}/pdks/IHP-Open-PDK/{{.PDK}}/libs.tech/klayout/"
3226
CONTAINER_NAME: elemrv_container
3327
CONTAINER_ENV: " \
34-
-e SOC={{ .SOC }} \
35-
-e FPGA_FAMILY={{ .FPGA_FAMILY }} \
36-
-e FPGA_DEVICE={{ .FPGA_DEVICE }} \
37-
-e FPGA_PACKAGE={{ .FPGA_PACKAGE }} \
38-
-e FPGA_FREQUENCY={{ .FPGA_FREQUENCY }} \
39-
-e PDK={{ .PDK }} \
40-
-e PDK_ROOT={{ .PDK_ROOT }} \
41-
-e KLAYOUT_HOME={{ .KLAYOUT_HOME }} \
42-
-e NAFARR_BASE={{ .NAFARR_BASE }} \
43-
-e ZIBAL_BASE={{ .ZIBAL_BASE }} \
44-
-e BUILD_ROOT={{ .BUILD_ROOT }} \
45-
-e GCC={{ .GCC }} \
28+
-e SOC={{.SOC}} \
29+
-e TECH={{.TECH}} \
30+
-e FPGA_FAMILY={{.FPGA_FAMILY}} \
31+
-e FPGA_DEVICE={{.FPGA_DEVICE}} \
32+
-e FPGA_PACKAGE={{.FPGA_PACKAGE}} \
33+
-e FPGA_FREQUENCY={{.FPGA_FREQUENCY}} \
34+
-e PDK={{.PDK}} \
35+
-e PDK_ROOT={{.PDK_ROOT}} \
36+
-e KLAYOUT_HOME={{.KLAYOUT_HOME}} \
37+
-e NAFARR_BASE={{.NAFARR_BASE}} \
38+
-e ZIBAL_BASE={{.ZIBAL_BASE}} \
39+
-e VEXRISCV_ROOT={{.VEXRISCV_ROOT}} \
40+
-e BUILD_ROOT={{.BUILD_ROOT}} \
41+
-e GCC={{.GCC}} \
4642
"
4743

44+
env:
45+
FPGA_FAMILY: ecp5
46+
FPGA_DEVICE: um5g-45k
47+
FPGA_PACKAGE: CABGA554
48+
FPGA_FREQUENCY: 50
49+
OPENFPGALOADER_BOARD: ecpix5_r03
50+
PDK_ROOT: "{{.PWD}}/pdks/IHP-Open-PDK/"
51+
NAFARR_BASE: "{{.PWD}}/modules/elements/nafarr/"
52+
ZIBAL_BASE: "{{.PWD}}/modules/elements/zibal/"
53+
VEXRISCV_ROOT: "{{.PWD}}/modules/elements/vexriscv/"
54+
BUILD_ROOT: "{{.PWD}}/build/"
55+
GCC: "/opt/elements/zephyr-sdk-0.17.0/riscv64-zephyr-elf/bin/riscv64-zephyr-elf"
56+
OPENROAD_FLOW_ROOT: "{{.PWD}}/tools/OpenROAD-flow-scripts/flow"
4857

4958
tasks:
50-
project-prepare:
51-
desc: Sets up a virtual environment, installs tools, and initializes project dependencies.
59+
_project-prepare:
5260
cmds:
5361
- virtualenv venv
5462
- venv/bin/pip3 install podman-compose==1.0.6
5563
- curl https://storage.googleapis.com/git-repo-downloads/repo > repo
5664
- chmod a+rx repo
57-
- ./repo init -u https://github.com/aesc-silicon/ElemRV.git -b {{if .branch}}{{.branch}}{{else}}main{{end}} -m manifest{{if .nightly}}-nightly{{end}}.xml
65+
- ./repo init -u https://github.com/aesc-silicon/ElemRV.git -b {{if .branch}}{{.branch}}{{else}}main{{end}} -m manifest{{.manifest_suffix}}.xml
5866

59-
build-container:
60-
desc: Creates a container with all necessary host requirements pre-installed.
67+
_build-container:
6168
cmds:
62-
- venv/bin/podman-compose build
69+
- venv/bin/podman-compose {{if .CI}}--podman-pull-args=-q{{end}} pull
70+
6371
repo-sync:
6472
desc: Downloads and synchronizes all required dependencies.
6573
cmds:
66-
- ./repo sync
74+
- ./repo sync {{if .CI}}-q{{end}}
75+
6776
install:
6877
desc: Installs all dependencies and prepares the project for FPGA and chip workflows.
6978
cmds:
70-
- task: project-prepare
71-
- task: build-container
79+
- task: _project-prepare
80+
- task: _build-container
7281
- task: repo-sync
7382
vars:
7483
branch: "main"
75-
nightly: "false"
76-
77-
fpga-prepare:
78-
desc: Produces the Verilog file and metadata needed for FPGA operations.
79-
cmds:
80-
- task: lib-generate
81-
vars:
82-
board: "ECPIX5"
83-
fpga-synthesize:
84-
desc: Generates the FPGA bitstream by synthesizing the design.
85-
cmds:
86-
- task: lib-synthesize-fpga
87-
vars:
88-
board: "ECPIX5"
89-
vendor: "Lattice"
90-
fpga-flash:
91-
desc: Programs the FPGA with the generated bitstream.
92-
cmds:
93-
- task: lib-flash-bitstream
94-
vars:
95-
board: "ECPIX5"
96-
fpga-simulate:
97-
desc: Runs simulations at the RTL level. Add 'duration=n' to specify the duration in n milliseconds.
98-
cmds:
99-
- task: lib-simulate
100-
vars:
101-
board: "ECPIX5"
102-
fpga-view-simulation:
103-
desc: Opens the simulation with GTKWave.
104-
cmds:
105-
- task: lib-view-simulation
106-
vars:
107-
board: "ECPIX5"
108-
109-
compile-firmware:
110-
desc: Compiles bare metal firmwares.
111-
cmds:
112-
- task: lib-baremetal-firmware
113-
vars:
114-
board: "SG13G2"
115-
app: "bootrom"
116-
- task: lib-baremetal-firmware
117-
vars:
118-
board: "SG13G2"
119-
app: "demo"
84+
manifest_suffix: ""
12085

12186
prepare:
12287
desc: Generates all necessary source files and metadata for chip layout creation.
12388
cmds:
12489
- task: lib-generate
12590
vars:
126-
board: "SG13G2"
91+
board: "{{.TECH}}"
12792
- task: lib-sealring
12893
vars:
129-
board: "SG13G2"
94+
board: "{{.TECH}}"
95+
- "mkdir -p {{.BUILD_ROOT}}/{{.SOC}}/{{.TECH}}/zibal/macros/bondpad"
96+
- "cp tmp/{{.PDK}}/bondpad_70x70.lef {{.BUILD_ROOT}}/{{.SOC}}/{{.TECH}}/zibal/macros/bondpad/"
97+
- "cp tmp/{{.PDK}}/bondpad_70x70.gds.gz {{.BUILD_ROOT}}/{{.SOC}}/{{.TECH}}/zibal/macros/bondpad/bondpad_70x70.gds.gz"
98+
# TODO: wait until bondpad.py got fixed
99+
#- task: lib-bondpad
100+
# vars:
101+
# board: "{{.TECH}}"
130102

131103
simulate:
132104
desc: Runs simulations at the RTL level. Add 'duration=n' to specify the duration in n milliseconds.
133105
cmds:
134106
- task: lib-simulate
135107
vars:
136-
board: "SG13G2"
108+
board: "{{.TECH}}"
137109

138110
view-simulation:
139111
desc: Opens the simulation with GTKWave.
140112
cmds:
141113
- task: lib-view-simulation
142114
vars:
143-
board: "SG13G2"
115+
board: "{{.TECH}}"
144116

145117
layout:
146118
desc: Creates the physical layout of the chip.
147119
cmds:
148120
- task: lib-layout
149121
vars:
150-
board: "SG13G2"
122+
board: "{{.TECH}}"
151123

152124
filler:
153125
desc: Inserts filler cells into the layout to ensure proper chip functionality.
154126
cmds:
155127
- task: lib-filler
156128
vars:
157-
board: "SG13G2"
129+
board: "{{.TECH}}"
158130

159131
run-drc:
160132
desc: Performs Design Rule Checks and reports violations; use 'level=minimal' for a basic check.
161133
cmds:
162134
- task: lib-run-drc
163135
vars:
164-
board: "SG13G2"
136+
board: "{{.TECH}}"
165137

166138
view-drc:
167139
desc: Displays DRC results in KLayout; 'level=minimal' opens minimal deck results.
168140
cmds:
169141
- task: lib-view-drc
170142
vars:
171-
board: "SG13G2"
143+
board: "{{.TECH}}"
172144

173145
view-openroad:
174146
desc: Loads the layout into OpenROAD for further analysis or modification.
175147
cmds:
176148
- task: lib-view-openroad
177149
vars:
178-
board: "SG13G2"
150+
board: "{{.TECH}}"
179151

180152
view-klayout:
181153
desc: Opens the chip layout in KLayout for inspection.
182154
cmds:
183155
- task: lib-view-klayout
184156
vars:
185-
board: "SG13G2"
157+
board: "{{.TECH}}"
186158

187159
check-logs:
188160
desc: Checks the build directory for warnings or errors in the logs.
189161
cmds:
190162
- task: lib-check-logs
191163
vars:
192-
board: "SG13G2"
164+
board: "{{.TECH}}"
193165

194166
default:
195167
desc: Executes the full IHP SG13G2 RTL-to-GDSII flow and validates the layout afterwards.
20.6 KB
Binary file not shown.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
VERSION 5.8 ;
2+
3+
MACRO bondpad_70x70
4+
CLASS COVER ;
5+
ORIGIN 0 0 ;
6+
FOREIGN bondpad_70x70 0 0 ;
7+
SIZE 70.0 BY 70.0 ;
8+
SYMMETRY X Y R90 ;
9+
SITE sg13cmos5l_ioSite ;
10+
PIN pad
11+
USE SIGNAL ;
12+
PORT
13+
LAYER Metal2 ;
14+
RECT 0 0 70.0 70.0 ;
15+
LAYER Metal3 ;
16+
RECT 0 0 70.0 70.0 ;
17+
LAYER Metal4 ;
18+
RECT 0 0 70.0 70.0 ;
19+
LAYER TopMetal1 ;
20+
RECT 0 0 70.0 70.0 ;
21+
END
22+
END pad
23+
24+
OBS
25+
LAYER Metal1 ;
26+
RECT 0 0 70.0 70.0 ;
27+
LAYER Metal2 ;
28+
RECT 0 0 70.0 70.0 ;
29+
LAYER Metal3 ;
30+
RECT 0 0 70.0 70.0 ;
31+
LAYER Metal4 ;
32+
RECT 0 0 70.0 70.0 ;
33+
LAYER TopMetal1 ;
34+
RECT 0 0 70.0 70.0 ;
35+
END
36+
END bondpad_70x70
133 KB
Binary file not shown.

0 commit comments

Comments
 (0)