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

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

5.5.1. CPU Frequency

In real hardware, the processor clock is used to synchronize the internal processes that occur in the CPU such as the fetching of instructions, decoding and executing them. Because of this, the clock frequency is one of the parameters that defines how fast the CPU can execute certain pieces of software.

In an Intel® Simics® simulation having a higher or lower CPU frequency does not affect the actual speed of simulation, but it affects the number of instructions that need to be executed for a certain amount of simulated time to pass. If your execution only depends on executing a certain number of instructions, increasing the clock frequency takes the same amount of host time, but a shorter amount of target time. However, if there are time-based delays of some kind in the simulation, they take longer time to execute. For example, at a simulated 1 MHz, one million target instructions correspond to a simulated second (assuming the simple default timing of one cycle per instruction). At 100 MHz, it takes 100 million target instructions to complete a simulated second. So, with a higher clock frequency, less simulated target time is going to pass for a certain period of host execution time.

The frequency of a CPU in a simulation can be identified using any of the following commands:

  • list-processors
  • <core>.info (for a specific core, example: system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0].info)
  • <core>.status (for a specific core, example: system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0].status)
# Intel Simics simulator CLI 

simics> list-processors
-----------------------------------------------------------
   CPU Name                         CPU Class        Freq     
-----------------------------------------------------------
system....agilex_hps.core[0]  *  arm-cortex-a55  400.00 MHz
system....agilex_hps.core[1]     arm-cortex-a55  400.00 MHz 
system....agilex_hps.core[2]     arm-cortex-a76  400.00 MHz
system....agilex_hps.core[3]     arm-cortex-a76  400.00 MHz
-----------------------------------------------------------
* = selected CPU
Note: When using the simulation time reported by Intel® Simics® in your target software (can be accessed indirectly through Intel® Simics® scripting or device modeling by writing this into a register as a time-stamp that can be read later by the target software), Intel recommends adding some validation over the CPU frequency in the target script or device model since any change in the CPU frequency impacts the simulation time data and any incorrect or miss handling of it may create undesired effects in the simulation.