12 # features (the more the better)
29 # other configuration flags
35 # sccache is not always a drop-in replacement for ccache in practice
40 # Needed for environments that can't run executables (i.e. emscripten, wasm)
42 # Needed for environments that don't have proper thread support (i.e. emscripten, wasm--for now)
43 DISABLE_ABC_THREADS
:= 0
49 # SANITIZER = undefined
54 OS
:= $(shell uname
-s
)
58 ifneq ($(wildcard Makefile.conf
),)
62 ifeq ($(ENABLE_PYOSYS
),1)
66 BINDIR
:= $(PREFIX
)/bin
67 LIBDIR
:= $(PREFIX
)/lib
/$(PROGRAM_PREFIX
)yosys
68 DATDIR
:= $(PREFIX
)/share
/$(PROGRAM_PREFIX
)yosys
75 TARGETS
= $(PROGRAM_PREFIX
)yosys
$(EXE
) $(PROGRAM_PREFIX
)yosys-config
81 UNITESTPATH
:= tests
/unit
85 YOSYS_SRC
:= $(dir $(firstword $(MAKEFILE_LIST
)))
88 CXXFLAGS
:= $(CXXFLAGS
) -Wall
-Wextra
-ggdb
-I.
-I
"$(YOSYS_SRC)" -MD
-MP
-D_YOSYS_
-fPIC
-I
$(PREFIX
)/include
89 LDLIBS
:= $(LDLIBS
) -lstdc
++ -lm
92 PKG_CONFIG ?
= pkg-config
99 PLUGIN_LDFLAGS
+= -undefined dynamic_lookup
101 # homebrew search paths
102 ifneq ($(shell :; command
-v brew
),)
103 BREW_PREFIX
:= $(shell brew
--prefix)/opt
104 $(info $$BREW_PREFIX is
[${BREW_PREFIX}])
105 ifeq ($(ENABLE_PYOSYS
),1)
106 CXXFLAGS
+= -I
$(BREW_PREFIX
)/boost
/include/boost
107 LDFLAGS
+= -L
$(BREW_PREFIX
)/boost
/lib
109 CXXFLAGS
+= -I
$(BREW_PREFIX
)/readline
/include
110 LDFLAGS
+= -L
$(BREW_PREFIX
)/readline
/lib
111 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/libffi
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
112 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/tcl-tk
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
113 export PATH
:= $(BREW_PREFIX
)/bison
/bin
:$(BREW_PREFIX
)/gettext
/bin
:$(BREW_PREFIX
)/flex
/bin
:$(PATH
)
115 # macports search paths
116 else ifneq ($(shell :; command
-v port
),)
117 PORT_PREFIX
:= $(patsubst %/bin
/port
,%,$(shell :; command
-v port
))
118 CXXFLAGS
+= -I
$(PORT_PREFIX
)/include
119 LDFLAGS
+= -L
$(PORT_PREFIX
)/lib
120 PKG_CONFIG_PATH
:= $(PORT_PREFIX
)/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
121 export PATH
:= $(PORT_PREFIX
)/bin
:$(PATH
)
129 YOSYS_VER
:= 0.9+4261
130 GIT_REV
:= $(shell git
-C
$(YOSYS_SRC
) rev-parse
--short HEAD
2> /dev
/null || echo UNKNOWN
)
131 OBJS
= kernel
/version_
$(GIT_REV
).o
134 sed
-i
"/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline 8a4c6e6.. | wc -l`/;" Makefile
136 # set 'ABCREV = default' to use abc/ as it is
138 # Note: If you do ABC development, make sure that 'abc' in this directory
139 # is just a symlink to your actual ABC working directory, as 'make mrproper'
140 # will remove the 'abc' directory and you do not want to accidentally
141 # delete your work on ABC..
144 ABCURL ?
= https
://github.com
/YosysHQ
/abc
145 ABCMKARGS
= CC
="$(CXX)" CXX
="$(CXX)" ABC_USE_LIBSTDCXX
=1 VERBOSE
=$(Q
)
147 # set ABCEXTERNAL = <abc-command> to use an external ABC instance
148 # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set.
156 ifneq ($(wildcard Makefile.conf
),)
157 # don't echo Makefile.conf contents when invoked to print source versions
158 ifeq ($(findstring echo-
,$(MAKECMDGOALS
)),)
159 $(info $(subst $$--$$,$(newline
),$(shell sed
's,^,[Makefile.conf] ,; s,$$,$$--$$,;' < Makefile.conf | tr
-d
'\n' | sed
's,\$$--\$$$$,,')))
161 include Makefile.conf
164 PYTHON_EXECUTABLE
:= $(shell if python3
-c
""; then echo
"python3"; else echo
"python"; fi
)
165 ifeq ($(ENABLE_PYOSYS
),1)
166 PYTHON_VERSION_TESTCODE
:= "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));print(t)"
167 PYTHON_VERSION
:= $(shell $(PYTHON_EXECUTABLE
) -c
""$(PYTHON_VERSION_TESTCODE
)"")
168 PYTHON_MAJOR_VERSION
:= $(shell echo
$(PYTHON_VERSION
) | cut
-f1
-d.
)
170 ENABLE_PYTHON_CONFIG_EMBED ?
= $(shell $(PYTHON_EXECUTABLE
)-config
--embed
--libs
> /dev
/null
&& echo
1)
171 ifeq ($(ENABLE_PYTHON_CONFIG_EMBED
),1)
172 PYTHON_CONFIG
:= $(PYTHON_EXECUTABLE
)-config
--embed
174 PYTHON_CONFIG
:= $(PYTHON_EXECUTABLE
)-config
177 PYTHON_DESTDIR
:= $(shell $(PYTHON_EXECUTABLE
) -c
"import site; print(site.getsitepackages()[-1]);")
179 # Reload Makefile.conf to override python specific variables if defined
180 ifneq ($(wildcard Makefile.conf
),)
181 include Makefile.conf
186 ifeq ($(CONFIG
),clang
)
189 CXXFLAGS
+= -std
=c
++11 -Os
190 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
192 ifneq ($(SANITIZER
),)
193 $(info [Clang Sanitizer
] $(SANITIZER
))
194 CXXFLAGS
+= -g
-O1
-fno-omit-frame-pointer
-fno-optimize-sibling-calls
-fsanitize
=$(SANITIZER
)
195 LDFLAGS
+= -g
-fsanitize
=$(SANITIZER
)
196 ifneq ($(findstring address
,$(SANITIZER
)),)
199 ifneq ($(findstring memory
,$(SANITIZER
)),)
200 CXXFLAGS
+= -fPIE
-fsanitize-memory-track-origins
201 LDFLAGS
+= -fPIE
-fsanitize-memory-track-origins
203 ifneq ($(findstring cfi
,$(SANITIZER
)),)
209 else ifeq ($(CONFIG
),gcc
)
212 CXXFLAGS
+= -std
=c
++11 -Os
213 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
215 else ifeq ($(CONFIG
),gcc-static
)
217 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -static
218 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
219 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
220 CXXFLAGS
+= -std
=c
++11 -Os
221 ABCMKARGS
= CC
="$(CC)" CXX
="$(CXX)" LD
="$(LD)" ABC_USE_LIBSTDCXX
=1 LIBS
="-lm -lpthread -static" OPTFLAGS
="-O" \
222 ARCHFLAGS
="-DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING=1 -Wno-unused-but-set-variable $(ARCHFLAGS)" ABC_USE_NO_READLINE
=1
223 ifeq ($(DISABLE_ABC_THREADS
),1)
224 ABCMKARGS
+= "ABC_USE_NO_PTHREADS=1"
227 else ifeq ($(CONFIG
),gcc-4.8
)
230 CXXFLAGS
+= -std
=c
++11 -Os
231 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
233 else ifeq ($(CONFIG
),afl-gcc
)
234 CXX
= AFL_QUIET
=1 AFL_HARDEN
=1 afl-gcc
235 LD
= AFL_QUIET
=1 AFL_HARDEN
=1 afl-gcc
236 CXXFLAGS
+= -std
=c
++11 -Os
237 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
239 else ifeq ($(CONFIG
),cygwin
)
242 CXXFLAGS
+= -std
=gnu
++11 -Os
243 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
245 else ifeq ($(CONFIG
),emcc
)
248 CXXFLAGS
:= -std
=c
++11 $(filter-out -fPIC
-ggdb
,$(CXXFLAGS
))
249 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DABC_MEMALIGN=8"
250 EMCCFLAGS
:= -Os
-Wno-warn-absolute-paths
251 EMCCFLAGS
+= --memory-init-file
0 --embed-file share
-s NO_EXIT_RUNTIME
=1
252 EMCCFLAGS
+= -s EXPORTED_FUNCTIONS
="['_main','_run','_prompt','_errmsg','_memset']"
253 EMCCFLAGS
+= -s TOTAL_MEMORY
=134217728
254 EMCCFLAGS
+= -s EXTRA_EXPORTED_RUNTIME_METHODS
='["ccall", "cwrap"]'
255 # https://github.com/kripken/emscripten/blob/master/src/settings.js
256 CXXFLAGS
+= $(EMCCFLAGS
)
257 LDFLAGS
+= $(EMCCFLAGS
)
263 TARGETS
:= $(filter-out $(PROGRAM_PREFIX
)yosys-config
,$(TARGETS
))
264 EXTRA_TARGETS
+= yosysjs-
$(YOSYS_VER
).zip
266 ifeq ($(ENABLE_ABC
),1)
268 DISABLE_ABC_THREADS
:= 1
272 wget
-O viz.js.part https
://github.com
/mdaines
/viz.js
/releases
/download
/0.0.3/viz.js
273 mv viz.js.part viz.js
275 yosysjs-
$(YOSYS_VER
).zip
: yosys.js yosys.wasm viz.js misc
/yosysjs
/*
276 rm -rf yosysjs-
$(YOSYS_VER
) yosysjs-
$(YOSYS_VER
).zip
277 mkdir
-p yosysjs-
$(YOSYS_VER
)
278 cp viz.js misc
/yosysjs
/* yosys.js yosys.wasm yosysjs-
$(YOSYS_VER
)/
279 zip
-r yosysjs-
$(YOSYS_VER
).zip yosysjs-
$(YOSYS_VER
)
281 yosys.html
: misc
/yosys.html
282 $(P
) cp misc
/yosys.html yosys.html
284 else ifeq ($(CONFIG
),wasi
)
290 WASIFLAGS
:= -target wasm32-wasi
--sysroot
$(WASI_SYSROOT
) $(WASIFLAGS
)
292 CXX
= $(WASI_SDK
)/bin
/clang
293 LD
= $(WASI_SDK
)/bin
/clang
++
294 AR
= $(WASI_SDK
)/bin
/ar
295 RANLIB
= $(WASI_SDK
)/bin
/ranlib
296 WASIFLAGS
:= --sysroot
$(WASI_SDK
)/share
/wasi-sysroot
$(WASIFLAGS
)
298 CXXFLAGS
:= $(WASIFLAGS
) -std
=c
++11 -Os
$(filter-out -fPIC
,$(CXXFLAGS
))
299 LDFLAGS
:= $(WASIFLAGS
) -Wl
,-z
,stack-size
=1048576 $(filter-out -rdynamic
,$(LDFLAGS
))
300 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
301 ABCMKARGS
+= AR
="$(AR)" RANLIB
="$(RANLIB)"
302 ABCMKARGS
+= ARCHFLAGS
="$(WASIFLAGS) -DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING"
303 ABCMKARGS
+= OPTFLAGS
="-Os"
308 ifeq ($(ENABLE_ABC
),1)
310 DISABLE_ABC_THREADS
:= 1
313 else ifeq ($(CONFIG
),mxe
)
314 PKG_CONFIG
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-pkg-config
315 CXX
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-g
++
316 LD
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-g
++
317 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_MXE_HACKS
-Wno-attributes
318 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
319 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
320 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
321 ABCMKARGS
+= ARCHFLAGS
="-DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
322 # TODO: Try to solve pthread linking issue in more appropriate way
323 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" LDFLAGS
="-Wl,--allow-multiple-definition" ABC_USE_NO_READLINE
=1 CC
="/usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc"
326 else ifeq ($(CONFIG
),msys2-32
)
327 CXX
= i686-w64-mingw32-g
++
328 LD
= i686-w64-mingw32-g
++
329 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
330 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
331 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
332 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
333 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
334 ABCMKARGS
+= LIBS
="-lpthread -s" ABC_USE_NO_READLINE
=0 CC
="i686-w64-mingw32-gcc" CXX
="$(CXX)"
337 else ifeq ($(CONFIG
),msys2-64
)
338 CXX
= x86_64-w64-mingw32-g
++
339 LD
= x86_64-w64-mingw32-g
++
340 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
341 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
342 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
343 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
344 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
345 ABCMKARGS
+= LIBS
="-lpthread -s" ABC_USE_NO_READLINE
=0 CC
="x86_64-w64-mingw32-gcc" CXX
="$(CXX)"
348 else ifneq ($(CONFIG
),none
)
349 $(error Invalid CONFIG setting
'$(CONFIG)'. Valid values
: clang
, gcc
, gcc-4.8
, emcc
, mxe
, msys2-32
, msys2-64
)
352 ifeq ($(ENABLE_LIBYOSYS
),1)
353 TARGETS
+= libyosys.so
356 ifeq ($(ENABLE_PYOSYS
),1)
357 # 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
358 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)")
359 BOOST_PYTHON_LIB ?
= $(shell \
360 $(call CHECK_BOOST_PYTHON
,boost_python-py
$(subst .
,,$(PYTHON_VERSION
))) || \
361 $(call CHECK_BOOST_PYTHON
,boost_python-py
$(PYTHON_MAJOR_VERSION
)) || \
362 $(call CHECK_BOOST_PYTHON
,boost_python
$(subst .
,,$(PYTHON_VERSION
))) || \
363 $(call CHECK_BOOST_PYTHON
,boost_python
$(PYTHON_MAJOR_VERSION
)) \
366 ifeq ($(BOOST_PYTHON_LIB
),)
367 $(error BOOST_PYTHON_LIB could not be detected. Please
define manually
)
370 LDLIBS
+= $(shell $(PYTHON_CONFIG
) --libs
) $(BOOST_PYTHON_LIB
) -lboost_system
-lboost_filesystem
371 # python-config --ldflags includes LDLIBS for some reason
372 LDFLAGS
+= $(filter-out -l
%,$(shell $(PYTHON_CONFIG
) --ldflags))
373 CXXFLAGS
+= $(shell $(PYTHON_CONFIG
) --includes
) -DWITH_PYTHON
375 PY_WRAPPER_FILE
= kernel
/python_wrappers
376 OBJS
+= $(PY_WRAPPER_FILE
).o
377 PY_GEN_SCRIPT
= py_wrap_generator
378 PY_WRAP_INCLUDES
:= $(shell python
$(PYTHON_VERSION
) -c
"from misc import $(PY_GEN_SCRIPT); $(PY_GEN_SCRIPT).print_includes()")
379 endif # ENABLE_PYOSYS
381 ifeq ($(ENABLE_READLINE
),1)
382 CXXFLAGS
+= -DYOSYS_ENABLE_READLINE
383 ifeq ($(OS
), FreeBSD
)
384 CXXFLAGS
+= -I
/usr
/local
/include
387 ifeq ($(LINK_CURSES
),1)
389 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lcurses -lreadline"
391 ifeq ($(LINK_TERMCAP
),1)
393 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
399 ifeq ($(ENABLE_EDITLINE
),1)
400 CXXFLAGS
+= -DYOSYS_ENABLE_EDITLINE
401 LDLIBS
+= -ledit
-ltinfo
-lbsd
403 ABCMKARGS
+= "ABC_USE_NO_READLINE=1"
407 ifeq ($(DISABLE_ABC_THREADS
),1)
408 ABCMKARGS
+= "ABC_USE_NO_PTHREADS=1"
411 ifeq ($(DISABLE_SPAWN
),1)
412 CXXFLAGS
+= -DYOSYS_DISABLE_SPAWN
415 ifeq ($(ENABLE_PLUGINS
),1)
416 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags libffi
) -DYOSYS_ENABLE_PLUGINS
417 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs libffi || echo
-lffi
)
418 ifneq ($(OS
), FreeBSD
)
423 ifeq ($(ENABLE_GLOB
),1)
424 CXXFLAGS
+= -DYOSYS_ENABLE_GLOB
427 ifeq ($(ENABLE_ZLIB
),1)
428 CXXFLAGS
+= -DYOSYS_ENABLE_ZLIB
433 ifeq ($(ENABLE_TCL
),1)
434 TCL_VERSION ?
= tcl
$(shell bash
-c
"tclsh <(echo 'puts [info tclversion]')")
435 ifeq ($(OS
), FreeBSD
)
436 TCL_INCLUDE ?
= /usr
/local
/include/$(TCL_VERSION
)
438 TCL_INCLUDE ?
= /usr
/include/$(TCL_VERSION
)
442 CXXFLAGS
+= -DYOSYS_ENABLE_TCL
443 LDLIBS
+= -ltcl86
-lwsock32
-lws2_32
-lnetapi32
-lz
-luserenv
445 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags tcl || echo
-I
$(TCL_INCLUDE
)) -DYOSYS_ENABLE_TCL
446 ifeq ($(OS
), FreeBSD
)
447 # FreeBSD uses tcl8.6, but lib is named "libtcl86"
448 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
) | tr
-d
'.')
450 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
))
455 ifeq ($(ENABLE_GCOV
),1)
456 CXXFLAGS
+= --coverage
457 LDFLAGS
+= --coverage
460 ifeq ($(ENABLE_GPROF
),1)
465 ifeq ($(ENABLE_NDEBUG
),1)
466 CXXFLAGS
:= -O3
-DNDEBUG
$(filter-out -Os
-ggdb
,$(CXXFLAGS
))
469 ifeq ($(ENABLE_DEBUG
),1)
470 ifeq ($(CONFIG
),clang
)
471 CXXFLAGS
:= -O0
-DDEBUG
$(filter-out -Os
,$(CXXFLAGS
))
473 CXXFLAGS
:= -Og
-DDEBUG
$(filter-out -Os
,$(CXXFLAGS
))
477 ifeq ($(ENABLE_ABC
),1)
478 CXXFLAGS
+= -DYOSYS_ENABLE_ABC
480 CXXFLAGS
+= -DYOSYS_LINK_ABC
481 ifeq ($(DISABLE_ABC_THREADS
),0)
485 ifeq ($(ABCEXTERNAL
),)
486 TARGETS
+= $(PROGRAM_PREFIX
)yosys-abc
$(EXE
)
491 ifeq ($(ENABLE_GHDL
),1)
492 GHDL_PREFIX ?
= $(PREFIX
)
493 GHDL_INCLUDE_DIR ?
= $(GHDL_PREFIX
)/include
494 GHDL_LIB_DIR ?
= $(GHDL_PREFIX
)/lib
495 CXXFLAGS
+= -I
$(GHDL_INCLUDE_DIR
) -DYOSYS_ENABLE_GHDL
496 LDLIBS
+= $(GHDL_LIB_DIR
)/libghdl.a
$(file
<$(GHDL_LIB_DIR
)/libghdl.link
)
499 ifeq ($(ENABLE_VERIFIC
),1)
500 VERIFIC_DIR ?
= /usr
/local
/src
/verific_lib
501 VERIFIC_COMPONENTS ?
= verilog vhdl database util containers hier_tree extensions
502 CXXFLAGS
+= $(patsubst %,-I
$(VERIFIC_DIR
)/%,$(VERIFIC_COMPONENTS
)) -DYOSYS_ENABLE_VERIFIC
504 LDLIBS
+= $(patsubst %,$(VERIFIC_DIR
)/%/*-mac.a
,$(VERIFIC_COMPONENTS
)) -lz
506 LDLIBS
+= $(patsubst %,$(VERIFIC_DIR
)/%/*-linux.a
,$(VERIFIC_COMPONENTS
)) -lz
510 ifeq ($(ENABLE_PROTOBUF
),1)
511 LDLIBS
+= $(shell pkg-config
--cflags --libs protobuf
)
514 ifeq ($(ENABLE_COVER
),1)
515 CXXFLAGS
+= -DYOSYS_ENABLE_COVER
518 ifeq ($(ENABLE_CCACHE
),1)
521 ifeq ($(ENABLE_SCCACHE
),1)
522 CXX
:= sccache
$(CXX
)
526 define add_share_file
527 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
528 $(subst //,/,$(1)/$(notdir $(2))): $(2)
530 $$(Q
) cp
"$(YOSYS_SRC)"/$(2) $(subst //,/,$(1)/$(notdir $(2)))
533 define add_gen_share_file
534 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
535 $(subst //,/,$(1)/$(notdir $(2))): $(2)
537 $$(Q
) cp
$(2) $(subst //,/,$(1)/$(notdir $(2)))
540 define add_include_file
541 $(eval
$(call add_share_file
,$(dir share
/include/$(1)),$(1)))
544 define add_extra_objs
552 P_UPDATE
= $(eval P_STATUS
=$(shell echo
$(OBJS
) $(PROGRAM_PREFIX
)yosys
$(EXE
) |
$(AWK
) 'BEGIN { RS = " "; I = $(P_STATUS)+0; } $$1 == "$@" && NR > I { I = NR; } END { print I; }'))
553 P_SHOW
= [$(shell $(AWK
) "BEGIN { N=$(words $(OBJS) $(PROGRAM_PREFIX)yosys$(EXE)); printf \"%3d\", $(P_OFFSET)+90*$(P_STATUS)/N; exit; }")%]
554 P
= @echo
"$(if $(findstring $@,$(TARGETS) $(EXTRA_TARGETS)),$(eval P_OFFSET = 10))$(call P_UPDATE)$(call P_SHOW) Building $@";
564 $(eval
$(call add_include_file
,kernel
/yosys.h
))
565 $(eval
$(call add_include_file
,kernel
/hashlib.h
))
566 $(eval
$(call add_include_file
,kernel
/log.h
))
567 $(eval
$(call add_include_file
,kernel
/rtlil.h
))
568 $(eval
$(call add_include_file
,kernel
/register.h
))
569 $(eval
$(call add_include_file
,kernel
/celltypes.h
))
570 $(eval
$(call add_include_file
,kernel
/celledges.h
))
571 $(eval
$(call add_include_file
,kernel
/consteval.h
))
572 $(eval
$(call add_include_file
,kernel
/constids.inc
))
573 $(eval
$(call add_include_file
,kernel
/sigtools.h
))
574 $(eval
$(call add_include_file
,kernel
/modtools.h
))
575 $(eval
$(call add_include_file
,kernel
/macc.h
))
576 $(eval
$(call add_include_file
,kernel
/utils.h
))
577 $(eval
$(call add_include_file
,kernel
/satgen.h
))
578 $(eval
$(call add_include_file
,kernel
/qcsat.h
))
579 $(eval
$(call add_include_file
,kernel
/ff.h
))
580 $(eval
$(call add_include_file
,kernel
/ffinit.h
))
581 $(eval
$(call add_include_file
,kernel
/mem.h
))
582 $(eval
$(call add_include_file
,libs
/ezsat
/ezsat.h
))
583 $(eval
$(call add_include_file
,libs
/ezsat
/ezminisat.h
))
584 $(eval
$(call add_include_file
,libs
/sha1
/sha1.h
))
585 $(eval
$(call add_include_file
,libs
/json11
/json11.hpp
))
586 $(eval
$(call add_include_file
,passes
/fsm
/fsmdata.h
))
587 $(eval
$(call add_include_file
,frontends
/ast
/ast.h
))
588 $(eval
$(call add_include_file
,frontends
/blif
/blifparse.h
))
589 $(eval
$(call add_include_file
,backends
/rtlil
/rtlil_backend.h
))
590 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl.h
))
591 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd.h
))
592 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_capi.
cc))
593 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_capi.h
))
594 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd_capi.
cc))
595 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd_capi.h
))
597 OBJS
+= kernel
/driver.o kernel
/register.o kernel
/rtlil.o kernel
/log.o kernel
/calc.o kernel
/yosys.o
598 ifeq ($(ENABLE_ABC
),1)
599 ifneq ($(ABCEXTERNAL
),)
600 kernel
/yosys.o
: CXXFLAGS
+= -DABCEXTERNAL
='"$(ABCEXTERNAL)"'
603 OBJS
+= kernel
/cellaigs.o kernel
/celledges.o kernel
/satgen.o kernel
/qcsat.o kernel
/mem.o kernel
/ffmerge.o
605 kernel
/log.o
: CXXFLAGS
+= -DYOSYS_SRC
='"$(YOSYS_SRC)"'
606 kernel
/yosys.o
: CXXFLAGS
+= -DYOSYS_DATDIR
='"$(DATDIR)"' -DYOSYS_PROGRAM_PREFIX
='"$(PROGRAM_PREFIX)"'
608 OBJS
+= libs
/bigint
/BigIntegerAlgorithms.o libs
/bigint
/BigInteger.o libs
/bigint
/BigIntegerUtils.o
609 OBJS
+= libs
/bigint
/BigUnsigned.o libs
/bigint
/BigUnsignedInABase.o
611 OBJS
+= libs
/sha1
/sha1.o
615 OBJS
+= libs
/json11
/json11.o
617 OBJS
+= libs
/subcircuit
/subcircuit.o
619 OBJS
+= libs
/ezsat
/ezsat.o
620 OBJS
+= libs
/ezsat
/ezminisat.o
622 OBJS
+= libs
/minisat
/Options.o
623 OBJS
+= libs
/minisat
/SimpSolver.o
624 OBJS
+= libs
/minisat
/Solver.o
625 OBJS
+= libs
/minisat
/System.o
627 include $(YOSYS_SRC
)/frontends
/*/Makefile.inc
628 include $(YOSYS_SRC
)/passes
/*/Makefile.inc
629 include $(YOSYS_SRC
)/backends
/*/Makefile.inc
630 include $(YOSYS_SRC
)/techlibs
/*/Makefile.inc
634 include $(YOSYS_SRC
)/frontends
/verilog
/Makefile.inc
635 include $(YOSYS_SRC
)/frontends
/rtlil
/Makefile.inc
636 include $(YOSYS_SRC
)/frontends
/ast
/Makefile.inc
637 include $(YOSYS_SRC
)/frontends
/blif
/Makefile.inc
639 OBJS
+= passes
/hierarchy
/hierarchy.o
640 OBJS
+= passes
/cmds
/select.o
641 OBJS
+= passes
/cmds
/show.o
642 OBJS
+= passes
/cmds
/stat.o
643 OBJS
+= passes
/cmds
/cover.o
644 OBJS
+= passes
/cmds
/design.o
645 OBJS
+= passes
/cmds
/plugin.o
647 include $(YOSYS_SRC
)/passes
/proc
/Makefile.inc
648 include $(YOSYS_SRC
)/passes
/opt
/Makefile.inc
649 include $(YOSYS_SRC
)/passes
/techmap
/Makefile.inc
651 include $(YOSYS_SRC
)/backends
/verilog
/Makefile.inc
652 include $(YOSYS_SRC
)/backends
/rtlil
/Makefile.inc
654 include $(YOSYS_SRC
)/techlibs
/common
/Makefile.inc
659 OBJS
+= $(PROGRAM_PREFIX
)yosys-libabc.a
662 # prevent the CXXFLAGS set by this Makefile from reaching abc/Makefile,
663 # especially the -MD flag which will break the build when CXX is clang
666 top-all
: $(TARGETS
) $(EXTRA_TARGETS
)
668 @echo
" Build successful."
671 ifeq ($(CONFIG
),emcc
)
672 yosys.js
: $(filter-out yosysjs-
$(YOSYS_VER
).zip
,$(EXTRA_TARGETS
))
675 $(PROGRAM_PREFIX
)yosys
$(EXE
): $(OBJS
)
676 $(P
) $(LD
) -o
$(PROGRAM_PREFIX
)yosys
$(EXE
) $(LDFLAGS
) $(OBJS
) $(LDLIBS
)
678 libyosys.so
: $(filter-out kernel
/driver.o
,$(OBJS
))
680 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-install_name
,$(LIBDIR
)/libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
682 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-soname
,$(LIBDIR
)/libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
686 $(Q
) mkdir
-p
$(dir $@
)
687 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
690 $(Q
) mkdir
-p
$(dir $@
)
691 $(P
) cat
$< | grep
-E
-v
"#[ ]*(include|error)" |
$(LD
) $(CXXFLAGS
) -x c
++ -o
$@
-E
-P
-
693 ifeq ($(ENABLE_PYOSYS
),1)
694 $(PY_WRAPPER_FILE
).
cc: misc
/$(PY_GEN_SCRIPT
).py
$(PY_WRAP_INCLUDES
)
695 $(Q
) mkdir
-p
$(dir $@
)
696 $(P
) python
$(PYTHON_VERSION
) -c
"from misc import $(PY_GEN_SCRIPT); $(PY_GEN_SCRIPT).gen_wrappers(\"$(PY_WRAPPER_FILE).cc\")"
700 $(Q
) mkdir
-p
$(dir $@
)
701 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
703 YOSYS_VER_STR
:= Yosys
$(YOSYS_VER
) (git sha1
$(GIT_REV
), $(notdir $(CXX
)) $(shell \
704 $(CXX
) --version | tr
' ()' '\n' | grep
'^[0-9]' | head
-n1
) $(filter -f
% -m
% -O
% -DNDEBUG
,$(CXXFLAGS
)))
706 kernel
/version_
$(GIT_REV
).
cc: $(YOSYS_SRC
)/Makefile
707 $(P
) rm -f kernel
/version_
*.o kernel
/version_
*.d kernel
/version_
*.
cc
708 $(Q
) mkdir
-p kernel
&& echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"$(YOSYS_VER_STR)\"; }" > kernel
/version_
$(GIT_REV
).
cc
710 ifeq ($(ENABLE_VERIFIC
),1)
711 CXXFLAGS_NOVERIFIC
= $(foreach v
,$(CXXFLAGS
),$(if
$(findstring $(VERIFIC_DIR
),$(v
)),,$(v
)))
712 LDLIBS_NOVERIFIC
= $(foreach v
,$(LDLIBS
),$(if
$(findstring $(VERIFIC_DIR
),$(v
)),,$(v
)))
714 CXXFLAGS_NOVERIFIC
= $(CXXFLAGS
)
715 LDLIBS_NOVERIFIC
= $(LDLIBS
)
718 $(PROGRAM_PREFIX
)yosys-config
: misc
/yosys-config.in
719 $(P
) $(SED
) -e
's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(strip $(CXXFLAGS_NOVERIFIC)))#;' \
720 -e
's#@CXX@#$(strip $(CXX))#;' -e
's#@LDFLAGS@#$(strip $(LDFLAGS) $(PLUGIN_LDFLAGS))#;' -e
's#@LDLIBS@#$(strip $(LDLIBS_NOVERIFIC))#;' \
721 -e
's#@BINDIR@#$(strip $(BINDIR))#;' -e
's#@DATDIR@#$(strip $(DATDIR))#;' < $< > $(PROGRAM_PREFIX
)yosys-config
722 $(Q
) chmod
+x
$(PROGRAM_PREFIX
)yosys-config
724 abc
/abc-
$(ABCREV
)$(EXE
) abc
/libabc-
$(ABCREV
).a
:
726 ifneq ($(ABCREV
),default
)
727 $(Q
) if
test -d abc
/.hg
; then \
728 echo
'REEBE: NOP qverpgbel vf n ut jbexvat pbcl! Erzbir nop/ naq er-eha "znxr".' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
730 $(Q
) if
test -d abc
&& ! git
-C abc diff-index
--quiet HEAD
; then \
731 echo
'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
733 # set a variable so the test fails if git fails to run - when comparing outputs directly, empty string would match empty string
734 $(Q
) if
! (cd abc
2> /dev
/null
&& rev
="`git rev-parse $(ABCREV)`" && test "`git rev-parse HEAD`" == "$$rev"); then \
735 test $(ABCPULL
) -ne
0 ||
{ echo
'REEBE: NOP abg hc gb qngr naq NOPCHYY frg gb 0 va Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; exit
1; }; \
736 echo
"Pulling ABC from $(ABCURL):"; set
-x
; \
737 test -d abc || git clone
$(ABCURL
) abc
; \
738 cd abc
&& $(MAKE
) DEP
= clean && git fetch
$(ABCURL
) && git checkout
$(ABCREV
); \
741 $(Q
) rm -f abc
/abc-
[0-9a-f
]*
742 $(Q
) $(MAKE
) -C abc
$(S
) $(ABCMKARGS
) $(if
$(filter %.a
,$@
),PROG
="abc-$(ABCREV)",PROG
="abc-$(ABCREV)$(EXE)") MSG_PREFIX
="$(eval P_OFFSET = 5)$(call P_SHOW)$(eval P_OFFSET = 10) ABC: " $(if
$(filter %.a
,$@
),libabc-
$(ABCREV
).a
)
744 ifeq ($(ABCREV
),default
)
745 .PHONY
: abc
/abc-
$(ABCREV
)$(EXE
)
746 .PHONY
: abc
/libabc-
$(ABCREV
).a
749 $(PROGRAM_PREFIX
)yosys-abc
$(EXE
): abc
/abc-
$(ABCREV
)$(EXE
)
750 $(P
) cp abc
/abc-
$(ABCREV
)$(EXE
) $(PROGRAM_PREFIX
)yosys-abc
$(EXE
)
752 $(PROGRAM_PREFIX
)yosys-libabc.a
: abc
/libabc-
$(ABCREV
).a
753 $(P
) cp abc
/libabc-
$(ABCREV
).a
$(PROGRAM_PREFIX
)yosys-libabc.a
761 ifneq ($(ABCEXTERNAL
),)
762 ABCOPT
="-A $(ABCEXTERNAL)"
767 test: $(TARGETS
) $(EXTRA_TARGETS
)
768 +cd tests
/simple
&& bash run-test.sh
$(SEEDOPT
)
769 +cd tests
/simple_abc9
&& bash run-test.sh
$(SEEDOPT
)
770 +cd tests
/hana
&& bash run-test.sh
$(SEEDOPT
)
771 +cd tests
/asicworld
&& bash run-test.sh
$(SEEDOPT
)
772 # +cd tests/realmath && bash run-test.sh $(SEEDOPT)
773 +cd tests
/share
&& bash run-test.sh
$(SEEDOPT
)
774 +cd tests
/opt_share
&& bash run-test.sh
$(SEEDOPT
)
775 +cd tests
/fsm
&& bash run-test.sh
$(SEEDOPT
)
776 +cd tests
/techmap
&& bash run-test.sh
777 +cd tests
/memories
&& bash run-test.sh
$(ABCOPT
) $(SEEDOPT
)
778 +cd tests
/bram
&& bash run-test.sh
$(SEEDOPT
)
779 +cd tests
/various
&& bash run-test.sh
780 +cd tests
/select
&& bash run-test.sh
781 +cd tests
/sat
&& bash run-test.sh
782 +cd tests
/svinterfaces
&& bash run-test.sh
$(SEEDOPT
)
783 +cd tests
/svtypes
&& bash run-test.sh
$(SEEDOPT
)
784 +cd tests
/proc
&& bash run-test.sh
785 +cd tests
/blif
&& bash run-test.sh
786 +cd tests
/opt
&& bash run-test.sh
787 +cd tests
/aiger
&& bash run-test.sh
$(ABCOPT
)
788 +cd tests
/arch
&& bash run-test.sh
789 +cd tests
/arch
/ice40
&& bash run-test.sh
$(SEEDOPT
)
790 +cd tests
/arch
/xilinx
&& bash run-test.sh
$(SEEDOPT
)
791 +cd tests
/arch
/ecp5
&& bash run-test.sh
$(SEEDOPT
)
792 +cd tests
/arch
/machxo2
&& bash run-test.sh
$(SEEDOPT
)
793 +cd tests
/arch
/efinix
&& bash run-test.sh
$(SEEDOPT
)
794 +cd tests
/arch
/anlogic
&& bash run-test.sh
$(SEEDOPT
)
795 +cd tests
/arch
/gowin
&& bash run-test.sh
$(SEEDOPT
)
796 +cd tests
/arch
/intel_alm
&& bash run-test.sh
$(SEEDOPT
)
797 +cd tests
/arch
/nexus
&& bash run-test.sh
$(SEEDOPT
)
798 +cd tests
/arch
/quicklogic
&& bash run-test.sh
$(SEEDOPT
)
799 +cd tests
/rpc
&& bash run-test.sh
800 +cd tests
/memfile
&& bash run-test.sh
801 +cd tests
/verilog
&& bash run-test.sh
803 @echo
" Passed \"make test\"."
806 VALGRIND ?
= valgrind
--error-exitcode
=1 --leak-check
=full
--show-reachable
=yes
--errors-for-leak-kinds
=all
808 vgtest
: $(TARGETS
) $(EXTRA_TARGETS
)
809 $(VALGRIND
) .
/yosys
-p
'setattr -mod -unset top; synth' $$( ls tests
/simple
/*.v | grep
-v repwhile.v
)
811 @echo
" Passed \"make vgtest\"."
814 vloghtb
: $(TARGETS
) $(EXTRA_TARGETS
)
815 +cd tests
/vloghtb
&& bash run-test.sh
817 @echo
" Passed \"make vloghtb\"."
820 ystests
: $(TARGETS
) $(EXTRA_TARGETS
)
822 git clone https
://github.com
/YosysHQ
/yosys-tests.git tests
/ystests
823 +$(MAKE
) PATH
="$$PWD:$$PATH" -C tests
/ystests
825 @echo
" Finished \"make ystests\"."
829 unit-test
: libyosys.so
830 @
$(MAKE
) -C
$(UNITESTPATH
) CXX
="$(CXX)" CPPFLAGS
="$(CPPFLAGS)" \
831 CXXFLAGS
="$(CXXFLAGS)" LDLIBS
="$(LDLIBS)" ROOTPATH
="$(CURDIR)"
834 @
$(MAKE
) -C
$(UNITESTPATH
) clean
836 install: $(TARGETS
) $(EXTRA_TARGETS
)
837 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(BINDIR
)
838 $(INSTALL_SUDO
) cp
$(filter-out libyosys.so
,$(TARGETS
)) $(DESTDIR
)$(BINDIR
)
839 ifneq ($(filter $(PROGRAM_PREFIX
)yosys
,$(TARGETS
)),)
840 $(INSTALL_SUDO
) $(STRIP
) -S
$(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys
842 ifneq ($(filter $(PROGRAM_PREFIX
)yosys-abc
,$(TARGETS
)),)
843 $(INSTALL_SUDO
) $(STRIP
) $(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys-abc
845 ifneq ($(filter $(PROGRAM_PREFIX
)yosys-filterlib
,$(TARGETS
)),)
846 $(INSTALL_SUDO
) $(STRIP
) $(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys-filterlib
848 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(DATDIR
)
849 $(INSTALL_SUDO
) cp
-r share
/.
$(DESTDIR
)$(DATDIR
)/.
850 ifeq ($(ENABLE_LIBYOSYS
),1)
851 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(LIBDIR
)
852 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(LIBDIR
)/
853 $(INSTALL_SUDO
) $(STRIP
) -S
$(DESTDIR
)$(LIBDIR
)/libyosys.so
854 ifeq ($(ENABLE_PYOSYS
),1)
855 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
856 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/libyosys.so
857 $(INSTALL_SUDO
) cp misc
/__init__.py
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/
862 $(INSTALL_SUDO
) rm -vf
$(addprefix $(DESTDIR
)$(BINDIR
)/,$(notdir $(TARGETS
)))
863 $(INSTALL_SUDO
) rm -rvf
$(DESTDIR
)$(DATDIR
)
864 ifeq ($(ENABLE_LIBYOSYS
),1)
865 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(LIBDIR
)/libyosys.so
866 ifeq ($(ENABLE_PYOSYS
),1)
867 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/libyosys.so
868 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/__init__.py
869 $(INSTALL_SUDO
) rmdir
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
873 update-manual
: $(TARGETS
) $(EXTRA_TARGETS
)
874 cd manual
&& ..
/$(PROGRAM_PREFIX
)yosys
-p
'help -write-tex-command-reference-manual'
876 manual
: $(TARGETS
) $(EXTRA_TARGETS
)
877 cd manual
&& bash appnotes.sh
878 cd manual
&& bash presentation.sh
879 cd manual
&& bash manual.sh
884 if
test -d manual
; then cd manual
&& sh
clean.sh
; fi
885 rm -f
$(OBJS
) $(GENFILES
) $(TARGETS
) $(EXTRA_TARGETS
) $(EXTRA_OBJS
) $(PY_WRAP_INCLUDES
) $(PY_WRAPPER_FILE
).
cc
886 rm -f kernel
/version_
*.o kernel
/version_
*.
cc
887 rm -f libs
/*/*.d frontends
/*/*.d passes
/*/*.d backends
/*/*.d kernel
/*.d techlibs
/*/*.d
888 rm -rf tests
/asicworld
/*.out tests
/asicworld
/*.log
889 rm -rf tests
/hana
/*.out tests
/hana
/*.log
890 rm -rf tests
/simple
/*.out tests
/simple
/*.log
891 rm -rf tests
/memories
/*.out tests
/memories
/*.log tests
/memories
/*.dmp
892 rm -rf tests
/sat
/*.log tests
/techmap
/*.log tests
/various
/*.log
893 rm -rf tests
/bram
/temp tests
/fsm
/temp tests
/realmath
/temp tests
/share
/temp tests
/smv
/temp
894 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_
*
895 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
896 rm -f tests
/tools
/cmp_tbdata
899 $(MAKE
) -C abc DEP
= clean
900 rm -f
$(PROGRAM_PREFIX
)yosys-abc
$(EXE
) $(PROGRAM_PREFIX
)yosys-libabc.a abc
/abc-
[0-9a-f
]* abc
/libabc-
[0-9a-f
]*.a
906 .
/$(PROGRAM_PREFIX
)yosys
-qp
'help; help -all'
907 rm -rf coverage.
info coverage_html
908 lcov
--capture
-d .
--no-external
-o coverage.
info
909 genhtml coverage.
info --output-directory coverage_html
912 { for file in
$(basename $(OBJS
)); do \
913 for
prefix in
cc y l
; do if
[ -f
$${file}.
$${prefix} ]; then echo
$$file.
$${prefix}; fi
; done \
914 done
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
); } > qtcreator.files
915 { echo .
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
) -printf
'%h\n' |
sort -u
; } > qtcreator.includes
916 touch qtcreator.config qtcreator.creator
918 vcxsrc
: $(GENFILES
) $(EXTRA_TARGETS
)
919 rm -rf yosys-win32-vcxsrc-
$(YOSYS_VER
){,.zip
}
920 set
-e
; for f in
`ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
921 echo
"Analyse: $$f" >&2; cpp -std
=c
++11 -MM
-I.
-D_YOSYS_
$$f; done | sed
's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep
'^[^/]' |
sort -u | grep
-v kernel
/version_
> srcfiles.txt
922 bash misc
/create_vcxsrc.sh yosys-win32-vcxsrc
$(YOSYS_VER
) $(GIT_REV
)
923 echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel
/version.
cc
924 zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/genfiles.zip
$(GENFILES
) kernel
/version.
cc
925 zip
-r yosys-win32-vcxsrc-
$(YOSYS_VER
).zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/
926 rm -f srcfiles.txt kernel
/version.
cc
929 mxebin
: $(TARGETS
) $(EXTRA_TARGETS
)
930 rm -rf yosys-win32-mxebin-
$(YOSYS_VER
){,.zip
}
931 mkdir
-p yosys-win32-mxebin-
$(YOSYS_VER
)
932 cp
-r
$(PROGRAM_PREFIX
)yosys.exe share
/ yosys-win32-mxebin-
$(YOSYS_VER
)/
933 ifeq ($(ENABLE_ABC
),1)
934 cp
-r
$(PROGRAM_PREFIX
)yosys-abc.exe abc
/lib
/x86
/pthreadVC2.dll yosys-win32-mxebin-
$(YOSYS_VER
)/
936 echo
-en
'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
937 echo
-en
'Documentation at https://yosyshq.net/yosys/.\r\n' >> yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
938 zip
-r yosys-win32-mxebin-
$(YOSYS_VER
).zip yosys-win32-mxebin-
$(YOSYS_VER
)/
945 echo
'CONFIG := clang' > Makefile.conf
948 echo
'CONFIG := gcc' > Makefile.conf
950 config-gcc-static
: clean
951 echo
'CONFIG := gcc-static' > Makefile.conf
952 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
953 echo
'ENABLE_READLINE := 0' >> Makefile.conf
954 echo
'ENABLE_TCL := 0' >> Makefile.conf
956 config-gcc-4.8
: clean
957 echo
'CONFIG := gcc-4.8' > Makefile.conf
959 config-afl-gcc
: clean
960 echo
'CONFIG := afl-gcc' > Makefile.conf
963 echo
'CONFIG := emcc' > Makefile.conf
964 echo
'ENABLE_TCL := 0' >> Makefile.conf
965 echo
'ENABLE_ABC := 0' >> Makefile.conf
966 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
967 echo
'ENABLE_READLINE := 0' >> Makefile.conf
968 echo
'ENABLE_ZLIB := 0' >> Makefile.conf
971 echo
'CONFIG := wasi' > Makefile.conf
972 echo
'ENABLE_TCL := 0' >> Makefile.conf
973 echo
'ENABLE_ABC := 0' >> Makefile.conf
974 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
975 echo
'ENABLE_READLINE := 0' >> Makefile.conf
976 echo
'ENABLE_ZLIB := 0' >> Makefile.conf
979 echo
'CONFIG := mxe' > Makefile.conf
980 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
982 config-msys2-32
: clean
983 echo
'CONFIG := msys2-32' > Makefile.conf
984 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
985 echo
"PREFIX := $(MINGW_PREFIX)" >> Makefile.conf
987 config-msys2-64
: clean
988 echo
'CONFIG := msys2-64' > Makefile.conf
989 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
990 echo
"PREFIX := $(MINGW_PREFIX)" >> Makefile.conf
993 echo
'CONFIG := cygwin' > Makefile.conf
996 echo
'CONFIG := gcc' > Makefile.conf
997 echo
'ENABLE_GCOV := 1' >> Makefile.conf
998 echo
'ENABLE_DEBUG := 1' >> Makefile.conf
1001 echo
'CONFIG := gcc' > Makefile.conf
1002 echo
'ENABLE_GPROF := 1' >> Makefile.conf
1005 echo
"INSTALL_SUDO := sudo" >> Makefile.conf
1008 @echo
"$(YOSYS_VER)"
1017 -include frontends
/*/*.d
1018 -include passes
/*/*.d
1019 -include backends
/*/*.d
1021 -include techlibs
/*/*.d
1023 .PHONY
: all top-all abc
test install install-abc manual
clean mrproper qtcreator coverage vcxsrc mxebin
1024 .PHONY
: config-clean config-clang config-gcc config-gcc-static config-gcc-4.8 config-afl-gcc config-gprof config-sudo