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
cad5353a2a
208 changed files with 5285 additions and 2294 deletions
|
|
@ -252,10 +252,37 @@ images:
|
|||
$(MAKE) -C source/_images
|
||||
$(MAKE) -C source/_images convert
|
||||
|
||||
BUILD_DIR ?= ..
|
||||
BUILD_CMD := $(BUILD_DIR)/$(PROGRAM_PREFIX)
|
||||
|
||||
.PHONY: extract
|
||||
extract:
|
||||
mkdir -p source/generated
|
||||
$(BUILD_CMD)yosys -q -p 'help -dump-cmds-json source/generated/cmds.json'
|
||||
$(BUILD_CMD)yosys -q -p 'help -dump-cells-json source/generated/cells.json'
|
||||
|
||||
cp ../passes/cmds/chformal.cc source/generated/
|
||||
$(BUILD_CMD)yosys -qQT -h 'chformal' -l source/generated/chformal.log
|
||||
|
||||
mkdir -p source/generated/functional
|
||||
cp ../backends/functional/smtlib.cc source/generated/functional/
|
||||
-cd .. && diff -U 20 backends/functional/smtlib.cc backends/functional/smtlib_rosette.cc \
|
||||
> docs/source/generated/functional/rosette.diff
|
||||
|
||||
$(BUILD_CMD)yosys --help >source/generated/yosys
|
||||
$(BUILD_CMD)yosys-smtbmc --help >source/generated/yosys-smtbmc
|
||||
$(BUILD_CMD)yosys-witness --help >source/generated/yosys-witness
|
||||
$(BUILD_CMD)yosys-config --help >source/generated/yosys-config
|
||||
-$(BUILD_CMD)yosys-filterlib --help 2>source/generated/yosys-filterlib
|
||||
ifeq ($(ABCEXTERNAL),)
|
||||
-$(BUILD_CMD)yosys-abc --help 2>source/generated/yosys-abc
|
||||
endif
|
||||
|
||||
.PHONY: gen
|
||||
gen:
|
||||
$(MAKE) examples
|
||||
$(MAKE) images
|
||||
$(MAKE) extract
|
||||
|
||||
.PHONY: reqs
|
||||
reqs:
|
||||
|
|
|
|||
|
|
@ -7,11 +7,8 @@ all: dots examples
|
|||
dots: test1.dot my_cmd.so
|
||||
examples: test0.log test1.log test2.log my_cmd.so
|
||||
|
||||
CXXFLAGS=$(shell $(YOSYS)-config --cxxflags)
|
||||
DATDIR=$(shell $(YOSYS)-config --datdir)
|
||||
|
||||
my_cmd.so: my_cmd.cc
|
||||
$(YOSYS)-config --exec --cxx $(subst $(DATDIR),../../../../share,$(CXXFLAGS)) --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
|
||||
$(YOSYS)-config --exec --cxx --cxxflags --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
|
||||
|
||||
test0.log: my_cmd.so
|
||||
$(YOSYS) -QTl test0.log_new -m ./my_cmd.so -p 'my_cmd foo bar' -f verilog absval_ref.v
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
PROGRAM_PREFIX :=
|
||||
|
||||
YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
|
||||
|
||||
.PHONY: all dots examples
|
||||
all: dots examples
|
||||
dots:
|
||||
|
|
@ -5,13 +9,13 @@ examples:
|
|||
|
||||
.PHONY: test
|
||||
test: stubnets.so
|
||||
yosys -ql test1.log -m ./stubnets.so test.v -p "stubnets"
|
||||
yosys -ql test2.log -m ./stubnets.so test.v -p "opt; stubnets"
|
||||
yosys -ql test3.log -m ./stubnets.so test.v -p "techmap; opt; stubnets -report_bits"
|
||||
$(YOSYS) -ql test1.log -m ./stubnets.so test.v -p "stubnets"
|
||||
$(YOSYS) -ql test2.log -m ./stubnets.so test.v -p "opt; stubnets"
|
||||
$(YOSYS) -ql test3.log -m ./stubnets.so test.v -p "techmap; opt; stubnets -report_bits"
|
||||
tail test1.log test2.log test3.log
|
||||
|
||||
stubnets.so: stubnets.cc
|
||||
yosys-config --exec --cxx --cxxflags --ldflags -o $@ -shared $^ --ldlibs
|
||||
$(YOSYS)-config --exec --cxx --cxxflags --ldflags -o $@ -shared $^ --ldlibs
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue