docs: Makefile tidying

examples and dots are now orthogonal.
This commit is contained in:
Krystine Sherwin 2024-10-07 21:56:23 +13:00
parent 2e1181a092
commit 468a019c30
No known key found for this signature in database
12 changed files with 35 additions and 22 deletions

View File

@ -238,7 +238,7 @@ Makefile-%: FORCE
$(MAKE) -C $(@D) $(*F) $(MAKE) -C $(@D) $(*F)
CODE_EXAMPLES := $(wildcard source/code_examples/*/Makefile) CODE_EXAMPLES := $(wildcard source/code_examples/*/Makefile)
TEST_EXAMPLES := $(addsuffix -all,$(CODE_EXAMPLES)) TEST_EXAMPLES := $(addsuffix -examples,$(CODE_EXAMPLES))
CLEAN_EXAMPLES := $(addsuffix -clean,$(CODE_EXAMPLES)) CLEAN_EXAMPLES := $(addsuffix -clean,$(CODE_EXAMPLES))
test-examples: $(TEST_EXAMPLES) test-examples: $(TEST_EXAMPLES)
clean-examples: $(CLEAN_EXAMPLES) clean-examples: $(CLEAN_EXAMPLES)

View File

@ -2,9 +2,10 @@ PROGRAM_PREFIX :=
YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
.PHONY: all dots .PHONY: all dots examples
all: dots test0.log test1.log test2.log all: dots examples
dots: test1.dot dots: test1.dot
examples: test0.log test1.log test2.log
CXXFLAGS=$(shell $(YOSYS)-config --cxxflags) CXXFLAGS=$(shell $(YOSYS)-config --cxxflags)
DATDIR=$(shell $(YOSYS)-config --datdir) DATDIR=$(shell $(YOSYS)-config --datdir)

View File

@ -10,8 +10,10 @@ 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))
all: dots fifo.out fifo.stat .PHONY: all dots examples
all: dots examples
dots: $(DOTS) $(MAPDOTS) dots: $(DOTS) $(MAPDOTS)
examples: fifo.out fifo.stat
$(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

View File

@ -4,8 +4,10 @@ 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 .PHONY: all dots examples
all: dots examples
dots: $(DOTS) dots: $(DOTS)
examples:
$(DOTS): counter.v counter.ys mycells.lib $(DOTS): counter.v counter.ys mycells.lib
$(YOSYS) counter.ys $(YOSYS) counter.ys

View File

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

View File

@ -6,13 +6,13 @@ DOT_NAMES = opt_share opt_muxtree opt_merge opt_expr
DOTS := $(addsuffix .dot,$(DOT_NAMES)) DOTS := $(addsuffix .dot,$(DOT_NAMES))
all: dots .PHONY: all dots examples
all: dots examples
dots: $(DOTS) dots: $(DOTS)
examples:
%_full.dot: %.ys %.dot: %.ys
$(YOSYS) $< $(YOSYS) $<
%.dot: %_full.dot
gvpack -u -o $@ $*_full.dot gvpack -u -o $@ $*_full.dot
.PHONY: clean .PHONY: clean

View File

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

View File

@ -11,9 +11,10 @@ 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 .PHONY: all dots examples
all: dots all: dots examples
dots: select.dot $(SUMPROD_DOTS) $(MEMDEMO_DOTS) $(SUBMOD_DOTS) dots: select.dot $(SUMPROD_DOTS) $(MEMDEMO_DOTS) $(SUBMOD_DOTS)
examples:
select.dot: select.v select.ys select.dot: select.v select.ys
$(YOSYS) select.ys $(YOSYS) select.ys

View File

@ -8,9 +8,10 @@ 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))
.PHONY: all dots .PHONY: all dots examples
all: dots example.out all: dots examples
dots: splice.dot $(EXAMPLE_DOTS) $(CMOS_DOTS) dots: splice.dot $(EXAMPLE_DOTS) $(CMOS_DOTS)
examples: example.out
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,6 +1,7 @@
.PHONY: all dots .PHONY: all dots examples
all: dots all: dots examples
dots: dots:
examples:
.PHONY: test .PHONY: test
test: stubnets.so test: stubnets.so

View File

@ -9,9 +9,10 @@ YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
DOTS = $(addsuffix .dot,$(DOT_TARGETS)) DOTS = $(addsuffix .dot,$(DOT_TARGETS))
.PHONY: all dots .PHONY: all dots examples
all: dots all: dots examples
dots: $(DOTS) dots: $(DOTS)
examples:
%.dot: %.v %.ys %.dot: %.v %.ys
$(YOSYS) -p 'script $*.ys; show -notitle -prefix $* -format dot' $(YOSYS) -p 'script $*.ys; show -notitle -prefix $* -format dot'

View File

@ -2,9 +2,10 @@ PROGRAM_PREFIX :=
YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
.PHONY: all dots .PHONY: all dots examples
all: dots all: dots examples
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
examples:
red_or3x1.dot: red_or3x1_* red_or3x1.dot: red_or3x1_*
$(YOSYS) red_or3x1_test.ys $(YOSYS) red_or3x1_test.ys