Open bilgiday opened 2 years ago
Thanks for the report. I suspect it's something to do with the Verilator/OpenOCD interface given it works fine on FPGA. I'll see if 8 hardware breakpoints works on Ibex Super System (FPGA system that gives you an Ibex core and debug and not much else, far simpler than OT so easier to debug) as a first step.
@GregAC - not sure if there were any updates on this or if this is something that has been resolved in one-to-one communications? When you have a chance could you see if this is something that is still a live issue.
Quick update: I've had a look at an Ibex Super System build with 8 trigger points on FPGA and all looks to work fine. So whatever is happening here is specific to the OT Verilator infrastructure.
My Environment
EDA tool and version: Verilator 4.210 2021-07-07 rev v4.210 (openocd) Open On-Chip Debugger 0.11.0 (riscv32-unknown-elf-gdb) GNU gdb (crosstool-NG 1.24.0.498_5075e1f) 11.1
Operating system: PRETTY_NAME="Debian GNU/Linux rodete" NAME="Debian GNU/Linux" VERSION_ID="rodete" VERSION="12 (rodete)" VERSION_CODENAME=rodete ID=debian
Version of the Ibex source code: Two versions:
Version 1: I work on the
OpenTitan
repo v: dd14447ef716bb62ce539e48b4841c7f4e1d2ed7DbgHwBreakNum
were added to support multiple hardware breakpoints in the Ibex core. I did the following modifications in my local Opentitan repo to enable 8 breakpoints in theearlgrey
configuration ofOpentitan
:Issue
Ignoring packet error, continuing...Invalid hex digit 116
. After this point, the only way to end the simulation is to usekill -9 <verilator-proc-id>
(See the examples below)set remotetimeout 30
.Examples
Here are a few example outputs from different debug sessions:
verilator command:
build-out/hw/sim-verilator/Vchip_sim_tb --meminit=rom,build-bin/sw/device/lib/testing/test_rom/test_rom_sim_verilator.scr.39.vmem --meminit=flash,build-bin/sw/device/tests/otp_ctrl_smoketest_sim_verilator.64.scr.vmem --meminit=otp,build-bin/sw/device/otp_img/otp_img_sim_verilator.vmem
openocd command and output:
openocd -s util/openocd -f board/lowrisc-earlgrey-verilator.cfg
GDB example 1: Modified OT, supporting 8 hardware breakpoints
gdb command and output:
riscv32-unknown-elf-gdb -iex "set remotetimeout 30" -iex "target extended-remote :3333" -iex "info reg" build-bin/sw/device/lib/testing/test_rom/test_rom_sim_verilator.elf
Temporary breakpoint 1, rom_test_main () at ../sw/device/lib/testing/test_rom/test_rom.c:52 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) c Continuing. Ignoring packet error, continuing... Warning: Cannot insert breakpoint 2: Invalid hex digit 116
Command aborted. (gdb)
(gdb) tbreak rom_test_main Temporary breakpoint 1 at 0x823a: file ../sw/device/lib/testing/test_rom/test_rom.c, line 52. (gdb) j *0x8084 Line 91 is not in `mmio_region_read32'. Jump anyway? (y or n) y Continuing at 0x8084.
Temporary breakpoint 1, rom_test_main () at ../sw/device/lib/testing/test_rom/test_rom.c:52 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) si 0x0000823c 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) si 0x0000823e 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) si 0x00008240 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) tbreak rom_test_main Temporary breakpoint 2 at 0x823a: file ../sw/device/lib/testing/test_rom/test_rom.c, line 52. (gdb) j *0x8084 Line 91 is not in `rom_test_main'. Jump anyway? (y or n) y Continuing at 0x8084.
Temporary breakpoint 2, rom_test_main () at ../sw/device/lib/testing/test_rom/test_rom.c:52 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) si 0x0000823c 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x0000823e 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x00008240 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x00008242 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x00008246 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x0000824a 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) Ignoring packet error, continuing... Invalid hex digit 116 (gdb)
(gdb) si [0] Found 1 triggers mmio_region_write32 (base=..., offset=28, value=48) at /usr/local/google/home/bilgiday/Documents/opentitan/ot-repo3/sw/device/lib/base/mmio.h:145 145 ((volatile uint32_t )base.base)[offset / sizeof(uint32_t)] = value; (gdb) tbreak rom_test_main Temporary breakpoint 1 at 0x823a: file ../sw/device/lib/testing/test_rom/test_rom.c, line 52. (gdb) j 0x8084 Line 91 is not in `mmio_region_write32'. Jump anyway? (y or n) y Continuing at 0x8084.
Temporary breakpoint 1, rom_test_main () at ../sw/device/lib/testing/test_rom/test_rom.c:52 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) si 0x0000823c 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) si 0x0000823e 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x00008242 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x00008246 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) 0x0000824a 52 CHECK_DIF_OK(dif_pinmux_init( (gdb) Ignoring packet error, continuing... Invalid hex digit 116 (gdb)