From 4fed27fc16428771e9f7d3394d5545438ec3775f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 25 May 2018 21:13:14 +0200 Subject: [PATCH] Fix showtrace.py for changed objdump output format Signed-off-by: Clifford Wolf --- README.md | 2 +- showtrace.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4aeea16..2260492 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ Support for the timer is always disabled when ENABLE_IRQ is set to 0. #### ENABLE_TRACE (default = 0) Produce an execution trace using the `trace_valid` and `trace_data` output ports. -For a demontration of this feature run `make testbench.vcd` to create a trace file +For a demontration of this feature run `make test_vcd` to create a trace file and then run `python3 showtrace.py testbench.trace firmware/firmware.elf` to decode it. diff --git a/showtrace.py b/showtrace.py index 7d7316a..60ffcd6 100644 --- a/showtrace.py +++ b/showtrace.py @@ -11,7 +11,7 @@ with subprocess.Popen(["riscv32-unknown-elf-objdump", "-d", elf_filename], stdou while True: line = proc.stdout.readline().decode("ascii") if line == '': break - match = re.match(r'^\s*([0-9a-f]+):\s+(\S+)\s*(.*)', line) + match = re.match(r'^\s*([0-9a-f]+):\s+([0-9a-f]+)\s*(.*)', line) if match: insns[int(match.group(1), 16)] = (int(match.group(2), 16), match.group(3).replace("\t", " ")) with open(trace_filename, "r") as f: