#!/bin/sh # build_icebreaker.sh: open-source flow for blinky.sv on an iCEBreaker # (Lattice iCE40UP5K-SG48). Needs yosys, nextpnr-ice40 and icepack; # iceprog (Project IceStorm) or openFPGALoader to program the board. set -e # 1. Synthesis: SystemVerilog -> netlist of iCE40 cells (JSON) # WIDTH = 24 gives a visible blink from the 12 MHz clock. yosys -q -l synth.log -p "read_verilog -sv blinky.sv; chparam -set WIDTH 24 blinky; synth_ice40 -top blinky -json blinky.json" # 2. Place and route, with timing analysis against the 12 MHz target nextpnr-ice40 --up5k --package sg48 --pcf icebreaker_blinky.pcf \ --json blinky.json --asc blinky.asc --freq 12 # 3. Bitstream: text configuration (.asc) -> binary (.bin) icepack blinky.asc blinky.bin # 4. Program the configuration flash on the board (uncomment one) # iceprog blinky.bin # openFPGALoader -b ice40_generic blinky.bin