@@ -123,8 +123,8 @@ ifneq ($(shell :; command -v brew),)
123
123
BREW_PREFIX := $(shell brew --prefix) /opt
124
124
$(info $$BREW_PREFIX is [${BREW_PREFIX}])
125
125
ifeq ($(ENABLE_PYOSYS ) ,1)
126
- CXXFLAGS += -I$(BREW_PREFIX ) /boost/include/boost
127
- LINKFLAGS += -L$(BREW_PREFIX ) /boost/lib
126
+ CXXFLAGS += -I$(BREW_PREFIX ) /boost/include
127
+ LINKFLAGS += -L$(BREW_PREFIX ) /boost/lib -L $( BREW_PREFIX ) /boost-python3/lib
128
128
endif
129
129
CXXFLAGS += -I$(BREW_PREFIX ) /readline/include
130
130
LINKFLAGS += -L$(BREW_PREFIX ) /readline/lib
@@ -153,7 +153,14 @@ ifeq ($(OS), Haiku)
153
153
CXXFLAGS += -D_DEFAULT_SOURCE
154
154
endif
155
155
156
- YOSYS_VER := 0.50+0
156
+ YOSYS_VER := 0.51+0
157
+ YOSYS_MAJOR := $(shell echo $(YOSYS_VER ) | cut -d'.' -f1)
158
+ YOSYS_MINOR := $(shell echo $(YOSYS_VER ) | cut -d'.' -f2 | cut -d'+' -f1)
159
+ YOSYS_COMMIT := $(shell echo $(YOSYS_VER ) | cut -d'+' -f2)
160
+ CXXFLAGS += -DYOSYS_VER=\\"$(YOSYS_VER ) \\" \
161
+ -DYOSYS_MAJOR=$(YOSYS_MAJOR ) \
162
+ -DYOSYS_MINOR=$(YOSYS_MINOR ) \
163
+ -DYOSYS_COMMIT=$(YOSYS_COMMIT )
157
164
158
165
# Note: We arrange for .gitcommit to contain the (short) commit hash in
159
166
# tarballs generated with git-archive(1) using .gitattributes. The git repo
@@ -169,7 +176,7 @@ endif
169
176
OBJS = kernel/version_$(GIT_REV ) .o
170
177
171
178
bumpversion :
172
- sed -i " /^YOSYS_VER := / s/+[0-9][0-9]*$$ /+` git log --oneline b5170e1 .. | wc -l` /;" Makefile
179
+ sed -i " /^YOSYS_VER := / s/+[0-9][0-9]*$$ /+` git log --oneline c4b5190 .. | wc -l` /;" Makefile
173
180
174
181
ABCMKARGS = CC="$(CXX ) " CXX="$(CXX ) " ABC_USE_LIBSTDCXX=1 ABC_USE_NAMESPACE=abc VERBOSE=$(Q )
175
182
@@ -330,8 +337,13 @@ TARGETS += libyosys.so
330
337
endif
331
338
332
339
ifeq ($(ENABLE_PYOSYS ) ,1)
340
+ # python-config --ldflags includes -l and -L, but LINKFLAGS is only -L
341
+ LINKFLAGS += $(filter-out -l% ,$(shell $(PYTHON_CONFIG ) --ldflags) )
342
+ LIBS += $(shell $(PYTHON_CONFIG ) --libs)
343
+ CXXFLAGS += $(shell $(PYTHON_CONFIG ) --includes) -DWITH_PYTHON
344
+
333
345
# Detect name of boost_python library. Some distros use boost_python-py<version>, other boost_python<version>, some only use the major version number, some a concatenation of major and minor version numbers
334
- CHECK_BOOST_PYTHON = (echo "int main(int argc, char ** argv) {return 0;}" | $(CXX ) -xc -o /dev/null $(shell $(PYTHON_CONFIG ) --ldflags ) -l$(1 ) - > /dev/null 2>&1 && echo "-l$(1 ) ")
346
+ CHECK_BOOST_PYTHON = (echo "int main(int argc, char ** argv) {return 0;}" | $(CXX ) -xc -o /dev/null $(LINKFLAGS ) $(LIBS ) -l$(1 ) - > /dev/null 2>&1 && echo "-l$(1 ) ")
335
347
BOOST_PYTHON_LIB ?= $(shell \
336
348
$(call CHECK_BOOST_PYTHON,boost_python-py$(subst .,,$(PYTHON_VERSION ) ) ) || \
337
349
$(call CHECK_BOOST_PYTHON,boost_python-py$(PYTHON_MAJOR_VERSION ) ) || \
@@ -343,11 +355,7 @@ ifeq ($(BOOST_PYTHON_LIB),)
343
355
$(error BOOST_PYTHON_LIB could not be detected. Please define manually)
344
356
endif
345
357
346
- LIBS += $(shell $(PYTHON_CONFIG ) --libs) $(BOOST_PYTHON_LIB ) -lboost_system -lboost_filesystem
347
- # python-config --ldflags includes LIBS for some reason
348
- LINKFLAGS += $(filter-out -l% ,$(shell $(PYTHON_CONFIG ) --ldflags) )
349
- CXXFLAGS += $(shell $(PYTHON_CONFIG ) --includes) -DWITH_PYTHON
350
-
358
+ LIBS += $(BOOST_PYTHON_LIB ) -lboost_system -lboost_filesystem
351
359
PY_WRAPPER_FILE = kernel/python_wrappers
352
360
OBJS += $(PY_WRAPPER_FILE ) .o
353
361
PY_GEN_SCRIPT = py_wrap_generator
@@ -651,6 +659,9 @@ OBJS += libs/fst/fastlz.o
651
659
OBJS += libs/fst/lz4.o
652
660
endif
653
661
662
+ techlibs/% _pm.h : passes/pmgen/pmgen.py techlibs/% .pmg
663
+ $(P ) mkdir -p $(dir $@ ) && $(PYTHON_EXECUTABLE ) $< -o $@ -p $(notdir $* ) $(filter-out $< ,$^ )
664
+
654
665
ifneq ($(SMALL ) ,1)
655
666
656
667
OBJS += libs/subcircuit/subcircuit.o
@@ -775,6 +786,15 @@ check-git-abc:
775
786
elif [ -f " $( YOSYS_SRC) /abc/.gitcommit" ] && ! grep -q ' \$$Format:%[hH]\$$' " $( YOSYS_SRC) /abc/.gitcommit" ; then \
776
787
echo " 'abc' comes from a tarball. Continuing." ; \
777
788
exit 0; \
789
+ elif git -C " $( YOSYS_SRC) " submodule status abc 2> /dev/null | grep -q ' ^+' ; then \
790
+ echo " 'abc' submodule does not match expected commit." ; \
791
+ echo " Run 'git submodule update' to check out the correct version." ; \
792
+ echo " Note: If testing a different version of abc, call 'git commit abc' in the Yosys source directory to update the expected commit." ; \
793
+ exit 1; \
794
+ elif git -C " $( YOSYS_SRC) " submodule status abc 2> /dev/null | grep -q ' ^U' ; then \
795
+ echo " 'abc' submodule has merge conflicts." ; \
796
+ echo " Please resolve merge conflicts before continuing." ; \
797
+ exit 1; \
778
798
elif [ -f " $( YOSYS_SRC) /abc/.gitcommit" ] && grep -q ' \$$Format:%[hH]\$$' " $( YOSYS_SRC) /abc/.gitcommit" ; then \
779
799
echo " Error: 'abc' is not configured as a git submodule." ; \
780
800
echo " To resolve this:" ; \
@@ -997,6 +1017,18 @@ docs/source/cell/word_add.rst: $(TARGETS) $(EXTRA_TARGETS)
997
1017
docs/source/generated/cells.json : docs/source/generated $(TARGETS ) $(EXTRA_TARGETS )
998
1018
$(Q ) ./$(PROGRAM_PREFIX ) yosys -p ' help -dump-cells-json $@'
999
1019
1020
+ docs/source/generated/% .cc : backends/% .cc
1021
+ $(Q ) mkdir -p $(@D )
1022
+ $(Q ) cp $< $@
1023
+
1024
+ # diff returns exit code 1 if the files are different, but it's not an error
1025
+ docs/source/generated/functional/rosette.diff : backends/functional/smtlib.cc backends/functional/smtlib_rosette.cc
1026
+ $(Q ) mkdir -p $(@D )
1027
+ $(Q ) diff -U 20 $^ > $@ || exit 0
1028
+
1029
+ PHONY : docs/gen/functional_ir
1030
+ docs/gen/functional_ir : docs/source/generated/functional/smtlib.cc docs/source/generated/functional/rosette.diff
1031
+
1000
1032
PHONY : docs/gen docs/usage docs/reqs
1001
1033
docs/gen : $(TARGETS )
1002
1034
$(Q ) $(MAKE ) -C docs gen
@@ -1032,7 +1064,7 @@ docs/reqs:
1032
1064
$(Q ) $(MAKE ) -C docs reqs
1033
1065
1034
1066
.PHONY : docs/prep
1035
- docs/prep : docs/source/cmd/abc.rst docs/source/generated/cells.json docs/gen docs/usage
1067
+ docs/prep : docs/source/cmd/abc.rst docs/source/generated/cells.json docs/gen docs/usage docs/gen/functional_ir
1036
1068
1037
1069
DOC_TARGET ?= html
1038
1070
docs : docs/prep
@@ -1053,6 +1085,7 @@ clean:
1053
1085
rm -rf vloghtb/Makefile vloghtb/refdat vloghtb/rtl vloghtb/scripts vloghtb/spec vloghtb/check_yosys vloghtb/vloghammer_tb.tar.bz2 vloghtb/temp vloghtb/log_test_*
1054
1086
rm -f tests/svinterfaces/* .log_stdout tests/svinterfaces/* .log_stderr tests/svinterfaces/dut_result.txt tests/svinterfaces/reference_result.txt tests/svinterfaces/a.out tests/svinterfaces/* _syn.v tests/svinterfaces/* .diff
1055
1087
rm -f tests/tools/cmp_tbdata
1088
+ rm -f $(addsuffix /run-test.mk,$(MK_TEST_DIRS ) )
1056
1089
-$(MAKE ) -C docs clean
1057
1090
rm -rf docs/source/cmd docs/util/__pycache__
1058
1091
0 commit comments