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: