CRAFT cycle · Mon 5/25 · merged D1+D2 session — Part 1 of 2
HDL for Digital System Design · UCF ECE · Barcelona Summer 2026
| Phase | Time | Activity |
|---|---|---|
| 🌍 Contextualize | 5 min | Gaudí, parallel structures, why HDL is here |
| ⚠️ Reframe | 30 min | HDL ≠ software · toolchain · setup walkthrough (Day 1 only) |
| 🛠 Assemble | 65 min | LED on · buttons-to-LEDs · logic mods · flash the board |
| 🛡 Fortify | 35 min | Testbench, sim PASS/FAIL, common-pitfall sweep |
| 🔗 Transfer | 15 min | Debrief · preview Day 2 · share boards |
▸ Phase 1 of 5 · ~5 min
A Barcelona hook for today's concept
Antoni Gaudí designed in parallel structures: hundreds of columns rising at once, each carrying its own load, all standing simultaneously.
Hardware description is the same discipline. You describe things that exist at the same time — not steps in a recipe.
▸ Phase 2 of 5 · ~30 min · Setup-heavy on Day 1
Sharper lens on the pre-class video + getting everyone onto silicon
“HDL is just another programming language. Lines execute top-to-bottom; assign is like a variable assignment.”
HDL describes physical hardware that runs in parallel. Every assign is a wire. Every always block is a circuit that is always energized.
yosys → nextpnr → icepack → iceprog
HDL becomes a netlist of LUTs, then a bitstream, then real logic on the iCE40.
iverilog + vvp → optional GTKWave
HDL runs as a model. A testbench drives inputs, checks outputs, prints PASS/FAIL.
edit → make sim → fix until all pass → make prog. Simulation is where you find bugs. Hardware is where you celebrate.
Run these in order. Everyone gets a green line for each before lab starts.
yosys -V # synthesis
nextpnr-ice40 --version # place & route
icepack -h # bitstream packer
iverilog -V # simulation
iceprog # USB programmer (errors w/o board — that's OK)
Usually works out of the box. WSL2 needs usbipd-win to forward the Go Board's USB.
FTDI driver may need brew install / installer. See docs/course_setup_guide.md.
Instructor at the back walks any laptop that fails — no one moves to Assemble without a working chain.
// led_on.v — the simplest possible design
module led_on (
output wire o_LED_1 // a single pin on the chip
);
assign o_LED_1 = 1'b1; // continuously drive HIGH
endmodule
assign = a wire. It is always driven, not "called.".pcf file = the soldering. Maps o_LED_1 to the FPGA pin connected to LED1 on the Go Board.▸ Phase 3 of 5 · ~65 min · You build
Write code, run sims, flash the board
o_LED_1 = 1'b1. Full synth → place & route → bitstream → program. First win: a lit LED.assign statements wire each switch to its LED. First taste of multi-port modules.yosys by hand again.
// Instructor types live, then runs the full flow
module led_on (output wire o_LED_1);
assign o_LED_1 = 1'b1;
endmodule
yosys -p "synth_ice40 -top led_on -json led_on.json" led_on.v
nextpnr-ice40 --hx1k --package vq100 --pcf go_board.pcf \
--json led_on.json --asc led_on.asc
icepack led_on.asc led_on.bin
iceprog led_on.bin # 🎉 LED1 lights
After this, students run their own through the same flow. The Makefile in Ex 5 wraps all four commands into make prog.
module buttons_to_leds (
input wire i_Switch_1, i_Switch_2, i_Switch_3, i_Switch_4,
output wire o_LED_1, o_LED_2, o_LED_3, o_LED_4
);
assign o_LED_1 = i_Switch_1;
assign o_LED_2 = i_Switch_2;
assign o_LED_3 = i_Switch_3;
assign o_LED_4 = i_Switch_4;
endmodule
.pcf file does the rest — every port name must match the constraint file exactly.
When this works, swap one assign for ~, &, |, or ^ — that's Ex 4.
▸ Phase 4 of 5 · ~35 min · Verify, test, harden
Don't trust a blink — prove it
cd labs/week1_day01/ex3_button_logic/starter
make sim # expect "16 passed, 0 failed"
make wave # opens GTKWave for visual debug
=== catches X / Z (not ==)$display prints PASS / FAILmake sim first~ reached silicon.| Symptom | Likely cause | Fix |
|---|---|---|
| "USB device not recognized" | Driver or WSL passthrough | WSL2 → usbipd attach. macOS → install FTDI driver. |
nextpnr error: unconstrained port | Port name ≠ .pcf name | Case-sensitive match. Check go_board.pcf. |
| Programs OK, LED doesn't react | Switch pressed = LOW on Go Board | Read the schematic. Inverted is normal. |
| Yosys warning about latches | Wrong on Day 1 — but real soon (Day 3) | Note it now; we'll dissect on Wed. |
If you can't reproduce a bug in make sim, it's almost always a driver, pin, or polarity issue — not your Verilog.
▸ Phase 5 of 5 · ~15 min
What generalizes? Where will you use this next?
① Parallel mental model. Every line of HDL describes something that is always there.
② Sim → synth → program flow. Every day this trip ends with a working board.
③ Pin constraints are the bridge to physical reality. Without them, your design is academic.
④ AI thread starts Day 4. First three days, build the muscle yourself.
Part 2 of today builds the vocabulary of HDL: wire vs reg, [3:0] vectors, bit slicing, concatenation, and the operators you'll use forever.
You'll build a 4:1 mux, a ripple-carry adder, and a hex-to-7-segment decoder that lights the Go Board's displays.
🔗 End of Part 1 · On to Data Types
Four assign statements. Four LEDs. One working board.
The whole rest of the course is just more of the same — with bigger ideas.