Skip to content

Commit

Permalink
traces: Use addr2line from software build toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Feb 16, 2024
1 parent 03e0730 commit c714f2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion target/common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion util/trace/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c714f2e

Please sign in to comment.