Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exercised end to end.
unchanged toolchain are fast. Only the `.bin` files the projects
actually need are uploaded as artifacts (`matrix.bins`).
2. **project stage**: runs inside `nix develop ./toolchain-nix`, which
provides yosys, nextpnr-xilinx, fasm2frames, xc7frames2bit and the
provides yosys, nextpnr-xilinx, fpga-as and the
python path plumbing. The `${FAMILY}_CHIPDB` env var (e.g.
`ARTIX7_CHIPDB`) points at the downloaded chipdb artifacts — without
it the project Makefiles fall back to a broken `/xc7a35t.bin` path.
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/heavy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ env:
# Single source of truth for the toolchain revision: both jobs (chipdb
# and project) MUST resolve this exact rev. Bump it and regenerate the
# golden bitstreams together (update-goldens input).
TOOLCHAIN_NIX_REV: e3df10cec952d1e97d28bd9a398f7d5fd6a55519
TOOLCHAIN_NIX_REV: 22340424724131a273b30c4d04b0dd13ccaa8a45

jobs:

Expand Down Expand Up @@ -91,9 +91,11 @@ jobs:
fail-fast: false
matrix:
include:
# The chipdb output contains one .bin per footprint (e.g.
# xc7k325tffg900.bin), so we copy them all; each project
# Makefile picks its part via ${UPPER}_CHIPDB.
# The chipdb derivation installs one .bin per footprint (e.g.
# xc7k325tffg900.bin), each a relative symlink to its die's
# database; each project Makefile picks its part via
# ${UPPER}_CHIPDB. A family travels as one tar (see the build
# step), so the symlinks survive the round trip.
- family: kintex7
steps:
- uses: actions/checkout@v4
Expand All @@ -108,8 +110,16 @@ jobs:
set -euo pipefail
OUT=$(nix build "github:${TOOLCHAIN_NIX_REPO}/${TOOLCHAIN_NIX_REV}#nextpnr-xilinx-chipdb.${{ matrix.family }}" \
--print-out-paths --no-link)
# One .bin per footprint, each a relative symlink to its die's
# database. Tar rather than copy: `cp` dereferences the links and
# stages a full copy under every part name (kintex7: 1.2 GB for
# 252 MB of data), and upload-artifact's symlink handling is
# version-dependent (v4.3.5 changed it and broke pipelines), while a
# tar member list is exactly what the derivation installed -- links
# included. The one archive also uploads and downloads far faster
# than the copies.
mkdir -p "$GITHUB_WORKSPACE/stage"
cp "$OUT"/*.bin "$GITHUB_WORKSPACE/stage/"
( cd "$OUT" && tar -cf "$GITHUB_WORKSPACE/stage/chipdb-${{ matrix.family }}.tar" *.bin )
ls -la "$GITHUB_WORKSPACE/stage"
echo "stage=$GITHUB_WORKSPACE/stage" >> "$GITHUB_OUTPUT"

Expand Down Expand Up @@ -143,6 +153,12 @@ jobs:
with:
name: chipdb-${{ matrix.family }}
path: chipdb
- name: Unpack chipdb
run: |
set -euo pipefail
tar -C chipdb -xf "chipdb/chipdb-${{ matrix.family }}.tar"
rm -f "chipdb/chipdb-${{ matrix.family }}.tar"
ls -la chipdb
- uses: DeterminateSystems/nix-installer-action@v14
# v6: the last release before the FlakeHub cache requirement --
# uses the native GitHub Actions cache directly, no token needed.
Expand Down
40 changes: 34 additions & 6 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 1. Builds the full toolchain (nextpnr-xilinx + prjxray + fasm + chipdb)
# from the pinned toolchain-nix revision (TOOLCHAIN_NIX_REV).
# 2. Builds every demo project to a .bit file
# (yosys -> nextpnr-xilinx -> fasm2frames -> xc7frames2bit).
# (yosys -> nextpnr-xilinx -> fpga-as).
# One job per project, so the CI overview shows exactly which
# subprojects in demo-projects succeed and fail.
# 3. Compares regenerated .bit files against the golden .bit files
Expand Down Expand Up @@ -49,7 +49,7 @@ env:
# Single source of truth for the toolchain revision: both jobs (chipdb
# and project) MUST resolve this exact rev. Bump it and regenerate the
# golden bitstreams together (update-goldens input).
TOOLCHAIN_NIX_REV: e3df10cec952d1e97d28bd9a398f7d5fd6a55519
TOOLCHAIN_NIX_REV: 22340424724131a273b30c4d04b0dd13ccaa8a45

jobs:
# ---------------------------------------------------------------------
Expand All @@ -63,9 +63,11 @@ jobs:
fail-fast: false
matrix:
include:
# The chipdb output contains one .bin per footprint (e.g.
# xc7k325tffg900.bin), so we copy them all; each project
# Makefile picks its part via ${UPPER}_CHIPDB.
# The chipdb derivation installs one .bin per footprint (e.g.
# xc7k325tffg900.bin), each a relative symlink to its die's
# database; each project Makefile picks its part via
# ${UPPER}_CHIPDB. A family travels as one tar (see the build
# step), so the symlinks survive the round trip.
- family: artix7
- family: kintex7
- family: spartan7
Expand All @@ -83,8 +85,16 @@ jobs:
set -euo pipefail
OUT=$(nix build "github:${TOOLCHAIN_NIX_REPO}/${TOOLCHAIN_NIX_REV}#nextpnr-xilinx-chipdb.${{ matrix.family }}" \
--print-out-paths --no-link)
# One .bin per footprint, each a relative symlink to its die's
# database. Tar rather than copy: `cp` dereferences the links and
# stages a full copy under every part name (kintex7: 1.2 GB for
# 252 MB of data), and upload-artifact's symlink handling is
# version-dependent (v4.3.5 changed it and broke pipelines), while a
# tar member list is exactly what the derivation installed -- links
# included. The one archive also uploads and downloads far faster
# than the copies.
mkdir -p "$GITHUB_WORKSPACE/stage"
cp "$OUT"/*.bin "$GITHUB_WORKSPACE/stage/"
( cd "$OUT" && tar -cf "$GITHUB_WORKSPACE/stage/chipdb-${{ matrix.family }}.tar" *.bin )
ls -la "$GITHUB_WORKSPACE/stage"
echo "stage=$GITHUB_WORKSPACE/stage" >> "$GITHUB_OUTPUT"

Expand Down Expand Up @@ -179,6 +189,12 @@ jobs:
with:
name: chipdb-${{ matrix.family }}
path: chipdb
- name: Unpack chipdb
run: |
set -euo pipefail
tar -C chipdb -xf "chipdb/chipdb-${{ matrix.family }}.tar"
rm -f "chipdb/chipdb-${{ matrix.family }}.tar"
ls -la chipdb
- uses: DeterminateSystems/nix-installer-action@v14
# v6: the last release before the FlakeHub cache requirement --
# uses the native GitHub Actions cache directly, no token needed.
Expand Down Expand Up @@ -280,6 +296,12 @@ jobs:
with:
name: chipdb-${{ matrix.family }}
path: chipdb
- name: Unpack chipdb
run: |
set -euo pipefail
tar -C chipdb -xf "chipdb/chipdb-${{ matrix.family }}.tar"
rm -f "chipdb/chipdb-${{ matrix.family }}.tar"
ls -la chipdb
- uses: DeterminateSystems/nix-installer-action@v14
# v6: the last release before the FlakeHub cache requirement --
# uses the native GitHub Actions cache directly, no token needed.
Expand Down Expand Up @@ -337,6 +359,12 @@ jobs:
with:
name: chipdb-artix7
path: chipdb
- name: Unpack chipdb
run: |
set -euo pipefail
tar -C chipdb -xf "chipdb/chipdb-artix7.tar"
rm -f "chipdb/chipdb-artix7.tar"
ls -la chipdb
- uses: DeterminateSystems/nix-installer-action@v14
# v6: the last release before the FlakeHub cache requirement --
# uses the native GitHub Actions cache directly, no token needed.
Expand Down
Binary file modified blinky-digilent-arty/blinky.bit
Binary file not shown.
Binary file modified blinky-digilent-basys-3/blinky.bit
Binary file not shown.
Binary file modified blinky-digilent-zybo/blinky.bit
Binary file not shown.
Binary file modified blinky-genesys2/blinky.bit
Binary file not shown.
Binary file modified blinky-kc705/blinky.bit
Binary file not shown.
Binary file modified blinky-qmtech/blinky.bit
Binary file not shown.
Binary file modified blinky-stlv7325/blinky.bit
Binary file not shown.
7 changes: 6 additions & 1 deletion ddr3-test-arty-s7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ FAMILY = spartan7
PART = xc7s50csga324-1
CHIPDB = ${SPARTAN7_CHIPDB}
ADDITIONAL_SOURCES = ddr3_controller.v ddr3_phy.v ddr3_top.v uart.v uart_rx.v uart_tx.v clk_wiz_0.v clk_wiz_0_clk_wiz.v
PNR_ARGS = --pre-place constraints.py --pre-route show_bels.py
# constraints.py/show_bels.py pinned the read-calibration SERDES off the
# _SING tiles, whose PIPs prjxray lacked. The current database has them, so
# the design routes without the pinning. Timing is allowed to fail: the
# controller clock has never met its derived constraint (a round-trip
# check is what verify.py does on hardware).
PNR_ARGS = --timing-allow-fail
include ../openXC7.mk
19 changes: 0 additions & 19 deletions ddr3-test-arty-s7/constraints.py

This file was deleted.

21 changes: 0 additions & 21 deletions ddr3-test-arty-s7/show_bels.py

This file was deleted.

2 changes: 2 additions & 0 deletions litex-ddr-enclustra-kx2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ CHIPDB = ${KINTEX7_CHIPDB}
VEXRISCV=../vexriscv
ADDITIONAL_SOURCES = ${VEXRISCV}/VexRiscv.v

PNR_ARGS = --timing-allow-fail

include ../openXC7.mk
1 change: 0 additions & 1 deletion litex-ddr-enclustra-kx2/enclustra_mercury_kx2.xdc
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ set_property LOC AB7 [get_ports {ddram0_reset_n}]
set_property SLEW FAST [get_ports {ddram0_reset_n}]
set_property VCCAUX_IO HIGH [get_ports {ddram0_reset_n}]
set_property IOSTANDARD SSTL15 [get_ports {ddram0_reset_n}]
set_property SLEW SLOW [get_ports {ddram0_reset_n}]

# user_led:0
set_property LOC U9 [get_ports {user_led0}]
Expand Down
1 change: 0 additions & 1 deletion litex-ddr-hdmi-enclustra-kx2/enclustra_mercury_kx2.xdc
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ set_property LOC AB7 [get_ports {ddram0_reset_n}]
set_property SLEW FAST [get_ports {ddram0_reset_n}]
set_property VCCAUX_IO HIGH [get_ports {ddram0_reset_n}]
set_property IOSTANDARD SSTL15 [get_ports {ddram0_reset_n}]
set_property SLEW SLOW [get_ports {ddram0_reset_n}]

# user_led:0
set_property LOC U9 [get_ports {user_led0}]
Expand Down
2 changes: 2 additions & 0 deletions litex-ddr-hpcstore-k420t/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ CHIPDB = ${KINTEX7_CHIPDB}
VEXRISCV=../vexriscv
ADDITIONAL_SOURCES=${VEXRISCV}/VexRiscv.v

PNR_ARGS = --timing-allow-fail

include ../openXC7.mk
2 changes: 2 additions & 0 deletions litex-ddr-kc705/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ CHIPDB = ${KINTEX7_CHIPDB}
VEXRISCV=../vexriscv
ADDITIONAL_SOURCES=${VEXRISCV}/VexRiscv.v

PNR_ARGS = --timing-allow-fail

include ../openXC7.mk
2 changes: 2 additions & 0 deletions litex-ddr-qmtech-artix7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ CHIPDB = ${ARTIX7_CHIPDB}
VEXRISCV=../vexriscv
ADDITIONAL_SOURCES = ${VEXRISCV}/VexRiscv.v

PNR_ARGS = --timing-allow-fail

include ../openXC7.mk
2 changes: 2 additions & 0 deletions litex-ddr-qmtech-kintex7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ edif: ${PROJECT}.json
netlist2json: verilog-netlist.v
yosys -p "read_verilog verilog-netlist.v; hierarchy; synth_xilinx -flatten -abc9 -arch xc7 -top ${PROJECT}; write_json ${PROJECT}.json;"

PNR_ARGS = --timing-allow-fail

include ../openXC7.mk
2 changes: 2 additions & 0 deletions litex-ddr-stlv7325/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ CHIPDB = ${KINTEX7_CHIPDB}
VEXRISCV=../vexriscv
ADDITIONAL_SOURCES=${VEXRISCV}/VexRiscv.v

PNR_ARGS = --timing-allow-fail

include ../openXC7.mk

31 changes: 17 additions & 14 deletions openXC7.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ JTAG_LINK ?= --board ${BOARD}

XDC ?= ${PROJECT}.xdc

# fasm2frames writes its target through a shell redirection, so a failure part-way
# leaves a truncated .frames that is NEWER than its prerequisite. The next make then
# skips regenerating it and feeds the partial file to xc7frames2bit, which happily
# produces a normal-looking ~9.7 MB bitstream. It flashes, reports done 1, and the
# board does nothing -- done 1 means configuration completed, not that the design works.
# A CI matrix that checks only "was a .bit produced" reports green on exactly this.
# fpga-as writes its target through a shell redirection, so a failure part-way
# leaves a truncated .bit that is NEWER than its prerequisite. The next make then
# skips regenerating it, and a truncated bitstream flashes, reports done 1, and
# the board does nothing -- done 1 means configuration completed, not that the
# design works. A CI matrix that checks only "was a .bit produced" reports green
# on exactly this.
#
# .DELETE_ON_ERROR makes make remove a target whose recipe failed, so the next run
# rebuilds it instead of building on top of the wreckage. It covers .fasm, .json and
# .bit as well, at no cost when nothing fails.
# .DELETE_ON_ERROR makes make remove a target whose recipe failed, so the next
# run rebuilds it instead of building on top of the wreckage. It covers .fasm,
# .json and .bit as well, at no cost when nothing fails.
.DELETE_ON_ERROR:

.PHONY: all
Expand Down Expand Up @@ -66,11 +66,14 @@ ${CHIPDB}/${DBPART}.bin:
${PROJECT}.fasm: ${PROJECT}.json ${CHIPDB}/${DBPART}.bin ${XDC}
nextpnr-xilinx --chipdb ${CHIPDB}/${DBPART}.bin --xdc ${XDC} --json ${PROJECT}.json --fasm $@ ${PNR_ARGS} ${PNR_DEBUG}

${PROJECT}.frames: ${PROJECT}.fasm
fasm2frames --part ${PART} --db-root ${PRJXRAY_DB_DIR}/${FAMILY} $< > $@

${PROJECT}.bit: ${PROJECT}.frames
xc7frames2bit --part_file ${PRJXRAY_DB_DIR}/${FAMILY}/${PART}/part.yaml --part_name ${PART} --frm_file $< --output_file $@
# fpga-as assembles the FASM into the bitstream in one process, where
# fasm2frames and xc7frames2bit needed two plus the .frames file between them.
# Its frames match that pair's on the designs in this repo -- artix7, kintex7,
# spartan7 and zynq7, compared frame by frame through its --dump_frames_file,
# bar two words in each of two transceiver frames of
# litex-sata-alientek-davincipro -- and it is 9x to 120x faster doing it.
${PROJECT}.bit: ${PROJECT}.fasm
fpga-as --prjxray_db_path=${PRJXRAY_DB_DIR}/${FAMILY} --part ${PART} $< > $@

.PHONY: clean
clean:
Expand Down
Loading