Intel® Simics® Simulator for Intel® FPGAs: User Guide

ID 784383
Date 4/01/2024
Public
Document Table of Contents

6.3.3. CPU Control Register Breakpoints

A control register breakpoint triggers when the selected control register is accessed. The access type is determined by the break command arguments used. The syntax of the command used to set this type of breakpoint is shown in the following:

bp.control_register.break  [object] ("name"|number|-all) [value] [mask] [-r] [-w] [-only-changes] [-once]
Table 20.   bp.control_register.break Command Options
Argument Description
object The CPU object for which the breakpoint is being configured. If no object is provided, the breakpoint operates over the current selected CPU (see psel command).
"name”|number|-all Specifies the control register for which the breakpoint is set. You can set the control register using the name, number, or if -all is used, it operates over all control registers. The available control registers depend on the simulated target.

value

mask

On write accesses, the breakpoint triggers when the result of the write operation results in the value given. On read accesses, the breakpoint triggers if the value read from the register matches the value given.

If mask is specified, only this mask of the register and given value are considered.

-r -w Memory access type that generates the breakpoint trigger (read and write). Any combination of these is allowed. By default, write is selected if none of the arguments is provided.
-only-changes Only write accesses that change the register value are considered to trigger the breakpoint. If mask argument is specified, only changes affecting this mask of the register are considered.
-once This causes the breakpoint to automatically be removed after it has triggered.

The following capture shows an example about how to use this command:

#Intel Simics simulator CLI  

simics> bp.control_register.break name = sctlr_el1 -r -w 
Breakpoint 1: system...agilex_hps.core[0] will break on R/W of sctlr_el1 

simics> bp.list 
-----------------------------------------------------------------------
ID   Description                          Enabled    Oneshot  Hit count
-----------------------------------------------------------------------
1    system....core[0] br .. sctlr_el1    true       false    0
-----------------------------------------------------------------------
simics> r 
[system.board.fpga.soc_inst.hps_subsys.agilex_hps.uart0 unimpl] Write to 
unimplemented field regs.FCR.DMAM (value written = 0x1, contents = 0).
[system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0]] Breakpoint 1: 
system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0] sctlr_el1 <- 0x30d00800
 
simics> bp.list 
-------------------------------------------------------------------
ID   Description                          Enabled    Oneshot  Hit 
                                                              count
-------------------------------------------------------------------
1    system....core[0] br .. sctlr_el1    true       false    1
-------------------------------------------------------------------

In the above example, a breakpoint is being set on write and read operations over the sctrl_el1 control register. This breakpoint is listed showing that this breakpoint has not been triggered yet as the Hit count value is 0. After this point, the simulation is run and during the target software execution the breakpoint gets triggered after a write operation. The breakpoint is listed again and this time, the Hit count value is 1.

Note: The CPU control registers breakpoints can also be set directly using commands over the object (CPU) selected. The following capture shows how the same commands used in the previous example can be called using the core[0] object:
#Intel Simics simulator CLI 
simics> system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0].bp-break-control-register name = sctlr_el1 -r -w
Breakpoint 2: system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0] will break on R/W of sctlr_el1