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

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

5.4.2.2. Inspect Processor Registers

You can inspect the registers and current execution mode of a processor by using the print processor-registers command (pregs is the alias command). This command returns all registers for the processor core queried. By default, this prints the registers of the current processor selected (psel).

# Intel Simics simulator CLI 

simics> system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[0].print-processor-registers
aarch64
x0    = 0x0000000000000000  x16   = 0x0000000000000000
x1    = 0x0000000000000000  x17   = 0x0000000000000000
x2    = 0x0000000000000000  x18   = 0x0000000000000000
x3    = 0x0000000000000000  x19   = 0x0000000000000000
x4    = 0x0000000000000000  x20   = 0x0000000000000000
x5    = 0x0000000000000000  x21   = 0x0000000000000000
x6    = 0x0000000000000000  x22   = 0x0000000000000000
x7    = 0x0000000000000000  x23   = 0x0000000000000000
x8    = 0x0000000000000000  x24   = 0x0000000000000000
x9    = 0x0000000000000000  x25   = 0x0000000000000000
x10   = 0x0000000000000000  x26   = 0x0000000000000000
x11   = 0x0000000000000000  x27   = 0x0000000000000000
x12   = 0x0000000000000000  x28   = 0x0000000000000000
x13   = 0x0000000000000000  x29   = 0x0000000000000000
x14   = 0x0000000000000000  x30   = 0x0000000000000000
x15   = 0x0000000000000000

pc = 0x0000000000000000

sp :
sp_el0 = 0x0000000000000000 sp_el2 = 0x0000000000000000
sp_el1 = 0x0000000000000000 sp_el3 = 0x0000000000000000

pstate : 00000000000000000000001111001101
         NZCV----UPSI----------DAIF-nEE-S
                 AASL               RLL P
                 ON                 W
:
:
hcr_el2 = 0x0000000000000000 : 0000000000000000000000000000000000000000000000000000000000000000
                               -------------------------MTTTEICRTHTTTTTTTTTTTTTTTTDB FVVVAIFPSV
                                                        IEEL2DDWRCDGVTPPSAISIIIIWWCS BSIFMMMTWM
                                                        OAROH   VDZEMLUCwCDCDDDDEI U  E  OOOWI
                                                        C RR    M    B   RC 3210             O
                                                        N                 P
                                                        C
                                                        E

When used pregs –all command, this prints information of additional registers such as control and floating point registers.

You can print the value of one processor register by entering the %[register name] command.
# Intel Simics simulator CLI 

# Printing the value of register “x11” using %reg:
simics> %x11
0

# Printing the value of register “x11” using [processor_path].read-reg:
simics> system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[1].read-reg x11
0

# Changing output to the hexadecimal by using “output-radix 16”, options are 2, 8, 10, and 16.
simics> output-radix 16
simics> %x11
0x0

Intel® Simics® simulator allows you to modify the register value by using the [processor_path].write-reg command. This can be done at any time during the simulation and without depending on the embedded software for this.

# Intel Simics simulator CLI 

# Writing a value into a processor register, in this case, writing 0x2801111 to the reg x8 of core[1]

simics> system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[1].write-reg x8 0x2801111

# Check the new register value in hexadecimal.
simics> output-radix 16
simics> system.board.fpga.soc_inst.hps_subsys.agilex_hps.core[1].read-reg x8
0x2801111