diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2017-01-08 19:12:36 -0600 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2017-01-08 22:02:28 -0600 |
commit | 8d316df61f4b01b6fcd8ca211faa6cb146127528 (patch) | |
tree | 245bb6d7f1c925754f21f1ac12c8b128f0f21a1c /Makefile | |
parent | 57fb3e3646407fe63d3f6ec7394c827d852b8d3f (diff) |
Add synthesis for ICE40 targets
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -4,7 +4,11 @@ IVFLAGS := -g2005-sv SIM_SRCS := $(wildcard *_tb.v) SIMS := $(addprefix sims/,$(SIM_SRCS:.v=.sim)) WAVES := $(addprefix waves/,$(SIM_SRCS:.v=.vcd)) -DIRS := sims waves + +SYNTH_SRCS := $(filter-out %_tb.v,$(wildcard *.v)) +SYNTH_ICE40 := $(addprefix ice40/,$(SYNTH_SRCS:.v=.blif)) + +DIRS := sims waves ice40 DEPS = $(sort $(1) $(foreach d,$(1),$(DEPS-$(d)))) DEPS-alu := $(call DEPS,shifter) @@ -17,6 +21,8 @@ all: simulate simulate: $(WAVES) +synth-ice40: $(SYNTH_ICE40) + clean: rm -rf $(DIRS) @@ -28,6 +34,10 @@ waves/%.vcd: sims/%.sim | waves .SECONDEXPANSION: pc := % + +ice40/%.blif: %.v $$(patsubst $$(pc),$$(pc).v,$$(DEPS-$$*)) | ice40 + yosys $(foreach v,$^,-p "read_verilog $v") -p "synth_ice40 -blif $@" | sed -e "1,/Printing statistics/d" -e "/Executing CHECK/,$$ d" | tee ice40/$*.size + sims/%_tb.sim: %_tb.v %.v testbench.vh $$(patsubst $$(pc),$$(pc).v,$$(DEPS-$$*)) | sims $(IV) $(IVFLAGS) -o $@ $(filter-out %.vh,$^) |