Skip to content

Commit

Permalink
target: Move .rtlbinary to SIM_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Feb 21, 2024
1 parent b77e62d commit 272d34e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Annotate traces
working-directory: target/snitch_cluster
run: |
make LOGS_DIR=./runs/simple/logs annotate -j
make SIM_DIR=./runs/simple annotate -j
# Tests requiring hardware FDIV unit
sw-snitch-cluster-fdiv-vlt:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ snitch-cluster-vsim:
- cd target/snitch_cluster
- make bin/snitch_cluster.vsim
- ./run.py sw/run.yaml --simulator vsim -j --run-dir runs/vsim
- make LOGS_DIR=./runs/vsim/simple/logs annotate -j
- make SIM_DIR=./runs/vsim/simple annotate -j

# Banshee
snitch-cluster-banshee:
Expand Down
11 changes: 5 additions & 6 deletions target/common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
DEBUG ?= OFF # ON to turn on wave logging

# Directories
LOGS_DIR ?= logs
SIM_DIR ?= $(shell pwd)
TB_DIR ?= $(SNITCH_ROOT)/target/common/test
UTIL_DIR ?= $(SNITCH_ROOT)/util
LOGS_DIR = $(SIM_DIR)/logs

# SEPP packages
QUESTA_SEPP ?=
Expand Down Expand Up @@ -184,16 +185,14 @@ define QUESTASIM
@mkdir -p $(dir $@)
@echo "#!/bin/bash" > $@
@echo 'binary=$$(realpath $$1)' >> $@
@echo 'mkdir -p $(LOGS_DIR)' >> $@
@echo 'echo $$binary > $(LOGS_DIR)/.rtlbinary' >> $@
@echo 'echo $$binary > .rtlbinary' >> $@
@echo '${VSIM} +permissive ${VSIM_FLAGS} $$3 -work ${MKFILE_DIR}/${VSIM_BUILDDIR} -c \
-ldflags "-Wl,-rpath,${FESVR}/lib -L${FESVR}/lib -lfesvr -lutil" \
$(1)_opt +permissive-off ++$$binary ++$$2' >> $@
@chmod +x $@
@echo "#!/bin/bash" > [email protected]
@echo 'binary=$$(realpath $$1)' >> $@.gui
@echo 'mkdir -p $(LOGS_DIR)' >> $@.gui
@echo 'echo $$binary > $(LOGS_DIR)/.rtlbinary' >> $@.gui
@echo 'echo $$binary > .rtlbinary' >> $@.gui
@echo '${VSIM} +permissive ${VSIM_FLAGS} -work ${MKFILE_DIR}/${VSIM_BUILDDIR} \
-ldflags "-Wl,-rpath,${FESVR}/lib -L${FESVR}/lib -lfesvr -lutil" \
$(1)_opt +permissive-off ++$$binary ++$$2' >> $@.gui
Expand Down Expand Up @@ -257,7 +256,7 @@ $(LOGS_DIR)/trace_hart_%.txt $(LOGS_DIR)/hart_%_perf.json: $(LOGS_DIR)/trace_har

# Generate source-code interleaved traces for all harts. Reads the binary from
# the logs/.rtlbinary file that is written at start of simulation in the vsim script
BINARY ?= $(shell cat $(LOGS_DIR)/.rtlbinary)
BINARY ?= $(shell cat $(SIM_DIR)/.rtlbinary)
$(LOGS_DIR)/trace_hart_%.s: $(LOGS_DIR)/trace_hart_%.txt ${ANNOTATE_PY}
$(PYTHON) ${ANNOTATE_PY} ${ANNOTATE_FLAGS} -o $@ $(BINARY) $<
$(LOGS_DIR)/trace_hart_%.diff: $(LOGS_DIR)/trace_hart_%.txt ${ANNOTATE_PY}
Expand Down

0 comments on commit 272d34e

Please sign in to comment.