From f175b74903524895ba3a9327b5a2b59108a327e7 Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Sat, 15 Feb 2020 14:33:39 +0100 Subject: [PATCH] yosys example makefile --- Makefile | 10 ++++++++++ mk/synthesis-yosys.mk | 22 +++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ddce7be --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +YOSYS_TOP=/tmp/yosys_top +LIBERTY_FILE=/path/to/alliance-check-toolkit/cells/nsxlib/nsxlib.lib + +include mk/synthesis-yosys.mk + +top.blif: top.il + +clean: + rm *.blif + rm *.tcl diff --git a/mk/synthesis-yosys.mk b/mk/synthesis-yosys.mk index dffe7ed..b044aa1 100644 --- a/mk/synthesis-yosys.mk +++ b/mk/synthesis-yosys.mk @@ -1,10 +1,14 @@ $(info Logical synthesis is using Yosys.) - ifeq ($(YOSYS_TOP),) - $(error YOSYS_TOP has not been set) + #ifeq ($(YOSYS_TOP),) + # $(error YOSYS_TOP has not been set) + #endif + + ifeq ($(LIBERTY_FILE),) + $(error LIBERTY_FILE has not been set) endif - + ifeq ($(YOSYS_FLATTEN),) YOSYS_FLATTEN = No endif @@ -31,12 +35,12 @@ %.blif: ./non_generated/%.blif ; cp $< . -%.blif: %.v +%.blif: %.il rm -f $*.tcl; \ - echo "set ilang_file $*.v" >> $*.tcl; \ + echo "set ilang_file $*.il" >> $*.tcl; \ echo "set ilang_top $*" >> $*.tcl; \ - echo "set liberty_file $(LIBERTY_FILE)" >> $*.tcl; \ - echo "yosys read_ilang \$$ilang_file" >> $*.tcl; \ + echo "set liberty_file $(LIBERTY_FILE)" >> $*.tcl; \ + echo "yosys read_ilang \$$ilang_file" >> $*.tcl; \ echo "yosys hierarchy -check -top \$$ilang_top" >> $*.tcl; \ echo "yosys synth -top \$$ilang_top" >> $*.tcl; \ if [ "$(YOSYS_FLATTEN)" = "Yes" ]; then \ @@ -49,5 +53,5 @@ echo "yosys write_blif $*.blif" >> $*.tcl; yosys -c $*.tcl -$(addsuffix .vst,$(NETLISTS_SYNTH)): $(VLOG_MODULE).blif - -@$(call run_if_older,$@,$(VLOG_MODULE).blif,$(call scl_cols,eval `$(CORIOLIS_TOP)/etc/coriolis2/coriolisEnv.py $(DEBUG_OPTION)`; $(BLIF2VST) $(VST_FLAGS) --cell=$(VLOG_MODULE)) ) +#$(addsuffix .vst,$(NETLISTS_SYNTH)): $(VLOG_MODULE).blif +# -@$(call run_if_older,$@,$(VLOG_MODULE).blif,$(call scl_cols,eval `$(CORIOLIS_TOP)/etc/coriolis2/coriolisEnv.py $(DEBUG_OPTION)`; $(BLIF2VST) $(VST_FLAGS) --cell=$(VLOG_MODULE)) ) -- 2.30.2