yosys example makefile
authorTobias Platen <tplaten@posteo.de>
Sat, 15 Feb 2020 13:33:39 +0000 (14:33 +0100)
committerTobias Platen <tplaten@posteo.de>
Sat, 15 Feb 2020 13:33:39 +0000 (14:33 +0100)
Makefile [new file with mode: 0644]
mk/synthesis-yosys.mk

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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
index dffe7ed6c3857978d5cca8f3495f41866cf8f5a9..b044aa1fc5a673fde30ccbca89b82b72573d12e5 100644 (file)
@@ -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
 %.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)) )