tb_cxxrtl Makefile: better support for building multiple tb configurations
This commit is contained in:
parent
cbb490da6a
commit
97509f548a
|
@ -1,2 +1,5 @@
|
|||
tb
|
||||
dut.cpp
|
||||
build.*
|
||||
tb_multicore
|
||||
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
TOP := tb
|
||||
DOTF := tb.f
|
||||
CONFIG := default
|
||||
TBEXEC := $(patsubst %.f,%,DOTF)
|
||||
|
||||
.PHONY: clean all
|
||||
|
||||
all: tb
|
||||
all: $(TBEXEC)
|
||||
|
||||
SYNTH_CMD += read_verilog -I ../../../hdl -DCONFIG_HEADER="config_$(CONFIG).vh" $(shell listfiles $(DOTF));
|
||||
SYNTH_CMD += hierarchy -top $(TOP);
|
||||
SYNTH_CMD += write_cxxrtl dut.cpp
|
||||
SYNTH_CMD += write_cxxrtl build-$(DOTF)/dut.cpp
|
||||
|
||||
dut.cpp: $(shell listfiles $(DOTF))
|
||||
yosys -p '$(SYNTH_CMD)' 2>&1 > cxxrtl.log
|
||||
build-$(DOTF)/dut.cpp: $(shell listfiles $(DOTF))
|
||||
mkdir -p build-$(DOTF)
|
||||
yosys -p '$(SYNTH_CMD)' 2>&1 > build-$(DOTF)/cxxrtl.log
|
||||
|
||||
clean::
|
||||
rm -f dut.cpp cxxrtl.log tb
|
||||
rm -f build-$(DOTF) $(TBEXEC)
|
||||
|
||||
tb: dut.cpp tb.cpp
|
||||
clang++ -O3 -std=c++14 $(addprefix -D,$(CDEFINES)) -I $(shell yosys-config --datdir)/include tb.cpp -o tb
|
||||
$(TBEXEC): build-$(DOTF)/dut.cpp tb.cpp
|
||||
clang++ -O3 -std=c++14 $(addprefix -D,$(CDEFINES)) -I $(shell yosys-config --datdir)/include -I build-$(DOTF) tb.cpp -o $(TBEXEC)
|
||||
|
|
Loading…
Reference in New Issue