srdl2sv/tests/Makefile
Dennis 85f7808362
Closes #4: Add support for hierarchical addrmaps
Every time an addrmap is detected within another addrmap, a new context
will be opened and a separate RTL file will be created.

All addrmaps will have the same bus-wdiget, but it might be possible
that different addrmaps have different maximum regwidths. For that
reason, it was necessary to change the non-generic srd2sv_if_pkg to a
parametrizable interface.

Almost all changes to the templates in this commit are due to name
changes from 'b2r' and 'r2b' to 'widget_if'.
2021-10-27 23:27:29 -07:00

47 lines
1.7 KiB
Makefile

ALL_COCOTB_TESTS = $(shell ls cocotb_tests/test_*.py | sed -E 's|.*?/test_(.*?).py|\1|g')
.PHONY: clean
.PRECIOUS: build_dirs/%/compile.f
default: $(ALL_COCOTB_TESTS)
# This target will always rebuild, which is fine since we want to be sure to execute any
# test if we kick it off.
%: build_dirs/%/compile.f
rm -rf cocotb_tests/dump.fst
rm -rf cocotb_tests/results.xml
rm -rf cocotb_tests/simulation.log
mkdir -p $(PWD)/build_dirs/$@/cocotb_build
$(MAKE) -C cocotb_tests \
TOPLEVEL=$@\
MODULE=test_$@\
VERILOG_SOURCES="$(shell cat $^)"\
SIM_BUILD=$(PWD)/build_dirs/$@/cocotb_build\
| tee $(PWD)/build_dirs/$@/simulation.log
# Move some files
mv cocotb_tests/dump.fst $(PWD)/build_dirs/$@/
mv cocotb_tests/results.xml $(PWD)/build_dirs/$@/
@echo ""
@echo "##############################################################################"
@echo "# SIMULATION DONE ############################################################"
@echo "##############################################################################"
@echo "# Simulation dump: $(PWD)/build_dirs/$@/dump.fst"
@echo "# Simulation log : $(PWD)/build_dirs/$@/simulation.log"
@echo "# Results XML : $(PWD)/build_dirs/$@/results.xml"
@echo "##############################################################################"
@echo "##############################################################################"
build_dirs/%/compile.f: systemrdl/%.rdl
srdl2sv $? --out_dir $(shell dirname $@) --file_log_level DEBUG --stream_log_level DEBUG
ls $(PWD)/$(@D)/*_if.sv > $@
ls $(PWD)/$(@D)/*amba*.sv >> $@
ls $(PWD)/$(@D)/*.sv | grep -v '.*_if.sv$$' | grep -v '.*amba.*' >> $@
clean:
rm -rf build_dirs