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

ID 784383
Date 7/08/2024
Public
Document Table of Contents

5.4.5.1. Breakpoints on CLI Log Messages

When inspecting hardware ( Intel® Simics® model of a component), sometimes it is useful to stop the simulation when a certain log message is observed in the CLI. For this, Intel® Simics® simulator provides the ability to define breakpoints that can be configured to trigger when a specific message is observed in the CLI. To this, use the following command:

<bp-manager.log>.break [object] [-re]  ["substr"] [type] [-once]

You can use this command in several ways. For example:

  • You can define if you want to break when any specific object sends a message using the object argument.
  • You define a specific text for which you want to break using the substr argument.
  • You can use the -re argument to break on a regular expression.
  • You can specify if you want to break on a specific type of message (info, error, critical, etc) using the type argument.
  • You can indicate if you want to break only once with the -once argument. You can have any combination of these parameters to narrow down the messages list that can cause the trigger. If no argument is given, breaking on all logs is enabled.

The following capture shows some examples on you can use this command:

#Intel Simics simulator CLI

simics> log-level -r "system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0]” 4
[system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0]] Changing log level recursively: 1 -> 4

simics> bp.log.break object="system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0]"
Breakpoint 1: Break on '<all>' log messages from system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0] hierarchy

simics> bp.list

---------------------------------------------------------------------
ID   Description	         Enabled Oneshot Ignore count  Hit count
---------------------------------------------------------------------
 1   Break on <all> log       true    false         0           0
     messages from
     system..._hps.timer[0] 
     hierarchy
---------------------------------------------------------------------

simics> run
[system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0] info] Write to register aarch64.cntfrq <- 0x0000000017d78400
[system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0]] Breakpoint 1: system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0] log message of type <all>

simics> bp.list
---------------------------------------------------------------------
ID   Description	         Enabled Oneshot Ignore count  Hit count
---------------------------------------------------------------------
 1   Break on <all> log       true    false         0           1
     messages from
     system..._hps.timer[0] 
     hierarchy
---------------------------------------------------------------------

simics> bp.delete 1

simics> bp.log.break substr = "Write to register" -once
Breakpoint 2: Break on '<all>' log messages matching 'Write to register'

simics> bp.list
------------------------------------------------------------------
ID   Description	      Enabled Oneshot Ignore count  Hit count
------------------------------------------------------------------
 1   Break on <all> log    true    false       0           0
     messages matching 
     'Write to register' 
------------------------------------------------------------------

simics> run
[system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0] info] Write to register aarch64.cntp.ctl <- 0x0000000000000003
[system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0]] Breakpoint 2: system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0] log message of type <all> matching 'Write to register'

simics> bp.list

----------------------------------------------------------------
ID   Description	    Enabled Oneshot Ignore count  Hit count
----------------------------------------------------------------
----------------------------------------------------------------

In the previous example, you are following the next sequence:

  • Start increasing the log level of messages under the system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0] object using the log-level -r command.
  • A breakpoint is set for any of the log messages displayed by the system.board.fpga.soc_inst.hps_subsys.agilex_hps.timer[0] object. Use the bp.list command to list all the breakpoints set at that time. This indicates that you have only one breakpoint with an ID = 1. The breakpoint is enabled and the Hit count is 0.
  • The simulation is run and this stops when you see in the CLI an message displayed by the above object. Here, you call again the bp.list command, the breakpoint is still enabled, and the Hit count is now 1.
  • The breakpoint is deleted using the bp.delete command using the ID = 1.
  • A new breakpoint is created, this time the trigger condition is any message that includes the "Write to read-only field” string. This time, the -once flag is used, so after triggering, this breakpoint must not be enabled anymore. The bp.list command is called again, and you see that the ID of this is 1. The breakpoint with ID = 1 is no longer on the list. Also, observe that the OneShot field is in true this time and the Hit count is 0.
  • The simulation is run again, and it stops when the string is displayed in the CLI. Here, you list all the breakpoints with the bp.list command and you see that the breakpoints in no longer in the list because of the use of -once configuration which removes the breakpoint after the trigger.