diff --git a/target/common/common.mk b/target/common/common.mk index 9e95795d3..6b7c45be0 100644 --- a/target/common/common.mk +++ b/target/common/common.mk @@ -26,6 +26,7 @@ VSIM ?= $(QUESTA_SEPP) vsim VOPT ?= $(QUESTA_SEPP) vopt VLOG ?= $(QUESTA_SEPP) vlog VLIB ?= $(QUESTA_SEPP) vlib +ADDR2LINE ?= $(LLVM_BINROOT)/llvm-addr2line # Internal executables GENTRACE_PY ?= $(UTIL_DIR)/trace/gen_trace.py @@ -80,7 +81,7 @@ VLT_FLAGS += --unroll-count 1024 VLT_CFLAGS += -std=c++14 -pthread VLT_CFLAGS +=-I ${VLT_BUILDDIR} -I $(VLT_ROOT)/include -I $(VLT_ROOT)/include/vltstd -I $(VLT_FESVR)/include -I $(TB_DIR) -I ${MKFILE_DIR}/test -ANNOTATE_FLAGS ?= -q --keep-time +ANNOTATE_FLAGS ?= -q --keep-time --addr2line=$(ADDR2LINE) LAYOUT_EVENTS_FLAGS ?= --cfg=$(CFG) # We need a recent LLVM installation (>11) to compile Verilator. diff --git a/util/trace/annotate.py b/util/trace/annotate.py index 512556190..e14853bdb 100755 --- a/util/trace/annotate.py +++ b/util/trace/annotate.py @@ -164,7 +164,7 @@ def dump_hunk(hunk_tstart, hunk_sstart, hunk_trace, hunk_source): # Open ELF file for addr2line processing -elf = a2l.Elf(elf_file) +elf = a2l.Elf(elf_file, addr2line) # core functionality with open(trace, 'r') as f: