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

ID 784383
Date 4/01/2024
Public

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

Document Table of Contents

5.3.7. Capture of CLI Session to a File

Intel® Simics® simulator provides the ability to redirect the output of the CLI to a file in the host PC file system. This is helpful when you want to remember or track the commands that were entered in an Intel® Simics® simulation session for repeatability purposes. This is also helpful for debug purposes when you increase the log verbosity of the session (using the log-level command) and you want to send this to someone else for analysis.

Intel® Simics® simulator provides the ability to access the file system of the host PC from the CLI. This can be verified using the pwd, ls or cd commands. The functionality of these commands is equivalent to the same commands that Linux provides. By default, the CLI session runs in the same file system path in which the Intel® Simics® project was created. This path is returned when the pwd command is called. The ls command shows the items in the current path while the cd command allows to switch to a different directory. An example of these operations is as follows:
# Intel Simics simulator CLI  

simics> pwd
Current directory is /home/simicsUser/SimicsInstallDir/project-1

simics> ls

.cproject            .settings    compiler.mk    modules         simics-gui
.modcache            GNUmakefile  config.mk      myImages        targets
.project             artifactory  doc            simics          
.project-properties  bin          documentation  simics-eclipse  

simics> cd targets
simics> pwd

Current directory is /home/simicsUser/SimicsInstallDir/project-1/targets

simics> cd ..

simics> pwd
Current directory is /home/simicsUser/SimicsInstallDir/project-1
Now, the commands used to capture the CLI output to a file are start-command-line-capture and stop-command-line-capture. As the name of the command indicates, the first command defines the moment in which the capture starts while the second one defines the moment in which the capture finishes. The syntax for these commands is the following.
start-command-line-capture <filename> [-overwrite] [-append] [-timestamp]
stop-command-line-capture <filename>

For the start command, the file is not overwritten unless you specify the -overwrite flag. The -append flag allows the output to be appended to the specified file. An optional time stamp showing wall-clock time can be added at the start of each line, enabled with the -timestamp flag.

The following capture shows an example of this. Here, it can be seen that the SimicsCLI.log file was created.
# Intel Simics simulator CLI 

simics> start-command-line-capture simicsCLI.log
Output captured to '/root/simicsUser/SimicsInstallDir/project-1/simicsCLI.log'
simics> help-search "breakpoint"
The text 'breakpoint' appears in the documentation
for the following items:
 
Command        <bank_instrumentation_subscribe>.bp-break-bank
Command        <bank_instrumentation_subscribe>.bp-run-until-bank
Command        <bank_instrumentation_subscribe>.bp-trace-bank
Command        <bank_instrumentation_subscribe>.bp-wait-for-bank
Command        <bp-manager.bank>.break
:
Hap            Core_Breakpoint_Memop
Hap            Core_Disable_Breakpoints

 
simics> stop-command-line-capture simicsCLI.log
simics> pwd

Current directory is /root/simicsUser/SimicsInstallDir/project-1

simics> ls

.cproject            .settings    compiler.mk    modules         simics-gui
.modcache            GNUmakefile  config.mk      myImages        simicsCLI.log
.project             artifactory  doc            simics          targets
.project-properties  bin          documentation  simics-eclipse
By reviewing the contents of the new log file ( SimicsCLI.log), you can confirm that the CLI was captured correctly from the time it started to the time it was stopped:
# Host Terminal

$ cat simicsCLI.log
Output captured to '/root/simicsUser/SimicsInstallDir/project-1/simicsCLI.log'
simics> help-search "breakpoint"
The text 'breakpoint' appears in the documentation
for the following items:
 
Command        <bank_instrumentation_subscribe>.bp-break-bank
Command        <bank_instrumentation_subscribe>.bp-run-until-bank
Command        <bank_instrumentation_subscribe>.bp-trace-bank
Command        <bank_instrumentation_subscribe>.bp-wait-for-bank
:
Hap            Core_Breakpoint_Memop
Hap            Core_Disable_Breakpoints
 
simics> stop-command-line-capture simicsCLI.log