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

ID 784383
Date 12/04/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

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> bp.log.break object="agilex.hps.timer[0].bank.cntbase0"
Breakpoint 1: Break on '<all>' log messages from agilex.hps.timer[0].bank.cntbase0 hierarchy

simics> bp.list
ID:1
Description: Break on <all> log messages from agilex.hps.timer[0].bank.cntbase0 hierarchy
Enabled: true
OneShot: false
Ignore Count: 0
Hit Count: 0

simics> r
[agilex.hps.core[0] unimpl] writing 0x6 to mdcr_el2. Only TDE bit is implemented for register mdcr_el2.
[agilex.hps.timer[0].bank.cntbase0 spec-viol] Write to read-only field cntbase0.cntp_ctl.istatus (value written = 0x00000001, contents = 0x00000000).
[agilex.hps.timer[0].bank.cntbase0] Breakpoint 1: agilex.hps.timer[0].bank.cntbase0 log message of type <all>

simics> bp.list
ID:1
Description: Break on <all> log messages from agilex.hps.timer[0].bank.cntbase0 hierarchy
Enabled: true
OneShot: false
Ignore Count: 0
Hit Count: 1
simics> bp.delete 1
simics> bp.log.break substr = "Write to read-only field" -once
Breakpoint 2: Break on '<all>' log messages matching 'Write to read-only field'

simics> bp.list
ID:2
Description: Break on <all> log messages matching 'Write to read-only field'
Enabled: true
OneShot: true
Ignore Count: 0
Hit Count: 0

simics> r
[agilex.hps.timer[0].bank.cntbase0 spec-viol] Write to read-only field cntbase0.cntp_ctl.istatus (value written = 0x00000001, contents = 0x00000000).
[agilex.hps.timer[0].bank.cntbase0] Breakpoint 2: agilex.hps.timer[0].bank.cntbase0 log message of type <all> matching 'Write to read-only field'


simics> bp.list
---------------------------------------------------------------
ID   Description   Enabled   Oneshot   Ignore count   Hit count
---------------------------------------------------------------

---------------------------------------------------------------

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

  • Start setting a breakpoint for any of the log messages displayed by the agilex.hps.timer[0].bank.cntbase0 object and then use the bp.list command to list all the breakpoints set at that time. This indicates that you have only 1 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.