Visible to Intel only — GUID: ljg1684169779947
Ixiasoft
Visible to Intel only — GUID: ljg1684169779947
Ixiasoft
6.3.4. Hardware Access Breakpoints
Intel® Simics® simulator provides the capability to create breakpoints associated with the access of registers in a device. This can be useful to debug target software as you can identify whenever a register or set of registers is accessed. There are several Intel® Simics® simulator commands that you can use for this.
Command |
Description |
---|---|
bp.bank.break | Enables breaking the simulation on register bank accesses. |
bp.bank.run-until | Runs the simulation until the specified register bank access occurs. |
bp.bank.trace | Enables tracing of register bank accesses. When this is enabled, every time the specified register bank access occurs during simulation, a message is printed. |
bp.bank.wait-for | Postpones execution of a script branch until the specified register bank access occurs. |
These commands allow you to set a breakpoint in a read or write access to a full bank of registers or in single register defined by its name or by its offset. It also allows you to set a breakpoint in accessing a set of registers defined with an address range or when the register gets written to a specific value.
#Intel Simics simulator CLI # Exercise 1 simics> bp.bank.break agilex.gpio0.bank.regs -r Breakpoint 1: Will break on read access on agilex.gpio0.bank.regs simics> r running> devs agilex.gpio0.bank.regs --------------------------------------------------------------------- Count Device Space Range --------------------------------------------------------------------- 0 agilex.gpio0. .. agilex.hps.phys_mem 0xffc03200-0xffc032ff --------------------------------------------------------------------- [agilex.gpio0.bank.regs] Breakpoint 1: agilex.gpio0.bank.regs read at offset=0xfc size=0x4 value=0x0 ini=agilex.hps.core[0]
Exercise 1 sets a breakpoint on a read access to any of the registers under the gpio0 device. This creates a breakpoint with the ID 1. The simulation is run and at this point, it is expected that the target software does a read access to a register under this bank (address 0xffc032fc used in this example). After doing the read access, you can observe that the simulation was stopped as a consequence of the breakpoint trigger.
#Intel Simics simulator CLI # Exercise 2 simics> devs agilex.gpio0.bank.regs --------------------------------------------------------------------- Count Device Space Range --------------------------------------------------------------------- 0 agilex.gpio0. .. agilex.hps.phys_mem 0xffc03300-0xffc033ff --------------------------------------------------------------------- simics> print-device-regs agilex.gpio1 Bank: regs Offset Name Size Value 0x0 GPIO_SWPORTA_DR 4 0x0 : 0x48 GPIO_DEBOUNCE 4 0x0 simics> bp.bank.trace agilex.gpio1.bank.regs register="GPIO_DE-BOUNCE" 3 simics> bp.bank.run-until agilex.gpio1.bank.regs register="GPIO_DEBOUNCE" -w value=0xcafe [bp.bank trace] [trace:4] agilex.gpio1.bank.regs read at offset=0x48 size=0x4 value=0xcafe ini=agilex.hps.core[0] [bp.bank trace] [trace:4] agilex.gpio1.bank.regs write at offset=0x48 size=0x4 value=0xcafe ini=agilex.hps.core[0]
- The first one is a trace to detect any read/write operation in the register, this gets an ID of 3.
- The second breakpoint is set with the run-until command. This breakpoint is configured to trigger on a write operation to the same register with the value 0xcafe.
In this example, a read operation to the register is done in the target software followed by the expected write operation. After this, you can see that a couple of messages are printed describing the read and write operations and also the simulation is stopped as a consequence of the last breakpoint.
The command used to set up the breakpoints presented in this section can be called directly over the objects used as argument. For this, the following commands can be used instead:
- <object>.regs.bp-break-bank
- <object>.regs.bp-run-until-bank
- <object>.regs.bp-trace-bank
- <object>.regs.bp-wait-for-bank