Skip to content

Commit 40d9e12

Browse files
authored
Merge pull request #90 from SymbiFlow/sync_yosys
Sync yosys
2 parents d8b2d1a + c16d0b2 commit 40d9e12

File tree

369 files changed

+30307
-11306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+30307
-11306
lines changed

CHANGELOG

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Yosys 0.9 .. Yosys 0.9-dev
3939
- Improvements in pmgen: slices, choices, define, generate
4040
- Added "xilinx_srl" for Xilinx shift register extraction
4141
- Removed "shregmap -tech xilinx" (superseded by "xilinx_srl")
42-
- Added "_TECHMAP_WIREINIT_*_" attribute and "_TECHMAP_REMOVEINIT_*_" wire for "techmap" pass
42+
- Added "_TECHMAP_WIREINIT_*_" parameter and "_TECHMAP_REMOVEINIT_*_" wire for "techmap" pass
4343
- Added "-match-init" option to "dff2dffs" pass
4444
- Added "techmap_autopurge" support to techmap
4545
- Added "add -mod <modname[s]>"
@@ -62,11 +62,14 @@ Yosys 0.9 .. Yosys 0.9-dev
6262
- Improved support of $readmem[hb] Memory Content File inclusion
6363
- Added "opt_lut_ins" pass
6464
- Added "logger" pass
65-
- Removed "dffsr2dff" (use opt_rmdff instead)
6665
- Added "design -delete"
6766
- Added "select -unset"
6867
- Use YosysHQ/abc instead of upstream berkeley-abc/abc
6968
- Added $divfloor and $modfloor cells
69+
- Added $adffe, $dffsre, $sdff, $sdffe, $sdffce, $adlatch cells
70+
- Added "dfflegalize" pass
71+
- Added "_TECHMAP_CELLNAME_" parameter for "techmap" pass
72+
- Merged "dffsr2dff", "opt_rmdff", "dff2dffe", "dff2dffs", "peepopt.dffmux" passes into a new "opt_dff" pass
7073

7174
Yosys 0.8 .. Yosys 0.9
7275
----------------------

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ misc/*.py @btut
3333
backends/firrtl @ucbjrl @azidar
3434

3535
passes/sat/qbfsat.cc @boqwxp
36+
passes/sat/qbfsat.h @boqwxp
3637
passes/cmds/exec.cc @boqwxp
3738
passes/cmds/printattrs.cc @boqwxp

Makefile

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ENABLE_GCOV := 0
3030
ENABLE_GPROF := 0
3131
ENABLE_DEBUG := 0
3232
ENABLE_NDEBUG := 0
33+
ENABLE_CCACHE := 0
3334
LINK_CURSES := 0
3435
LINK_TERMCAP := 0
3536
LINK_ABC := 0
@@ -81,7 +82,7 @@ all: top-all
8182
YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
8283
VPATH := $(YOSYS_SRC)
8384

84-
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -D_YOSYS_ -fPIC -I$(PREFIX)/include
85+
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
8586
LDLIBS := $(LDLIBS) -lstdc++ -lm
8687
PLUGIN_LDFLAGS :=
8788

@@ -122,7 +123,7 @@ LDFLAGS += -rdynamic
122123
LDLIBS += -lrt
123124
endif
124125

125-
YOSYS_VER := 0.9+2406
126+
YOSYS_VER := 0.9+3683
126127
GIT_REV := $(shell cd $(YOSYS_SRC) && git rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
127128
OBJS = kernel/version_$(GIT_REV).o
128129

@@ -170,8 +171,7 @@ else
170171
PYTHON_CONFIG := $(PYTHON_EXECUTABLE)-config
171172
endif
172173

173-
PYTHON_PREFIX := $(shell $(PYTHON_CONFIG) --prefix)
174-
PYTHON_DESTDIR := $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)/site-packages
174+
PYTHON_DESTDIR := $(shell $(PYTHON_EXECUTABLE) -c "import site; print(site.getsitepackages()[-1]);")
175175

176176
# Reload Makefile.conf to override python specific variables if defined
177177
ifneq ($(wildcard Makefile.conf),)
@@ -246,7 +246,7 @@ CXXFLAGS := -std=c++11 $(filter-out -fPIC -ggdb,$(CXXFLAGS))
246246
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H -DABC_MEMALIGN=8"
247247
EMCCFLAGS := -Os -Wno-warn-absolute-paths
248248
EMCCFLAGS += --memory-init-file 0 --embed-file share -s NO_EXIT_RUNTIME=1
249-
EMCCFLAGS += -s EXPORTED_FUNCTIONS="['_main','_run','_prompt','_errmsg']"
249+
EMCCFLAGS += -s EXPORTED_FUNCTIONS="['_main','_run','_prompt','_errmsg','_memset']"
250250
EMCCFLAGS += -s TOTAL_MEMORY=134217728
251251
EMCCFLAGS += -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'
252252
# https://github.com/kripken/emscripten/blob/master/src/settings.js
@@ -528,6 +528,10 @@ ifeq ($(ENABLE_COVER),1)
528528
CXXFLAGS += -DYOSYS_ENABLE_COVER
529529
endif
530530

531+
ifeq ($(ENABLE_CCACHE),1)
532+
CXX := ccache $(CXX)
533+
endif
534+
531535
define add_share_file
532536
EXTRA_TARGETS += $(subst //,/,$(1)/$(notdir $(2)))
533537
$(subst //,/,$(1)/$(notdir $(2))): $(2)
@@ -580,13 +584,16 @@ $(eval $(call add_include_file,kernel/modtools.h))
580584
$(eval $(call add_include_file,kernel/macc.h))
581585
$(eval $(call add_include_file,kernel/utils.h))
582586
$(eval $(call add_include_file,kernel/satgen.h))
587+
$(eval $(call add_include_file,kernel/ff.h))
588+
$(eval $(call add_include_file,kernel/ffinit.h))
589+
$(eval $(call add_include_file,kernel/mem.h))
583590
$(eval $(call add_include_file,libs/ezsat/ezsat.h))
584591
$(eval $(call add_include_file,libs/ezsat/ezminisat.h))
585592
$(eval $(call add_include_file,libs/sha1/sha1.h))
586593
$(eval $(call add_include_file,libs/json11/json11.hpp))
587594
$(eval $(call add_include_file,passes/fsm/fsmdata.h))
588595
$(eval $(call add_include_file,frontends/ast/ast.h))
589-
$(eval $(call add_include_file,backends/ilang/ilang_backend.h))
596+
$(eval $(call add_include_file,backends/rtlil/rtlil_backend.h))
590597
$(eval $(call add_include_file,backends/cxxrtl/cxxrtl.h))
591598
$(eval $(call add_include_file,backends/cxxrtl/cxxrtl_vcd.h))
592599
$(eval $(call add_include_file,backends/cxxrtl/cxxrtl_capi.cc))
@@ -595,7 +602,7 @@ $(eval $(call add_include_file,backends/cxxrtl/cxxrtl_vcd_capi.cc))
595602
$(eval $(call add_include_file,backends/cxxrtl/cxxrtl_vcd_capi.h))
596603

597604
OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/yosys.o
598-
OBJS += kernel/cellaigs.o kernel/celledges.o
605+
OBJS += kernel/cellaigs.o kernel/celledges.o kernel/satgen.o kernel/mem.o
599606

600607
kernel/log.o: CXXFLAGS += -DYOSYS_SRC='"$(YOSYS_SRC)"'
601608
kernel/yosys.o: CXXFLAGS += -DYOSYS_DATDIR='"$(DATDIR)"' -DYOSYS_PROGRAM_PREFIX='"$(PROGRAM_PREFIX)"'
@@ -627,7 +634,7 @@ include $(YOSYS_SRC)/techlibs/*/Makefile.inc
627634
else
628635

629636
include $(YOSYS_SRC)/frontends/verilog/Makefile.inc
630-
include $(YOSYS_SRC)/frontends/ilang/Makefile.inc
637+
include $(YOSYS_SRC)/frontends/rtlil/Makefile.inc
631638
include $(YOSYS_SRC)/frontends/ast/Makefile.inc
632639
include $(YOSYS_SRC)/frontends/blif/Makefile.inc
633640

@@ -644,7 +651,7 @@ include $(YOSYS_SRC)/passes/opt/Makefile.inc
644651
include $(YOSYS_SRC)/passes/techmap/Makefile.inc
645652

646653
include $(YOSYS_SRC)/backends/verilog/Makefile.inc
647-
include $(YOSYS_SRC)/backends/ilang/Makefile.inc
654+
include $(YOSYS_SRC)/backends/rtlil/Makefile.inc
648655

649656
include $(YOSYS_SRC)/techlibs/common/Makefile.inc
650657

@@ -654,6 +661,10 @@ ifeq ($(LINK_ABC),1)
654661
OBJS += $(PROGRAM_PREFIX)yosys-libabc.a
655662
endif
656663

664+
# prevent the CXXFLAGS set by this Makefile from reaching abc/Makefile,
665+
# especially the -MD flag which will break the build when CXX is clang
666+
unexport CXXFLAGS
667+
657668
top-all: $(TARGETS) $(EXTRA_TARGETS)
658669
@echo ""
659670
@echo " Build successful."
@@ -679,7 +690,7 @@ endif
679690

680691
%.pyh: %.h
681692
$(Q) mkdir -p $(dir $@)
682-
$(P) cat $< | grep -E -v "#[ ]*(include|error)" | $(LD) -x c++ -o $@ -E -P -
693+
$(P) cat $< | grep -E -v "#[ ]*(include|error)" | $(LD) $(CXXFLAGS) -x c++ -o $@ -E -P -
683694

684695
ifeq ($(ENABLE_PYOSYS),1)
685696
$(PY_WRAPPER_FILE).cc: misc/$(PY_GEN_SCRIPT).py $(PY_WRAP_INCLUDES)
@@ -783,6 +794,7 @@ test: $(TARGETS) $(EXTRA_TARGETS)
783794
+cd tests/arch/anlogic && bash run-test.sh $(SEEDOPT)
784795
+cd tests/arch/gowin && bash run-test.sh $(SEEDOPT)
785796
+cd tests/arch/intel_alm && bash run-test.sh $(SEEDOPT)
797+
+cd tests/arch/nexus && bash run-test.sh $(SEEDOPT)
786798
+cd tests/rpc && bash run-test.sh
787799
+cd tests/memfile && bash run-test.sh
788800
+cd tests/verilog && bash run-test.sh
@@ -839,9 +851,9 @@ ifeq ($(ENABLE_LIBYOSYS),1)
839851
$(INSTALL_SUDO) cp libyosys.so $(DESTDIR)$(LIBDIR)/
840852
$(INSTALL_SUDO) $(STRIP) -S $(DESTDIR)$(LIBDIR)/libyosys.so
841853
ifeq ($(ENABLE_PYOSYS),1)
842-
$(INSTALL_SUDO) mkdir -p $(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
843-
$(INSTALL_SUDO) cp libyosys.so $(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/libyosys.so
844-
$(INSTALL_SUDO) cp misc/__init__.py $(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/
854+
$(INSTALL_SUDO) mkdir -p $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
855+
$(INSTALL_SUDO) cp libyosys.so $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/libyosys.so
856+
$(INSTALL_SUDO) cp misc/__init__.py $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/
845857
endif
846858
endif
847859

@@ -851,9 +863,9 @@ uninstall:
851863
ifeq ($(ENABLE_LIBYOSYS),1)
852864
$(INSTALL_SUDO) rm -vf $(DESTDIR)$(LIBDIR)/libyosys.so
853865
ifeq ($(ENABLE_PYOSYS),1)
854-
$(INSTALL_SUDO) rm -vf $(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/libyosys.so
855-
$(INSTALL_SUDO) rm -vf $(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/__init__.py
856-
$(INSTALL_SUDO) rmdir $(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
866+
$(INSTALL_SUDO) rm -vf $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/libyosys.so
867+
$(INSTALL_SUDO) rm -vf $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/__init__.py
868+
$(INSTALL_SUDO) rmdir $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
857869
endif
858870
endif
859871

backends/aiger/aiger.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct AigerWriter
111111

112112
// promote public wires
113113
for (auto wire : module->wires())
114-
if (wire->name[0] == '\\')
114+
if (wire->name.isPublic())
115115
sigmap.add(wire);
116116

117117
// promote input wires

backends/aiger/xaiger.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ struct XAigerWriter
146146

147147
// promote public wires
148148
for (auto wire : module->wires())
149-
if (wire->name[0] == '\\')
149+
if (wire->name.isPublic())
150150
sigmap.add(wire);
151151

152152
// promote input wires

0 commit comments

Comments
 (0)