From df626388bb9ba98672216bc4a283a90cacbf6c48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Thu, 10 Jan 2019 22:35:51 +0100
Subject: [PATCH] Makefile rules for nextpnr place and route

---
 hw/Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/Makefile b/hw/Makefile
index c7e832a..a7dbd21 100644
--- a/hw/Makefile
+++ b/hw/Makefile
@@ -90,6 +90,18 @@ top-ice40.blif: top-ice40.vl cpu-all.vl reg-file-ice40.vl mem-mux.vl \
 	yosys -q -p 'synth_ice40' -f 'verilog -sv -DICE40' -L top-ice40.stats \
 	-b 'blif -gates -attr -param' $< -o $@
 
+top-ice40.json: top-ice40.vl cpu-all.vl reg-file-ice40.vl mem-mux.vl \
+	alu-unit.vl unary-unit.vl shift-unit.vl cnt-unit.vl \
+	mul-unit.vl reciprocal-unit.vl \
+	instr-fetch.vl instr-decode.vl ctz.vl popc.vl srt-reciprocal.vl \
+	add-ha.vl add-fa.vl cpu.vl \
+	ram-unit.vl avr109rx.vl avr109tx.vl tty-ice40.vl
+
+	yosys -q -p 'synth_ice40 -json top-ice40.json' -f 'verilog -sv -DICE40' -L top-ice40-json.stats $<
+
+top-ice40-nextpnr.asc: top-ice40.json top-ice40.pcf
+	nextpnr-ice40 --hx8k --json $< --pcf top-ice40.pcf --asc $@
+
 top-ice40.asc: top-ice40.blif top-ice40.pcf
 	arachne-pnr -d 8k -p top-ice40.pcf -o $@ $<
 
-- 
GitLab