Fix showtrace.py for changed objdump output format
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
1cc9784d71
commit
4fed27fc16
|
@ -281,7 +281,7 @@ Support for the timer is always disabled when ENABLE_IRQ is set to 0.
|
||||||
#### ENABLE_TRACE (default = 0)
|
#### ENABLE_TRACE (default = 0)
|
||||||
|
|
||||||
Produce an execution trace using the `trace_valid` and `trace_data` output ports.
|
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
|
and then run `python3 showtrace.py testbench.trace firmware/firmware.elf` to decode
|
||||||
it.
|
it.
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ with subprocess.Popen(["riscv32-unknown-elf-objdump", "-d", elf_filename], stdou
|
||||||
while True:
|
while True:
|
||||||
line = proc.stdout.readline().decode("ascii")
|
line = proc.stdout.readline().decode("ascii")
|
||||||
if line == '': break
|
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", " "))
|
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:
|
with open(trace_filename, "r") as f:
|
||||||
|
|
Loading…
Reference in New Issue