#!/bin/sh # SPDX-License-Identifier: Apache-2.0 # Build the engine's bitstream and convert it for the Linux FPGA manager. Needs the vendor's tool on # PATH, at the version this design was built and measured with: Vivado 2026.1 (landscape.tcl stops on # any other). Its no-charge licence tier covers this part. The design uses no licensed IP: its vendor # blocks are the processing system's configuration and, in the AXI build, the tool's AXI width and # protocol converters. Run from an empty directory: # sh /path/to/wai-quantum-landscape-fpga/scripts/build_bitstream.sh [MHz] [cores] [axi|emio] # The AXI link is the default; the multi-core build (cores above 1) has the EMIO link only. # JOBS (default 4) is how many tool runs go at once. On a small machine, run with JOBS=1 and a memory # cap: the tool peaked at 5.1 GB alone, and a machine with 15 GB shared with other work ran out. set -e FREQ=${1:-100} CORES=${2:-1} LINK=${3:-axi} if [ "$CORES" -gt 1 ]; then LINK=emio; fi HERE=$(cd "$(dirname "$0")/.." && pwd) vivado -version | head -1 vivado -mode batch -nojournal -source "$HERE/landscape.tcl" -tclargs FREQ "$FREQ" TAG landscape JOBS "${JOBS:-4}" CORES "$CORES" LINK "$LINK" > build.log 2>&1 grep -E "IMPL_STATUS|BITSTREAM" build.log BIT=$(ls ev_landscape/ev_landscape.runs/impl_1/*.bit) printf 'all:\n{\n %s\n}\n' "$BIT" > landscape.bif bootgen -image landscape.bif -arch zynqmp -process_bitstream bin -w on cp "$BIT.bin" landscape.bit.bin grep -A6 "Design Timing Summary" ev_landscape.timing.rpt | tail -1 sha256sum landscape.bit.bin