mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-25 11:26:22 +00:00
Migrate build system to CMake
See #5895 for details. This commit does not include CI or documentation changes.
This commit is contained in:
parent
9d0cdb8551
commit
9b087b4aa7
207 changed files with 5202 additions and 2294 deletions
18
backends/CMakeLists.txt
Normal file
18
backends/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
add_subdirectory(aiger)
|
||||
add_subdirectory(aiger2)
|
||||
add_subdirectory(blif)
|
||||
add_subdirectory(btor)
|
||||
add_subdirectory(cxxrtl)
|
||||
add_subdirectory(edif)
|
||||
add_subdirectory(firrtl)
|
||||
add_subdirectory(functional)
|
||||
add_subdirectory(intersynth)
|
||||
add_subdirectory(jny)
|
||||
add_subdirectory(json)
|
||||
add_subdirectory(rtlil)
|
||||
add_subdirectory(simplec)
|
||||
add_subdirectory(smt2)
|
||||
add_subdirectory(smv)
|
||||
add_subdirectory(spice)
|
||||
add_subdirectory(table)
|
||||
add_subdirectory(verilog)
|
||||
8
backends/aiger/CMakeLists.txt
Normal file
8
backends/aiger/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
yosys_backend(aiger
|
||||
aiger.cc
|
||||
REQUIRES
|
||||
json11
|
||||
)
|
||||
yosys_backend(xaiger
|
||||
xaiger.cc
|
||||
)
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
|
||||
OBJS += backends/aiger/aiger.o
|
||||
OBJS += backends/aiger/xaiger.o
|
||||
|
||||
5
backends/aiger2/CMakeLists.txt
Normal file
5
backends/aiger2/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
yosys_backend(aiger2
|
||||
aiger.cc
|
||||
PROVIDES
|
||||
write_xaiger2
|
||||
)
|
||||
|
|
@ -1 +0,0 @@
|
|||
OBJS += backends/aiger2/aiger.o
|
||||
3
backends/blif/CMakeLists.txt
Normal file
3
backends/blif/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
yosys_backend(blif
|
||||
blif.cc
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/blif/blif.o
|
||||
|
||||
7
backends/btor/CMakeLists.txt
Normal file
7
backends/btor/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
yosys_backend(btor
|
||||
btor.cc
|
||||
REQUIRES
|
||||
bmuxmap
|
||||
demuxmap
|
||||
bwmuxmap
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/btor/btor.o
|
||||
|
||||
19
backends/cxxrtl/CMakeLists.txt
Normal file
19
backends/cxxrtl/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
yosys_backend(cxxrtl
|
||||
cxxrtl_backend.cc
|
||||
DATA_DIR
|
||||
include/backends/cxxrtl
|
||||
DATA_FILES
|
||||
runtime/README.txt
|
||||
runtime/cxxrtl/cxxrtl.h
|
||||
runtime/cxxrtl/cxxrtl_vcd.h
|
||||
runtime/cxxrtl/cxxrtl_time.h
|
||||
runtime/cxxrtl/cxxrtl_replay.h
|
||||
runtime/cxxrtl/capi/cxxrtl_capi.cc
|
||||
runtime/cxxrtl/capi/cxxrtl_capi.h
|
||||
runtime/cxxrtl/capi/cxxrtl_capi_vcd.cc
|
||||
runtime/cxxrtl/capi/cxxrtl_capi_vcd.h
|
||||
REQUIRES
|
||||
hierarchy
|
||||
flatten
|
||||
proc
|
||||
)
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
OBJS += backends/cxxrtl/cxxrtl_backend.o
|
||||
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/cxxrtl.h))
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/cxxrtl_vcd.h))
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/cxxrtl_time.h))
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/cxxrtl_replay.h))
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/capi/cxxrtl_capi.cc))
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/capi/cxxrtl_capi.h))
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/capi/cxxrtl_capi_vcd.cc))
|
||||
$(eval $(call add_include_file,backends/cxxrtl/runtime/cxxrtl/capi/cxxrtl_capi_vcd.h))
|
||||
3
backends/edif/CMakeLists.txt
Normal file
3
backends/edif/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
yosys_backend(edif
|
||||
edif.cc
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/edif/edif.o
|
||||
|
||||
8
backends/firrtl/CMakeLists.txt
Normal file
8
backends/firrtl/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
yosys_backend(firrtl
|
||||
firrtl.cc
|
||||
REQUIRES
|
||||
pmuxtree
|
||||
bmuxmap
|
||||
demuxmap
|
||||
bwmuxmap
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/firrtl/firrtl.o
|
||||
|
||||
12
backends/functional/CMakeLists.txt
Normal file
12
backends/functional/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
yosys_backend(functional_cxx
|
||||
cxx.cc
|
||||
)
|
||||
yosys_backend(functional_smt2
|
||||
smtlib.cc
|
||||
)
|
||||
yosys_backend(functional_rosette
|
||||
smtlib_rosette.cc
|
||||
)
|
||||
yosys_test_pass(generic
|
||||
test_generic.cc
|
||||
)
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
OBJS += backends/functional/cxx.o
|
||||
OBJS += backends/functional/smtlib.o
|
||||
OBJS += backends/functional/smtlib_rosette.o
|
||||
OBJS += backends/functional/test_generic.o
|
||||
3
backends/intersynth/CMakeLists.txt
Normal file
3
backends/intersynth/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
yosys_backend(intersynth
|
||||
intersynth.cc
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/intersynth/intersynth.o
|
||||
|
||||
5
backends/jny/CMakeLists.txt
Normal file
5
backends/jny/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
yosys_backend(jny
|
||||
jny.cc
|
||||
PROVIDES
|
||||
jny
|
||||
)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
OBJS += backends/jny/jny.o
|
||||
5
backends/json/CMakeLists.txt
Normal file
5
backends/json/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
yosys_backend(json
|
||||
json.cc
|
||||
PROVIDES
|
||||
json
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/json/json.o
|
||||
|
||||
11
backends/rtlil/CMakeLists.txt
Normal file
11
backends/rtlil/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
yosys_backend(rtlil
|
||||
rtlil_backend.cc
|
||||
rtlil_backend.h
|
||||
PROVIDES
|
||||
dump
|
||||
DATA_DIR
|
||||
include/backends/rtlil
|
||||
DATA_FILES
|
||||
rtlil_backend.h
|
||||
ESSENTIAL
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/rtlil/rtlil_backend.o
|
||||
|
||||
3
backends/simplec/CMakeLists.txt
Normal file
3
backends/simplec/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
yosys_backend(simplec
|
||||
simplec.cc
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/simplec/simplec.o
|
||||
|
||||
16
backends/smt2/CMakeLists.txt
Normal file
16
backends/smt2/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
yosys_backend(smt2
|
||||
smt2.cc
|
||||
REQUIRES
|
||||
json11
|
||||
DATA_DIR
|
||||
python3
|
||||
DATA_FILES
|
||||
smtio.py
|
||||
ywio.py
|
||||
REQUIRES
|
||||
bmuxmap
|
||||
demuxmap
|
||||
)
|
||||
|
||||
yosys_python_executable(yosys-smtbmc smtbmc.py)
|
||||
yosys_python_executable(yosys-witness witness.py)
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
|
||||
OBJS += backends/smt2/smt2.o
|
||||
|
||||
ifneq ($(CONFIG),mxe)
|
||||
ifneq ($(CONFIG),emcc)
|
||||
|
||||
# MSYS targets support yosys-smtbmc, but require a launcher script
|
||||
ifeq ($(CONFIG),$(filter $(CONFIG),msys2 msys2-64))
|
||||
TARGETS += $(PROGRAM_PREFIX)yosys-smtbmc.exe $(PROGRAM_PREFIX)yosys-smtbmc-script.py
|
||||
TARGETS += $(PROGRAM_PREFIX)yosys-witness.exe $(PROGRAM_PREFIX)yosys-witness-script.py
|
||||
# Needed to find the Python interpreter for yosys-smtbmc scripts.
|
||||
# Override if necessary, it is only used for msys2 targets.
|
||||
PYTHON := $(shell cygpath -w -m $(PREFIX)/bin/python3)
|
||||
|
||||
$(PROGRAM_PREFIX)yosys-smtbmc-script.py: backends/smt2/smtbmc.py
|
||||
$(P) sed -e 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/$(PROGRAM_PREFIX)yosys/python3"]]|;' \
|
||||
-e "s|#!/usr/bin/env python3|#!$(PYTHON)|" < $< > $@
|
||||
|
||||
$(PROGRAM_PREFIX)yosys-witness-script.py: backends/smt2/witness.py
|
||||
$(P) sed -e 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/$(PROGRAM_PREFIX)yosys/python3"]]|;' \
|
||||
-e "s|#!/usr/bin/env python3|#!$(PYTHON)|" < $< > $@
|
||||
|
||||
$(PROGRAM_PREFIX)yosys-smtbmc.exe: misc/launcher.c $(PROGRAM_PREFIX)yosys-smtbmc-script.py
|
||||
$(P) $(CXX) -DGUI=0 -O -s -o $@ $<
|
||||
|
||||
$(PROGRAM_PREFIX)yosys-witness.exe: misc/launcher.c $(PROGRAM_PREFIX)yosys-witness-script.py
|
||||
$(P) $(CXX) -DGUI=0 -O -s -o $@ $<
|
||||
# Other targets
|
||||
else
|
||||
TARGETS += $(PROGRAM_PREFIX)yosys-smtbmc $(PROGRAM_PREFIX)yosys-witness
|
||||
|
||||
$(PROGRAM_PREFIX)yosys-smtbmc: backends/smt2/smtbmc.py
|
||||
$(P) sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/$(PROGRAM_PREFIX)yosys/python3"]]|;' < $< > $@.new
|
||||
$(Q) chmod +x $@.new
|
||||
$(Q) mv $@.new $@
|
||||
|
||||
$(PROGRAM_PREFIX)yosys-witness: backends/smt2/witness.py
|
||||
$(P) sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/$(PROGRAM_PREFIX)yosys/python3"]]|;' < $< > $@.new
|
||||
$(Q) chmod +x $@.new
|
||||
$(Q) mv $@.new $@
|
||||
endif
|
||||
|
||||
$(eval $(call add_share_file,share/python3,backends/smt2/smtio.py))
|
||||
$(eval $(call add_share_file,share/python3,backends/smt2/ywio.py))
|
||||
endif
|
||||
endif
|
||||
4
backends/smt2/smtbmc.py
Normal file → Executable file
4
backends/smt2/smtbmc.py
Normal file → Executable file
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
#!@PYTHON_SHEBANG@
|
||||
#
|
||||
# yosys -- Yosys Open SYnthesis Suite
|
||||
#
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#
|
||||
|
||||
import os, sys, getopt, re, bisect, json
|
||||
##yosys-sys-path##
|
||||
sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/@YOSYS_PROGRAM_PREFIX@yosys/python3"]]
|
||||
from smtio import SmtIo, SmtOpts, MkVcd
|
||||
from ywio import ReadWitness, WriteWitness, WitnessValues
|
||||
from collections import defaultdict
|
||||
|
|
|
|||
4
backends/smt2/witness.py
Normal file → Executable file
4
backends/smt2/witness.py
Normal file → Executable file
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
#!@PYTHON_SHEBANG@
|
||||
#
|
||||
# yosys -- Yosys Open SYnthesis Suite
|
||||
#
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#
|
||||
|
||||
import os, sys, itertools, re
|
||||
##yosys-sys-path##
|
||||
sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/@YOSYS_PROGRAM_PREFIX@yosys/python3"]]
|
||||
import json
|
||||
import click
|
||||
|
||||
|
|
|
|||
7
backends/smv/CMakeLists.txt
Normal file
7
backends/smv/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
yosys_backend(smv
|
||||
smv.cc
|
||||
REQUIRES
|
||||
bmuxmap
|
||||
demuxmap
|
||||
bwmuxmap
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/smv/smv.o
|
||||
|
||||
3
backends/spice/CMakeLists.txt
Normal file
3
backends/spice/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
yosys_backend(spice
|
||||
spice.cc
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/spice/spice.o
|
||||
|
||||
3
backends/table/CMakeLists.txt
Normal file
3
backends/table/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
yosys_backend(table
|
||||
table.cc
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/table/table.o
|
||||
|
||||
8
backends/verilog/CMakeLists.txt
Normal file
8
backends/verilog/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
yosys_backend(verilog
|
||||
verilog_backend.cc
|
||||
verilog_backend.h
|
||||
REQUIRES
|
||||
bmuxmap
|
||||
demuxmap
|
||||
clean_zerowidth
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OBJS += backends/verilog/verilog_backend.o
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue