summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 15 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 25ae12b..9225859 100644
--- a/Makefile
+++ b/Makefile
@@ -3,19 +3,29 @@ DEVICE = hx1k
PKG = tq144
PCF = pins.pcf
-FILES = top.v uart_trx.v
+FILES = top.v uart_tx_8n1.v
.PHONY: all clean burn
all: $(PROJ).bin
-$(PROJ).bin: $(FILES) Makefile
+%.json: $(FILES)
+ # Lint to catch typos
+# verilator --lint-only -Wall $(FILES)
# synthesize using Yosys
- yosys -p "synth_ice40 -top top -json $(PROJ).json" $(FILES)
+ yosys -ql yosys.log -p "synth_ice40 -top top -json $(PROJ).json" $(FILES)
+
+%.asc: %.json
# Place and route using nextpnr
- nextpnr-ice40 --$(DEVICE) --package $(PKG) --pcf $(PCF) --json $(PROJ).json --asc $(PROJ).asc
+ nextpnr-ice40 --$(DEVICE) --package $(PKG) --pcf $(PCF) --json $< --asc $@
+
+%.rpt: %.asc
+ # Timing
+ icetime -d $(DEVICE) -mtr $@ $<
+
+%.bin: %.asc
# Convert to bitstream using IcePack
- icepack $(PROJ).asc $(PROJ).bin
+ icepack $< $@
burn: $(PROJ).bin
iceprog $<