Skip to content

Commit 5770c14

Browse files
authored
Merge pull request #51 from strath-sdr/update_vivado_2024.1
Update vivado 2024.1
2 parents ff4f4d3 + f32c834 commit 5770c14

6 files changed

Lines changed: 5700 additions & 7550 deletions

File tree

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
name: Vivado Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
boards:
7+
description: "Boards to build: comma-separated (e.g. RFSoC4x2,ZCU208) or 'all'"
8+
required: true
9+
default: "RFSoC4x2,ZCU208,ZCU111,ZCU216,RFSoC2x2"
10+
vivado_settings:
11+
description: "OPTIONAL override: full path to settings64.sh on this runner"
12+
required: false
13+
default: ""
14+
15+
# Only trigger automatically when bitstream inputs change (NOT docs/README edits)
16+
pull_request:
17+
branches: [ main, master ]
18+
paths:
19+
- "ip/**"
20+
- "boards/**/rfsoc_qpsk/rfsoc_qpsk.tcl"
21+
- "boards/**/rfsoc_qpsk/constraints.xdc"
22+
23+
jobs:
24+
prep-matrix:
25+
runs-on: ubuntu-latest
26+
outputs:
27+
matrix: ${{ steps.mk.outputs.matrix }}
28+
should_run: ${{ steps.mk.outputs.should_run }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- id: mk
33+
env:
34+
GH_TOKEN: ${{ github.token }}
35+
shell: bash
36+
run: |
37+
set -euo pipefail
38+
39+
allowed="ZCU111 ZCU208 ZCU216 RFSoC2x2 RFSoC4x2"
40+
41+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
42+
boards_in="${{ github.event.inputs.boards }}"
43+
if [ -z "$boards_in" ]; then boards_in="RFSoC4x2,ZCU208,ZCU111,ZCU216,RFSoC2x2"; fi
44+
45+
if [ "$boards_in" = "all" ]; then
46+
boards="$allowed"
47+
else
48+
boards="$(echo "$boards_in" | tr ',' ' ')"
49+
fi
50+
51+
else
52+
pr_number="${{ github.event.pull_request.number }}"
53+
54+
files="$(gh api "/repos/${{ github.repository }}/pulls/${pr_number}/files" \
55+
--paginate --jq '.[].filename')"
56+
57+
echo "Changed files:"
58+
echo "$files"
59+
60+
# If any shared IP changed, rebuild everything
61+
if echo "$files" | grep -qE '^ip/'; then
62+
boards="$allowed"
63+
else
64+
# Otherwise, rebuild only the boards whose TCL/XDC changed
65+
boards="$(echo "$files" \
66+
| grep -E '^boards/[^/]+/rfsoc_qpsk/(rfsoc_qpsk\.tcl|constraints\.xdc)$' \
67+
| sed -E 's|^boards/([^/]+)/.*|\1|' \
68+
| sort -u || true)"
69+
fi
70+
fi
71+
72+
# Nothing relevant changed -> skip build job
73+
if [ -z "${boards:-}" ]; then
74+
echo "No relevant changes detected; skipping build."
75+
echo 'matrix={"boards":[]}' >> "$GITHUB_OUTPUT"
76+
echo "should_run=false" >> "$GITHUB_OUTPUT"
77+
exit 0
78+
fi
79+
80+
# Validate boards list
81+
for b in $boards; do
82+
ok=0
83+
for a in $allowed; do
84+
[ "$b" = "$a" ] && ok=1
85+
done
86+
[ $ok -eq 1 ] || (echo "Invalid board: $b. Allowed: $allowed" && exit 1)
87+
done
88+
89+
# Build JSON matrix
90+
json='{"boards":['
91+
first=1
92+
for b in $boards; do
93+
[ $first -eq 1 ] || json+=','
94+
json+="\"$b\""
95+
first=0
96+
done
97+
json+=']}'
98+
99+
echo "matrix=$json" >> "$GITHUB_OUTPUT"
100+
echo "should_run=true" >> "$GITHUB_OUTPUT"
101+
echo "Matrix: $json"
102+
103+
build-bitstream:
104+
needs: prep-matrix
105+
if: ${{ needs.prep-matrix.outputs.should_run == 'true' }}
106+
runs-on: [self-hosted, linux, x64]
107+
strategy:
108+
fail-fast: false
109+
matrix: ${{ fromJson(needs.prep-matrix.outputs.matrix) }}
110+
111+
steps:
112+
- uses: actions/checkout@v4
113+
114+
- name: Resolve Vivado settings path
115+
shell: bash
116+
run: |
117+
set -euo pipefail
118+
119+
# Priority:
120+
# 1) workflow_dispatch input (manual override)
121+
# 2) runner env var VIVADO_SETTINGS
122+
V="${{ github.event.inputs.vivado_settings }}"
123+
if [ -n "${V:-}" ]; then
124+
SETTINGS="$V"
125+
elif [ -n "${VIVADO_SETTINGS:-}" ]; then
126+
SETTINGS="$VIVADO_SETTINGS"
127+
else
128+
echo "ERROR: Vivado path not provided."
129+
echo "Set VIVADO_SETTINGS on this self-hosted runner (recommended),"
130+
echo "or supply 'vivado_settings' when manually running the workflow."
131+
exit 1
132+
fi
133+
134+
if [ ! -f "$SETTINGS" ]; then
135+
echo "ERROR: settings64.sh not found at: $SETTINGS"
136+
exit 1
137+
fi
138+
139+
echo "Using: $SETTINGS"
140+
echo "VIVADO_SETTINGS_RESOLVED=$SETTINGS" >> "$GITHUB_ENV"
141+
142+
- name: Run Vivado Build
143+
shell: bash
144+
run: |
145+
set -euo pipefail
146+
source "$VIVADO_SETTINGS_RESOLVED"
147+
cd "boards/${{ matrix.boards }}/rfsoc_qpsk/"
148+
make all
149+
cd ../../..
150+
151+
- name: Create per-board tarball (in RUNNER_TEMP)
152+
shell: bash
153+
run: |
154+
set -euo pipefail
155+
156+
TAR="rfsoc_qpsk_${{ matrix.boards }}_${{ github.sha }}.tar.gz"
157+
TAR_PATH="${RUNNER_TEMP}/${TAR}"
158+
159+
tar -czf "$TAR_PATH" \
160+
--warning=no-file-changed \
161+
--exclude=".git" --exclude=".github" --exclude="**/.Xil" \
162+
--exclude="**/*.jou" --exclude="**/*.log" \
163+
.
164+
165+
echo "TAR_PATH=$TAR_PATH" >> "$GITHUB_ENV"
166+
echo "Created: $TAR_PATH"
167+
168+
- uses: actions/upload-artifact@v4
169+
with:
170+
name: bitstream-archive-${{ matrix.boards }}
171+
path: ${{ env.TAR_PATH }}
172+
retention-days: 7
173+
174+
# Check if it works on hardware
175+
- name: Create pending HW check (PR only)
176+
if: ${{ github.event_name == 'pull_request' }}
177+
env:
178+
GH_TOKEN: ${{ github.token }}
179+
OWNER: ${{ github.repository_owner }}
180+
REPO: ${{ github.event.repository.name }}
181+
SHA: ${{ github.sha }}
182+
BOARD: ${{ matrix.boards }}
183+
shell: bash
184+
run: |
185+
set -euo pipefail
186+
NAME="HW Test (${BOARD})"
187+
188+
# If it already exists (reruns), don't create duplicates.
189+
existing_id="$(gh api \
190+
-H "Accept: application/vnd.github+json" \
191+
"/repos/${OWNER}/${REPO}/commits/${SHA}/check-runs" \
192+
--jq ".check_runs[] | select(.name==\"${NAME}\") | .id" | head -n 1 || true)"
193+
194+
if [ -n "${existing_id:-}" ]; then
195+
echo "Check already exists: ${NAME} (id=${existing_id}). Skipping create."
196+
exit 0
197+
fi
198+
199+
gh api \
200+
-H "Accept: application/vnd.github+json" \
201+
"/repos/${OWNER}/${REPO}/check-runs" \
202+
-f name="${NAME}" \
203+
-f head_sha="${SHA}" \
204+
-f status="in_progress" \
205+
-f "output[title]=Manual hardware test required" \
206+
-f "output[summary]=Download artifact bitstream-archive-${BOARD} from this workflow run, test on ${BOARD}, then comment on the PR:\n\n- /hw-pass ${BOARD}\n- /hw-fail ${BOARD} <reason>\n- /hw-skip ${BOARD} <reason>"

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
</table>
1313

1414
# RFSoC QPSK Transceiver
15-
This repository is only compatible with [PYNQ images v2.7](https://github.com/Xilinx/PYNQ/releases) and greater for the following RFSoC development boards:
15+
This repository has been tested with [PYNQ image v3.1.1](https://github.com/Xilinx/PYNQ/releases) (Vivado 2024.1) for the following RFSoC development boards. Newer PYNQ versions may require different Vivado versions; please verify compatibility against the PYNQ release notes:
1616
* [ZCU208](https://www.xilinx.com/products/boards-and-kits/zcu208.html),
17-
* [ZCU216](https://www.xilinx.com/products/boards-and-kits/zcu216.html),
1817
* [ZCU111](https://www.xilinx.com/products/boards-and-kits/zcu111.html),
19-
* [RFSoC4x2](http://rfsoc-pynq.io/),
20-
* [RFSoC2x2](http://rfsoc-pynq.io/).
18+
* [RFSoC4x2](http://rfsoc-pynq.io/),
19+
* [RFSoC2x2](http://rfsoc-pynq.io/),
20+
21+
The following boards are limited to PYNQ version 2.7 and Vivado 2020.2 since this board is not officially supported by PYNQ and no official SD card image exists:
22+
* [ZCU216](https://www.xilinx.com/products/boards-and-kits/zcu216.html).
23+
24+
The SD card image for this board has been made available from the following repository: [sarafs1926/ZCU216-PYNQ](https://github.com/sarafs1926/ZCU216-PYNQ).
2125

2226
## Introduction
2327
This repo contains all the files needed to build and run the RFSoC QPSK demonstrator that was published in [IEEE Access](https://ieeexplore.ieee.org/document/9139483) and was presented at both [FPL](https://fpl2018.org/) and [XDF](http://www.xilinx.com/xdf) conferences in 2018. The design is a full QPSK transceiver, which transmits and receives randomly-generated pulse-shaped symbols with full carrier and timing synchronisation. [PYNQ](https://github.com/xilinx/pynq) is used to visualise the data at both the DAC and ADC side of the RFSoC data converters, as well as visualising various DSP stages throughout the transmit and receive signal path.
@@ -55,15 +59,14 @@ This repository uses Voila to create simple web applications using Jupyter noteb
5559

5660
## Using the Project Files
5761
The following software is required to use the project files in this repository.
58-
- Vivado Design Suite 2020.2
59-
- System Generator for DSP
60-
- MATLAB R2020a
62+
- Vivado Design Suite 2024.1
63+
- System Generator for DSP (MATLAB R2020a with Vivado Design Suite 2020.2)
6164

6265
### System Generator
6366
The Tx and Rx IPs are in separate directories in `rfsoc_qpsk/boards/ip/sysgen/` that can be opened using the appropriate System Generator dialogue. Due to the large amount of decimation and interpolation in both IPs, simulating the output can take an extraordinarily long time. A less extreme multirate system would simulate much faster!
6467

6568
### Vivado
66-
This project can be built with Vivado from the command line. Open Vivado 2020.2 and execute the following into the tcl console:
69+
This project can be built with Vivado from the command line. Open Vivado 2024.1 and execute the following into the tcl console:
6770

6871
```sh
6972
cd /<repository-location>/boards/<board-name>/rfsoc_qpsk/

0 commit comments

Comments
 (0)