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

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

6.3.2. Temporal Breakpoints

Intel® Simics® simulator can handle temporal breakpoints. This means that you can set up a breakpoint that triggers after some configurable time. Since in Intel® Simics® simulator, the concept of time can be related CPU steps or cycles, the temporal breakpoint can also be referred to a specific step or a cycle count as measured by a given processor.

The Intel® Simics® simulator commands used to set up these breakpoints are the following:

bp.cycle.break [object]  cycles [-absolute]
bp.step.break  [object]  steps  [-absolute]
bp.time.break  [object]  time   [-absolute]

The above commands configure a breakpoint to trigger after the specified number of cycles, steps, or seconds. The steps and cycles operate over the object provided as an argument that normally corresponds to a CPU. If no object is specified, the currently selected frontend processor is used (see psel command). If the -absolute argument is specified, the cycles, steps, or time is counted from the start of the simulation instead. The following capture shows some examples on how you can use these commands:

#Intel Simics simulator CLI  
simics> ptime
-------------------------------------------------------------
     Processor                Steps      Cycles      Time (s)
-------------------------------------------------------------
system...agilex_hps.core[0]   306259127  306259209   3.794
-------------------------------------------------------------

simics> bp.cycle.break 1000 
Breakpoint 1: system...agilex_hps.core[0] will break at cycle 306260209 
simics> r 
[bp.cycle] Breakpoint 1: system...agilex_hps.core[0] reached cycle 306260209 
simics> ptime
-------------------------------------------------------------
     Processor                Steps      Cycles      Time (s)
-------------------------------------------------------------
system...agilex_hps.core[0]   306260127  306260209   3.794
-------------------------------------------------------------

simics> bp.step.break 1000 
Breakpoint 2: system...agilex_hps.core[0] will break at step 306261127 
simics> bp.list
------------------------------------------------------------------------------
ID                     Description                    Enabled    Oneshot Hit
                                                                         count 
------------------------------------------------------------------------------
2  system...agilex_hps.core[0] br .. step 306261127   true       true   0 
------------------------------------------------------------------------------

simics> r 
[bp.step] Breakpoint 2: agilex.hps.core[0] reached step 306261127 
simics> ptime
-------------------------------------------------------------
     Processor                Steps      Cycles      Time (s)
-------------------------------------------------------------
system...agilex_hps.core[0]   306261127  306261209   3.794
-------------------------------------------------------------

simics> bp.time.break 0.5 
Breakpoint 3: system...agilex_hps.core[0] will break at time 4.29421449 
simics> r 
[bp.time] Breakpoint 3: system...agilex_hps.core[0] reached time 4.29421449 
simics> ptime
-------------------------------------------------------------
     Processor                Steps      Cycles      Time (s)
-------------------------------------------------------------
system...agilex_hps.core[0]   346261127  346261209   4.294
-------------------------------------------------------------

In the above example, the following exercises are being executed:

  • Initially, the simulation is paused and the ptime command is called to obtain the current CPU selected, the steps, cycles and time. Not that the current number of cycles is 306259209.
  • Then, a temporal breakpoint is configured to trigger after 1000 cycles. As no object is provided as argument, this applies to the core[0] which is the current one selected. The simulation is run.
  • The simulation is stopped as the breakpoint got triggered. Notice that there is a message indicating that the simulation reached cycle 306260209 which is actually the expected cycle number after the 1000 cycles configured for the breakpoint to trigger. This cycle count is also confirmed by calling the ptime command.
  • Next, a new temporal breakpoint is configured to occur after 1000 steps of the current core selected. The breakpoint are listed and you can see that this new breakpoint has the ID equal to 2. The simulation is run.
  • The simulation is stopped as the breakpoint got triggered and you can confirm that this occurred at the expected step number based on the log message that indicates that you reached step 306261127, which corresponds to 1000 steps after the breakpoint was set. This is also confirmed with the ptime command.
  • Next a new temporal breakpoint is configured to trigger after 0.5 seconds. The simulation is run.
  • The simulation is stopped as the breakpoint got triggered and you can confirm that the time in which the trigger occurred is the expected based on the message saying that you reached time 4.29421449, which corresponds to 0.5 seconds after the breakpoint was set. This also is confirmed when calling the ptime command again.
Note: The temporal 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-cycle 1000
Breakpoint 6: system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0] will break at cycle 346262209
simics> system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0].bp-break-step 1000
Breakpoint 7: system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0] will break at step 346262127
simics> system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0].bp-break-time 0.5
Breakpoint 8: system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0] will break at time 4.79421449