3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-13 04:28:18 +00:00

Docs: updating makefiles

This commit is contained in:
Krystine Sherwin 2024-01-25 12:35:03 +13:00
parent 62d2f89c74
commit 6e38848b92
No known key found for this signature in database
14 changed files with 53 additions and 18 deletions

View file

@ -971,9 +971,12 @@ docs/source/cmd/abc.rst: $(TARGETS) $(EXTRA_TARGETS)
mkdir -p docs/source/cmd mkdir -p docs/source/cmd
./$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual' ./$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual'
PHONY: docs/gen_images docs/guidelines docs/usage PHONY: docs/gen_examples docs/gen_images docs/guidelines docs/usage
docs/gen_examples:
$(Q) $(MAKE) -C docs examples
docs/gen_images: docs/gen_images:
$(Q) $(MAKE) -C docs/source/_images all $(Q) $(MAKE) -C docs images
DOCS_GUIDELINE_FILES := GettingStarted CodingStyle DOCS_GUIDELINE_FILES := GettingStarted CodingStyle
docs/guidelines: docs/guidelines:
@ -988,7 +991,7 @@ docs/source/temp/%: docs/guidelines
-$(Q) ./$(PROGRAM_PREFIX)$* --help > $@ 2>&1 -$(Q) ./$(PROGRAM_PREFIX)$* --help > $@ 2>&1
DOC_TARGET ?= html DOC_TARGET ?= html
docs: docs/source/cmd/abc.rst docs/gen_images docs/guidelines docs/usage docs: docs/source/cmd/abc.rst docs/gen_examples docs/gen_images docs/guidelines docs/usage
$(Q) $(MAKE) -C docs $(DOC_TARGET) $(Q) $(MAKE) -C docs $(DOC_TARGET)
clean: clean:
@ -1007,8 +1010,6 @@ clean:
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 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
rm -f tests/tools/cmp_tbdata rm -f tests/tools/cmp_tbdata
$(MAKE) -C docs clean $(MAKE) -C docs clean
$(MAKE) -C docs/source/_images clean
rm -rf docs/source/cmd docs/util/__pycache__
clean-abc: clean-abc:
$(MAKE) -C abc DEP= clean $(MAKE) -C abc DEP= clean

View file

@ -45,8 +45,10 @@ help:
@echo " dummy to check syntax errors of document sources" @echo " dummy to check syntax errors of document sources"
.PHONY: clean .PHONY: clean
clean: clean: clean-examples
rm -rf $(BUILDDIR)/* rm -rf $(BUILDDIR)/*
rm -rf source/cmd util/__pycache__
$(MAKE) -C source/_images clean
.PHONY: html .PHONY: html
html: html:
@ -227,15 +229,24 @@ dummy:
PYTHON ?= python3 PYTHON ?= python3
.PHONY: test test-examples test-macros .PHONY: test test-examples test-macros examples
test: test-examples test-macros test: test-examples test-macros
FORCE: FORCE:
../%/Makefile: FORCE Makefile-%: FORCE
+$(MAKE) -C $(@D) $(MAKE) -C $(@D) $(*F)
CODE_EXAMPLES := source/code_examples/*/Makefile CODE_EXAMPLES := $(wildcard source/code_examples/*/Makefile)
test-examples: $(CODE_EXAMPLES) TEST_EXAMPLES := $(addsuffix -all,$(CODE_EXAMPLES))
CLEAN_EXAMPLES := $(addsuffix -clean,$(CODE_EXAMPLES))
test-examples: $(TEST_EXAMPLES)
clean-examples: $(CLEAN_EXAMPLES)
examples: $(TEST_EXAMPLES)
test-macros: test-macros:
$(PYTHON) tests/macro_commands.py $(PYTHON) tests/macro_commands.py
.PHONY: images
images:
$(MAKE) -C source/_images

View file

@ -2,15 +2,15 @@ PROGRAM_PREFIX :=
YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
all: test0.log test1.log test2.log .PHONY: all dots
all: dots test0.log test1.log test2.log
dots: test1.dot dots: test1.dot
CXXFLAGS=$(shell $(YOSYS)-config --cxxflags) CXXFLAGS=$(shell $(YOSYS)-config --cxxflags)
DATDIR=$(shell $(YOSYS)-config --datdir) DATDIR=$(shell $(YOSYS)-config --datdir)
my_cmd.so: my_cmd.cc 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 $(subst $(DATDIR),../../../../share,$(CXXFLAGS)) --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
test0.log: my_cmd.so test0.log: my_cmd.so
$(YOSYS) -Ql test0.log_new -m ./my_cmd.so -p 'my_cmd foo bar' absval_ref.v $(YOSYS) -Ql test0.log_new -m ./my_cmd.so -p 'my_cmd foo bar' absval_ref.v
@ -20,10 +20,13 @@ test1.log: my_cmd.so
$(YOSYS) -Ql test1.log_new -m ./my_cmd.so -p 'clean; test1; dump' absval_ref.v $(YOSYS) -Ql test1.log_new -m ./my_cmd.so -p 'clean; test1; dump' absval_ref.v
mv test1.log_new test1.log mv test1.log_new test1.log
test1.dot: test1.dot: my_cmd.so
$(YOSYS) -m ./my_cmd.so -p 'test1; show -format dot -prefix test1' $(YOSYS) -m ./my_cmd.so -p 'test1; show -format dot -prefix test1'
test2.log: my_cmd.so test2.log: my_cmd.so
$(YOSYS) -Ql test2.log_new -m ./my_cmd.so -p 'hierarchy -top test; test2' sigmap_test.v $(YOSYS) -Ql test2.log_new -m ./my_cmd.so -p 'hierarchy -top test; test2' sigmap_test.v
mv test2.log_new test2.log mv test2.log_new test2.log
.PHONY: clean
clean:
rm -f *.d *.so *.dot

View file

@ -10,12 +10,13 @@ MAPDOT_NAMES += rdata_map_ffs rdata_map_luts rdata_map_cells
DOTS := $(addsuffix .dot,$(DOT_NAMES)) DOTS := $(addsuffix .dot,$(DOT_NAMES))
MAPDOTS := $(addsuffix .dot,$(MAPDOT_NAMES)) MAPDOTS := $(addsuffix .dot,$(MAPDOT_NAMES))
dots: $(DOTS) $(MAPDOTS) fifo.out all: dots fifo.out fifo.stat
dots: $(DOTS) $(MAPDOTS)
$(DOTS) fifo.out: fifo.v fifo.ys $(DOTS) fifo.out: fifo.v fifo.ys
$(YOSYS) fifo.ys -l fifo.out -Q -T $(YOSYS) fifo.ys -l fifo.out -Q -T
$(MAPDOTS): fifo.v fifo_map.ys $(MAPDOTS) fifo.stat: fifo.v fifo_map.ys
$(YOSYS) fifo_map.ys $(YOSYS) fifo_map.ys
.PHONY: clean .PHONY: clean

View file

@ -4,6 +4,7 @@ YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
DOTS = counter_00.dot counter_01.dot counter_02.dot counter_03.dot DOTS = counter_00.dot counter_01.dot counter_02.dot counter_03.dot
all: dots
dots: $(DOTS) dots: $(DOTS)
$(DOTS): counter.v counter.ys mycells.lib $(DOTS): counter.v counter.ys mycells.lib

View file

@ -4,6 +4,7 @@ YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
DOTS = macc_simple_xmap.dot macc_xilinx_xmap.dot DOTS = macc_simple_xmap.dot macc_xilinx_xmap.dot
all: dots
dots: $(DOTS) dots: $(DOTS)
macc_simple_xmap.dot: macc_simple_*.v macc_simple_test.ys macc_simple_xmap.dot: macc_simple_*.v macc_simple_test.ys

View file

@ -6,6 +6,7 @@ DOT_NAMES = opt_share opt_muxtree opt_merge opt_expr
DOTS := $(addsuffix .dot,$(DOT_NAMES)) DOTS := $(addsuffix .dot,$(DOT_NAMES))
all: dots
dots: $(DOTS) dots: $(DOTS)
%_full.dot: %.ys %_full.dot: %.ys

View file

@ -2,6 +2,8 @@ PROGRAM_PREFIX :=
YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
.PHONY: all dots
all: dots
dots: scrambler_p01.dot scrambler_p02.dot dots: scrambler_p01.dot scrambler_p02.dot
scrambler_p01.dot scrambler_p02.dot: scrambler.ys scrambler.v scrambler_p01.dot scrambler_p02.dot: scrambler.ys scrambler.v

View file

@ -11,6 +11,8 @@ MEMDEMO_DOTS := $(addsuffix .dot,$(MEMDEMO))
SUBMOD = submod_00 submod_01 submod_02 submod_03 SUBMOD = submod_00 submod_01 submod_02 submod_03
SUBMOD_DOTS := $(addsuffix .dot,$(SUBMOD)) SUBMOD_DOTS := $(addsuffix .dot,$(SUBMOD))
.PHONY: all dots
all: dots
dots: select.dot $(SUMPROD_DOTS) $(MEMDEMO_DOTS) $(SUBMOD_DOTS) dots: select.dot $(SUMPROD_DOTS) $(MEMDEMO_DOTS) $(SUBMOD_DOTS)
select.dot: select.v select.ys select.dot: select.v select.ys

View file

@ -8,7 +8,9 @@ EXAMPLE_DOTS := $(addsuffix .dot,$(EXAMPLE))
CMOS = cmos_00 cmos_01 CMOS = cmos_00 cmos_01
CMOS_DOTS := $(addsuffix .dot,$(CMOS)) CMOS_DOTS := $(addsuffix .dot,$(CMOS))
dots: splice.dot $(EXAMPLE_DOTS) $(CMOS_DOTS) example.out .PHONY: all dots
all: dots example.out
dots: splice.dot $(EXAMPLE_DOTS) $(CMOS_DOTS)
splice.dot: splice.v splice.dot: splice.v
$(YOSYS) -p 'prep -top splice_demo; show -format dot -prefix splice' splice.v $(YOSYS) -p 'prep -top splice_demo; show -format dot -prefix splice' splice.v

View file

@ -1,5 +1,8 @@
.PHONY: all dots
all: dots
dots: dots:
.PHONY: test
test: stubnets.so test: stubnets.so
yosys -ql test1.log -m ./stubnets.so test.v -p "stubnets" 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 test2.log -m ./stubnets.so test.v -p "opt; stubnets"
@ -9,6 +12,7 @@ test: stubnets.so
stubnets.so: stubnets.cc 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: clean:
rm -f test1.log test2.log test3.log rm -f test1.log test2.log test3.log
rm -f stubnets.so stubnets.d rm -f stubnets.so stubnets.d

View file

@ -9,6 +9,8 @@ YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
DOTS = $(addsuffix .dot,$(TARGETS)) DOTS = $(addsuffix .dot,$(TARGETS))
.PHONY: all dots
all: dots
dots: $(DOTS) dots: $(DOTS)
%.dot: %.v %.ys %.dot: %.v %.ys

View file

@ -2,6 +2,8 @@ PROGRAM_PREFIX :=
YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
.PHONY: all dots
all: dots
dots: red_or3x1.dot sym_mul.dot mymul.dot mulshift.dot addshift.dot dots: red_or3x1.dot sym_mul.dot mymul.dot mulshift.dot addshift.dot
red_or3x1.dot: red_or3x1_* red_or3x1.dot: red_or3x1_*

View file

@ -6,6 +6,8 @@ Writing extensions
.. todo:: check text is coherent .. todo:: check text is coherent
.. todo:: update to use ``/code_examples/extensions/test*.log``
This chapter contains some bits and pieces of information about programming This chapter contains some bits and pieces of information about programming
yosys extensions. Don't be afraid to ask questions on the YosysHQ Slack. yosys extensions. Don't be afraid to ask questions on the YosysHQ Slack.