Skip to content

Commit

Permalink
vlt: Wrap simulation binary in script
Browse files Browse the repository at this point in the history
This is required to run it on IIS machines since verilator currently can
only be run in the oseda environment
  • Loading branch information
fischeti committed Jan 24, 2025
1 parent 5e27beb commit f60f8a7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions target/common/verilator.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

$(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR)
# This target just redirects the verilator simulation binary.
# On IIS machines, verilator needs to be built and run in
# the oseda environment, which is why this is necessary.
$(BIN_DIR)/$(TARGET).vlt: $(BIN_DIR)/$(TARGET)_bin.vlt
@echo "#!/bin/bash" > $@
@echo '$(VERILATOR_SEPP) $< $$(realpath $$1)' >> $@
@chmod +x $@

$(BIN_DIR)/$(TARGET)_bin.vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR)
$(VLT) $(shell $(BENDER) script verilator $(VLT_BENDER)) \
$(VLT_FLAGS) --Mdir $(VLT_BUILDDIR) \
-CFLAGS -std=c++20 \
Expand All @@ -14,6 +22,6 @@ $(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VL

.PHONY: clean-vlt
clean-vlt: clean-work
rm -rf $(BIN_DIR)/$(TARGET).vlt $(VLT_BUILDDIR)
rm -rf $(BIN_DIR)/$(TARGET).vlt $(BIN_DIR)/$(TARGET)_bin.vlt $(VLT_BUILDDIR)

clean: clean-vlt

0 comments on commit f60f8a7

Please sign in to comment.