2
2
CONFIG := none
3
3
# CONFIG := clang
4
4
# CONFIG := gcc
5
- # CONFIG := afl-gcc
6
5
# CONFIG := wasi
7
- # CONFIG := mxe
8
6
# CONFIG := msys2-32
9
7
# CONFIG := msys2-64
10
8
@@ -155,7 +153,7 @@ ifeq ($(OS), Haiku)
155
153
CXXFLAGS += -D_DEFAULT_SOURCE
156
154
endif
157
155
158
- YOSYS_VER := 0.48+0
156
+ YOSYS_VER := 0.49+1
159
157
160
158
# Note: We arrange for .gitcommit to contain the (short) commit hash in
161
159
# tarballs generated with git-archive(1) using .gitattributes. The git repo
@@ -171,7 +169,7 @@ endif
171
169
OBJS = kernel/version_$(GIT_REV ) .o
172
170
173
171
bumpversion :
174
- sed -i " /^YOSYS_VER := / s/+[0-9][0-9]*$$ /+` git log --oneline aaa5347 .. | wc -l` /;" Makefile
172
+ sed -i " /^YOSYS_VER := / s/+[0-9][0-9]*$$ /+` git log --oneline 427b5a2 .. | wc -l` /;" Makefile
175
173
176
174
ABCMKARGS = CC="$(CXX ) " CXX="$(CXX ) " ABC_USE_LIBSTDCXX=1 ABC_USE_NAMESPACE=abc VERBOSE=$(Q )
177
175
@@ -265,16 +263,6 @@ ifeq ($(DISABLE_ABC_THREADS),1)
265
263
ABCMKARGS += "ABC_USE_NO_PTHREADS=1"
266
264
endif
267
265
268
- else ifeq ($(CONFIG),afl-gcc)
269
- CXX = AFL_QUIET=1 AFL_HARDEN=1 afl-gcc
270
- CXXFLAGS += -std=$(CXXSTD ) $(OPT_LEVEL )
271
- ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"
272
-
273
- else ifeq ($(CONFIG),cygwin)
274
- CXX = g++
275
- CXXFLAGS += -std=gnu++11 $(OPT_LEVEL )
276
- ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"
277
-
278
266
else ifeq ($(CONFIG),wasi)
279
267
ifeq ($(WASI_SDK ) ,)
280
268
CXX = clang++
@@ -302,18 +290,6 @@ LINK_ABC := 1
302
290
DISABLE_ABC_THREADS := 1
303
291
endif
304
292
305
- else ifeq ($(CONFIG),mxe)
306
- PKG_CONFIG = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-pkg-config
307
- CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-g++
308
- CXXFLAGS += -std=$(CXXSTD ) $(OPT_LEVEL ) -D_POSIX_SOURCE -Wno-attributes
309
- CXXFLAGS := $(filter-out -fPIC,$(CXXFLAGS ) )
310
- LINKFLAGS := $(filter-out -rdynamic,$(LINKFLAGS ) ) -s
311
- LIBS := $(filter-out -lrt,$(LIBS ) )
312
- ABCMKARGS += ARCHFLAGS="-DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
313
- # TODO: Try to solve pthread linking issue in more appropriate way
314
- ABCMKARGS += LIBS="lib/x86/pthreadVC2.lib -s" LINKFLAGS="-Wl,--allow-multiple-definition" ABC_USE_NO_READLINE=1 CC="/usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc"
315
- EXE = .exe
316
-
317
293
else ifeq ($(CONFIG),msys2-32)
318
294
CXX = i686-w64-mingw32-g++
319
295
CXXFLAGS += -std=$(CXXSTD ) $(OPT_LEVEL ) -D_POSIX_SOURCE -DYOSYS_WIN32_UNIX_DIR
@@ -340,7 +316,7 @@ ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H $(ABC_ARCHFLAGS)"
340
316
LTOFLAGS =
341
317
342
318
else
343
- $(error Invalid CONFIG setting '$(CONFIG ) '. Valid values : clang, gcc, mxe, msys2-32, msys2-64, none)
319
+ $(error Invalid CONFIG setting '$(CONFIG ) '. Valid values : clang, gcc, msys2-32, msys2-64, none)
344
320
endif
345
321
346
322
@@ -392,9 +368,6 @@ ifeq ($(LINK_TERMCAP),1)
392
368
LIBS += -ltermcap
393
369
ABCMKARGS += "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
394
370
endif
395
- ifeq ($(CONFIG ) ,mxe)
396
- LIBS += -ltermcap
397
- endif
398
371
else
399
372
ifeq ($(ENABLE_EDITLINE ) ,1)
400
373
CXXFLAGS += -DYOSYS_ENABLE_EDITLINE
@@ -443,17 +416,12 @@ TCL_INCLUDE ?= /usr/include/$(TCL_VERSION)
443
416
TCL_LIBS ?= -l$(TCL_VERSION )
444
417
endif
445
418
446
- ifeq ($(CONFIG ) ,mxe)
447
- CXXFLAGS += -DYOSYS_ENABLE_TCL
448
- LIBS += -ltcl86 -lwsock32 -lws2_32 -lnetapi32 -lz -luserenv
449
- else
450
419
CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) $(PKG_CONFIG ) --silence-errors --cflags tcl || echo -I$(TCL_INCLUDE ) ) -DYOSYS_ENABLE_TCL
451
420
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) $(PKG_CONFIG ) --silence-errors --libs tcl || echo $(TCL_LIBS ) )
452
421
ifneq (,$(findstring TCL_WITH_EXTERNAL_TOMMATH,$(CXXFLAGS ) ) )
453
422
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) $(PKG_CONFIG ) --silence-errors --libs libtommath || echo)
454
423
endif
455
424
endif
456
- endif
457
425
458
426
ifeq ($(ENABLE_GCOV ) ,1)
459
427
CXXFLAGS += --coverage
@@ -842,71 +810,101 @@ else
842
810
ABCOPT =""
843
811
endif
844
812
845
- # When YOSYS_NOVERIFIC is set as a make variable, also export it to the
846
- # enviornment, so that `YOSYS_NOVERIFIC=1 make test` _and_
847
- # `make test YOSYS_NOVERIFIC=1` will run with verific disabled.
848
- ifeq ($(YOSYS_NOVERIFIC ) ,1)
849
- export YOSYS_NOVERIFIC
850
- endif
851
-
852
- test : $(TARGETS ) $(EXTRA_TARGETS )
813
+ # Tests that generate .mk with tests/gen-tests-makefile.sh
814
+ MK_TEST_DIRS =
815
+ MK_TEST_DIRS += tests/arch/anlogic
816
+ MK_TEST_DIRS += tests/arch/ecp5
817
+ MK_TEST_DIRS += tests/arch/efinix
818
+ MK_TEST_DIRS += tests/arch/gatemate
819
+ MK_TEST_DIRS += tests/arch/gowin
820
+ MK_TEST_DIRS += tests/arch/ice40
821
+ MK_TEST_DIRS += tests/arch/intel_alm
822
+ MK_TEST_DIRS += tests/arch/machxo2
823
+ MK_TEST_DIRS += tests/arch/microchip
824
+ MK_TEST_DIRS += tests/arch/nanoxplore
825
+ MK_TEST_DIRS += tests/arch/nexus
826
+ MK_TEST_DIRS += tests/arch/quicklogic/pp3
827
+ MK_TEST_DIRS += tests/arch/quicklogic/qlf_k6n10f
828
+ MK_TEST_DIRS += tests/arch/xilinx
829
+ MK_TEST_DIRS += tests/opt
830
+ MK_TEST_DIRS += tests/sat
831
+ MK_TEST_DIRS += tests/sim
832
+ MK_TEST_DIRS += tests/svtypes
833
+ MK_TEST_DIRS += tests/techmap
834
+ MK_TEST_DIRS += tests/various
853
835
ifeq ($(ENABLE_VERIFIC ) ,1)
854
- ifeq ($(YOSYS_NOVERIFIC ) ,1)
855
- @echo
856
- @echo "Running tests without verific support due to YOSYS_NOVERIFIC=1"
857
- @echo
858
- else
859
- +cd tests/verific && bash run-test.sh $(SEEDOPT)
860
- endif
861
- endif
862
- +cd tests/simple && bash run-test.sh $(SEEDOPT)
863
- +cd tests/simple_abc9 && bash run-test.sh $(SEEDOPT)
864
- +cd tests/hana && bash run-test.sh $(SEEDOPT)
865
- +cd tests/asicworld && bash run-test.sh $(SEEDOPT)
866
- # +cd tests/realmath && bash run-test.sh $(SEEDOPT)
867
- +cd tests/share && bash run-test.sh $(SEEDOPT)
868
- +cd tests/opt_share && bash run-test.sh $(SEEDOPT)
869
- +cd tests/fsm && bash run-test.sh $(SEEDOPT)
870
- +cd tests/techmap && bash run-test.sh
871
- +cd tests/memories && bash run-test.sh $(ABCOPT) $(SEEDOPT)
872
- +cd tests/memlib && bash run-test.sh $(SEEDOPT)
873
- +cd tests/bram && bash run-test.sh $(SEEDOPT)
874
- +cd tests/various && bash run-test.sh
875
- +cd tests/select && bash run-test.sh
876
- +cd tests/sat && bash run-test.sh
877
- +cd tests/sim && bash run-test.sh
878
- +cd tests/svinterfaces && bash run-test.sh $(SEEDOPT)
879
- +cd tests/svtypes && bash run-test.sh $(SEEDOPT)
880
- +cd tests/proc && bash run-test.sh
881
- +cd tests/blif && bash run-test.sh
882
- +cd tests/opt && bash run-test.sh
883
- +cd tests/aiger && bash run-test.sh $(ABCOPT)
884
- +cd tests/arch && bash run-test.sh
885
- +cd tests/arch/ice40 && bash run-test.sh $(SEEDOPT)
886
- +cd tests/arch/xilinx && bash run-test.sh $(SEEDOPT)
887
- +cd tests/arch/ecp5 && bash run-test.sh $(SEEDOPT)
888
- +cd tests/arch/machxo2 && bash run-test.sh $(SEEDOPT)
889
- +cd tests/arch/efinix && bash run-test.sh $(SEEDOPT)
890
- +cd tests/arch/anlogic && bash run-test.sh $(SEEDOPT)
891
- +cd tests/arch/gowin && bash run-test.sh $(SEEDOPT)
892
- +cd tests/arch/intel_alm && bash run-test.sh $(SEEDOPT)
893
- +cd tests/arch/nanoxplore && bash run-test.sh $(SEEDOPT)
894
- +cd tests/arch/nexus && bash run-test.sh $(SEEDOPT)
895
- +cd tests/arch/quicklogic/pp3 && bash run-test.sh $(SEEDOPT)
896
- +cd tests/arch/quicklogic/qlf_k6n10f && bash run-test.sh $(SEEDOPT)
897
- +cd tests/arch/gatemate && bash run-test.sh $(SEEDOPT)
898
- +cd tests/arch/microchip && bash run-test.sh $(SEEDOPT)
899
- +cd tests/rpc && bash run-test.sh
900
- +cd tests/memfile && bash run-test.sh
901
- +cd tests/verilog && bash run-test.sh
902
- +cd tests/xprop && bash run-test.sh $(SEEDOPT)
903
- +cd tests/fmt && bash run-test.sh
904
- +cd tests/cxxrtl && bash run-test.sh
836
+ ifneq ($(YOSYS_NOVERIFIC ) ,1)
837
+ MK_TEST_DIRS += tests/verific
838
+ endif
839
+ endif
840
+ MK_TEST_DIRS += tests/verilog
841
+
842
+ # Tests that don't generate .mk
843
+ SH_TEST_DIRS =
844
+ SH_TEST_DIRS += tests/simple
845
+ SH_TEST_DIRS += tests/simple_abc9
846
+ SH_TEST_DIRS += tests/hana
847
+ SH_TEST_DIRS += tests/asicworld
848
+ # SH_TEST_DIRS += tests/realmath
849
+ SH_TEST_DIRS += tests/share
850
+ SH_TEST_DIRS += tests/opt_share
851
+ SH_TEST_DIRS += tests/fsm
852
+ SH_TEST_DIRS += tests/memlib
853
+ SH_TEST_DIRS += tests/bram
854
+ SH_TEST_DIRS += tests/svinterfaces
855
+ SH_TEST_DIRS += tests/xprop
856
+ SH_TEST_DIRS += tests/select
857
+ SH_TEST_DIRS += tests/proc
858
+ SH_TEST_DIRS += tests/blif
859
+ SH_TEST_DIRS += tests/arch
860
+ SH_TEST_DIRS += tests/rpc
861
+ SH_TEST_DIRS += tests/memfile
862
+ SH_TEST_DIRS += tests/fmt
863
+ SH_TEST_DIRS += tests/cxxrtl
905
864
ifeq ($(ENABLE_FUNCTIONAL_TESTS ) ,1)
906
- +cd tests/functional && bash run-test.sh
907
- endif
865
+ SH_TEST_DIRS += tests/functional
866
+ endif
867
+
868
+ # Tests that don't generate .mk and need special args
869
+ SH_ABC_TEST_DIRS =
870
+ SH_ABC_TEST_DIRS += tests/memories
871
+ SH_ABC_TEST_DIRS += tests/aiger
872
+ SH_ABC_TEST_DIRS += tests/alumacc
873
+
874
+ # seed-tests/ is a dummy string, not a directory
875
+ .PHONY : seed-tests
876
+ seed-tests : $(SH_TEST_DIRS:%=seed-tests/% )
877
+ .PHONY : seed-tests/%
878
+ seed-tests/% : % /run-test.sh $(TARGETS ) $(EXTRA_TARGETS )
879
+ +cd $* && bash run-test.sh $(SEEDOPT )
880
+ +@echo " ...passed tests in $* "
881
+
882
+ # abcopt-tests/ is a dummy string, not a directory
883
+ .PHONY : abcopt-tests
884
+ abcopt-tests : $(SH_ABC_TEST_DIRS:%=abcopt-tests/% )
885
+ abcopt-tests/% : % /run-test.sh $(TARGETS ) $(EXTRA_TARGETS )
886
+ +cd $* && bash run-test.sh $(ABCOPT ) $(SEEDOPT )
887
+ +@echo " ...passed tests in $* "
888
+
889
+ # makefile-tests/ is a dummy string, not a directory
890
+ .PHONY : makefile-tests
891
+ makefile-tests : $(MK_TEST_DIRS:%=makefile-tests/% )
892
+ # this target actually emits .mk files
893
+ % .mk :
894
+ +cd $(dir $* ) && bash run-test.sh
895
+ # this one spawns submake on each
896
+ makefile-tests/% : % /run-test.mk $(TARGETS ) $(EXTRA_TARGETS )
897
+ $(MAKE ) -C $* -f run-test.mk
898
+ +@echo " ...passed tests in $* "
899
+
900
+ test : makefile-tests abcopt-tests seed-tests
908
901
@echo " "
909
902
@echo " Passed \" make test\" ."
903
+ ifeq ($(ENABLE_VERIFIC ) ,1)
904
+ ifeq ($(YOSYS_NOVERIFIC ) ,1)
905
+ @echo " Ran tests without verific support due to YOSYS_NOVERIFIC=1."
906
+ endif
907
+ endif
910
908
@echo ""
911
909
912
910
VALGRIND ?= valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes --errors-for-leak-kinds=all
@@ -1101,19 +1099,6 @@ vcxsrc: $(GENFILES) $(EXTRA_TARGETS)
1101
1099
zip -r yosys-win32-vcxsrc-$(YOSYS_VER ) .zip yosys-win32-vcxsrc-$(YOSYS_VER ) /
1102
1100
rm -f srcfiles.txt kernel/version.cc
1103
1101
1104
- ifeq ($(CONFIG ) ,mxe)
1105
- mxebin : $(TARGETS ) $(EXTRA_TARGETS )
1106
- rm -rf yosys-win32-mxebin-$(YOSYS_VER ) {,.zip}
1107
- mkdir -p yosys-win32-mxebin-$(YOSYS_VER )
1108
- cp -r $(PROGRAM_PREFIX ) yosys.exe share/ yosys-win32-mxebin-$(YOSYS_VER ) /
1109
- ifeq ($(ENABLE_ABC ) ,1)
1110
- cp -r $(PROGRAM_PREFIX)yosys-abc.exe abc/lib/x86/pthreadVC2.dll yosys-win32-mxebin-$(YOSYS_VER)/
1111
- endif
1112
- echo -en 'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-$(YOSYS_VER)/readme.txt
1113
- echo -en 'Documentation at https://yosyshq.net/yosys/.\r\n' >> yosys-win32-mxebin-$(YOSYS_VER)/readme.txt
1114
- zip -r yosys-win32-mxebin-$(YOSYS_VER).zip yosys-win32-mxebin-$(YOSYS_VER)/
1115
- endif
1116
-
1117
1102
config-clean : clean
1118
1103
rm -f Makefile.conf
1119
1104
@@ -1129,9 +1114,6 @@ config-gcc-static: clean
1129
1114
echo ' ENABLE_READLINE := 0' >> Makefile.conf
1130
1115
echo ' ENABLE_TCL := 0' >> Makefile.conf
1131
1116
1132
- config-afl-gcc : clean
1133
- echo ' CONFIG := afl-gcc' > Makefile.conf
1134
-
1135
1117
config-wasi : clean
1136
1118
echo ' CONFIG := wasi' > Makefile.conf
1137
1119
echo ' ENABLE_TCL := 0' >> Makefile.conf
@@ -1140,10 +1122,6 @@ config-wasi: clean
1140
1122
echo ' ENABLE_READLINE := 0' >> Makefile.conf
1141
1123
echo ' ENABLE_ZLIB := 0' >> Makefile.conf
1142
1124
1143
- config-mxe : clean
1144
- echo ' CONFIG := mxe' > Makefile.conf
1145
- echo ' ENABLE_PLUGINS := 0' >> Makefile.conf
1146
-
1147
1125
config-msys2-32 : clean
1148
1126
echo ' CONFIG := msys2-32' > Makefile.conf
1149
1127
echo " PREFIX := $( MINGW_PREFIX) " >> Makefile.conf
@@ -1152,9 +1130,6 @@ config-msys2-64: clean
1152
1130
echo ' CONFIG := msys2-64' > Makefile.conf
1153
1131
echo " PREFIX := $( MINGW_PREFIX) " >> Makefile.conf
1154
1132
1155
- config-cygwin : clean
1156
- echo ' CONFIG := cygwin' > Makefile.conf
1157
-
1158
1133
config-gcov : clean
1159
1134
echo ' CONFIG := gcc' > Makefile.conf
1160
1135
echo ' ENABLE_GCOV := 1' >> Makefile.conf
@@ -1183,5 +1158,5 @@ echo-cxx:
1183
1158
-include kernel/*.d
1184
1159
-include techlibs/*/*.d
1185
1160
1186
- .PHONY : all top-all abc test install install-abc docs clean mrproper qtcreator coverage vcxsrc mxebin
1187
- .PHONY : config-clean config-clang config-gcc config-gcc-static config-afl-gcc config- gprof config-sudo
1161
+ .PHONY : all top-all abc test install install-abc docs clean mrproper qtcreator coverage vcxsrc
1162
+ .PHONY : config-clean config-clang config-gcc config-gcc-static config-gprof config-sudo
0 commit comments