Hazard3/test/sim/tb_cxxrtl/Makefile

23 lines
654 B
Makefile
Raw Normal View History

TOP := tb
DOTF := tb.f
CONFIG := default
TBEXEC := $(patsubst %.f,%,$(DOTF))
.PHONY: clean all
2021-05-21 09:34:16 +08:00
all: $(TBEXEC)
2021-05-21 09:34:16 +08:00
SYNTH_CMD += read_verilog -I ../../../hdl -DCONFIG_HEADER="config_$(CONFIG).vh" $(shell listfiles $(DOTF));
SYNTH_CMD += hierarchy -top $(TOP);
SYNTH_CMD += write_cxxrtl build-$(DOTF)/dut.cpp
2021-05-21 09:34:16 +08:00
build-$(DOTF)/dut.cpp: $(shell listfiles $(DOTF))
mkdir -p build-$(DOTF)
yosys -p '$(SYNTH_CMD)' 2>&1 > build-$(DOTF)/cxxrtl.log
2021-05-21 09:34:16 +08:00
clean::
rm -f build-$(DOTF) $(TBEXEC)
2021-05-21 09:34:16 +08:00
$(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)