From c8e2b8e89549a5c6a9154047329f21207788234f Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Wed, 21 Feb 2024 13:23:40 +0100 Subject: [PATCH] target: Wrap Verilator binary to create `.rtlbinary` --- target/snitch_cluster/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/snitch_cluster/Makefile b/target/snitch_cluster/Makefile index 037621213b..632938f036 100644 --- a/target/snitch_cluster/Makefile +++ b/target/snitch_cluster/Makefile @@ -224,10 +224,18 @@ $(VLT_BUILDDIR)/generated/%.o: $(GENERATED_DIR)/%.cc ${VLT_BUILDDIR}/lib/libfesv # Build compilation script and compile all sources for Verilator simulation # Link verilated archive with $(VLT_COBJ) -bin/snitch_cluster.vlt: $(VLT_AR) $(VLT_COBJ) ${VLT_BUILDDIR}/lib/libfesvr.a +bin/.snitch_cluster.vlt.elf: $(VLT_AR) $(VLT_COBJ) ${VLT_BUILDDIR}/lib/libfesvr.a mkdir -p $(dir $@) $(CXX) $(LDFLAGS) -std=c++14 -L ${VLT_BUILDDIR}/lib -o $@ $(VLT_COBJ) $(VLT_AR) -lfesvr -lpthread +# Build wrapper around Verilator binary, needed to create .rtlbinary +bin/snitch_cluster.vlt: bin/.snitch_cluster.vlt.elf + @echo "#!/bin/bash" > $@ + @echo 'binary=$$(realpath $$1)' >> $@ + @echo 'echo $$binary > .rtlbinary' >> $@ + @echo '$(abspath $<) $$binary $$2' >> $@ + @chmod +x $@ + ############ # Modelsim # ############