tillitis-key/hw/production_test/application_fpga_test_gateware/Makefile
Matthew Mets 072b204d3d
Add (hardware) production tests for the TK-1 and TP-1 (#69)
* ch552 firmware: add ch55x support files directly

* Add sdcc compiler to docker image, for building CH552 firmware

* Rework production test script

* Add menu-based test runner
* Rewrite production test flows as lists of individual tests
* Add both production flows and manual tests to menu

* Switch to using included binaries

* production test: Update message format
* test_txrx_touchpad: Retry if device communications fail
* production test: put all binaries in binaries/ folder
* binaries/top.bin: replace broken binary

* flash_check: Check for explicit flash IDs

* Document most test procedures

* Test plan documentation

* Sample udev rules

* Production test: allow external references to be overridden

* Remove outdated descriptions

* Correct shebang

* Update shebangs to comply with PEP 394

Change the python scripts to call python instead of python3, as this
works cross platform. See:
https://peps.python.org/pep-0394/#for-python-script-publishers

* Move production test to higher-level directory

* Clarify production test setup

* Move USB C connector test to separate directory

Co-authored-by: Michael Cardell Widerkrantz <mc@tillitis.se>
2023-01-11 16:33:01 +01:00

56 lines
1.3 KiB
Makefile

TARGET = top
VERILOG_FILES = \
top.v
PIN_CONFIG_FILE = app.pcf
default: $(TARGET).bin
$(TARGET).json: $(VERILOG_FILES)
yosys \
-q \
-p "synth_ice40 -abc2 -relut -top ${TARGET} -json $(TARGET).json" \
-l $(TARGET)-yosys.log \
$(VERILOG_FILES)
TARGET_MODULE = top
view-ideal:
yosys -p 'read_verilog ${VERILOG_FILES}; proc; opt; select ${TARGET_MODULE}; show -format dot -viewer xdot -pause' &
view-real:
yosys -p 'read_verilog ${VERILOG_FILES}; proc; opt; synth_ice40; show -format dot -viewer xdot -pause' &
$(TARGET).asc: $(TARGET).json $(PIN_CONFIG_FILE)
nextpnr-ice40 \
--up5k \
--package sg48 \
--json $(TARGET).json \
--pcf $(PIN_CONFIG_FILE) \
--asc $(TARGET).asc \
-l $(TARGET)-nextpnr.log
$(TARGET).bin: $(TARGET).asc
icepack $(TARGET).asc $(TARGET).bin
stats: $(TARGET).json $(TARGET).asc
sed -n '/=== top ===/,/6\.28/p' $(TARGET)-yosys.log
sed -n '/Info: Device utilisation/,/Info: Placed/p' $(TARGET)-nextpnr.log
fgrep 'Info: Max frequency for clock' $(TARGET)-nextpnr.log
lint: $(VERILOG_FILES)
verilator --lint-only -Wall -Wno-DECLFILENAME -Ihw_blocks $(VERILOG_FILES)
.PHONY: flash
flash: ${TARGET}.bin
iceprog ${TARGET}.bin
.PHONY: clean
clean:
$(RM) -f \
$(TARGET).json \
$(TARGET).asc \
$(TARGET)-yosys.log \
$(TARGET)-nextpnr.log \
$(TARGET).bin