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

ID 784383
Date 12/04/2023

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

Document Table of Contents

6.2. Capturing Serial Console Output

When debugging target software, it is common to use the serial console in the virtual platform to display debug messages. It is also common to save the output of the serial console into a file so that it can be used as a reference when comparing with other log files obtained from a different debug session. For this, Intel® Simics® simulator provides some commands that allow you to create these log files under the host file system. These commands are described in the following:

<SerialConsoleObject>.con.capture-start filename [-overwrite]
<SerialConsoleObject> filename [-overwrite]


  • The capture-start command captures all output from the serial console to the file indicated by the filename argument starting from the moment in which this command is called. If -overwrite is specified, the file is overwritten, otherwise it is appended.
  • The capture-stop command is used after calling the capture-start command to stop the capture of the serial console into the file.
  • The save-to-file command saves the current output in the serial console (including scrollback data) to the file indicated by the filename argument. If -overwrite is specified, the file is overwritten, otherwise it is appended.

An example of how these commands are used is shown in the following:

# Intel Simics simulator CLI 

simics> r 200 ms
simics> serialPrev.log
Console screen saved to serialPrev.log
simics> agilex.console0.con.capture-start serialAfter.log
simics> r 300 ms
simics> agilex.console0.con.capture-stop
Capture to file 'serialAfter.log' stopped.
simics> r 2 s
simics> ls
serialAfter.log   serialPrev.log

In the capture above, you start the simulation running 200 ms. During this time, some messages are already printed in the serial console. To save the current messages into a file, use the save-to-file command with the file name serialPrev.log. The current content of this file is shown in the following and from these, you can see the initial messages that the system has sent to the serial console:

# simicsPrev.log file

U-Boot SPL 2020.07-08670-g694f92d62e (Nov 02 2020 - 13:56:52 +0300)
Reset state: Cold
MPU          1000000 kHz
L4 Main       400000 kHz
L4 sys free   100000 kHz
L4 MP         200000 kHz
L4 SP         100000 kHz
U-Boot 2020.07-08670-g694f92d62e (Nov 02 2020 - 13:56:52 +0300)socfpga_agilex
CPU:   Intel FPGA SoCFPGA Platform (ARMv8 64bit Cortex-A53)
Model: SoCFPGA Agilex SoCDK
DRAM:  8 GiB

After this, you call the capture-start command to request that any new message be saved into the serialAfter.log file and run the simulation for a couple of seconds. The capture finishes by the time you call the capture-stop command. You run the simulation for two seconds, but the new messages displayed in the serial console during this time are not saved into any file. At this point, you called the ls command, and you can see that the two files were created under the project directory. The following capture shows the messages saved in the serialAfter.log file:

# simicsAfter.log file

WDT:   Started with servicing (30s timeout)
MMC:   dwmmc0@ff808000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment
In:    serial0@ffc02000
Out:   serial0@ffc02000
Err:   serial0@ffc02000
Warning: ethernet@ff800000 (eth0) using random MAC address - 
eth0: ethernet@ff800000
Hit any key to stop autoboot:  1