The
Versal™
ACAP AI Engine System C simulator (aiesimulator
) includes the modeling of the global
memory (DDR memory) and the network on chip (NoC) in addition to the AI Engine array. When the application is compiled
using the System C simulation target, the AI Engine System C simulator can be invoked as follows:
aiesimulator –-pkg-dir ./Work
The various configuration and binary files are generated by the
AI Engine compiler under the Work directory (see Compiling an AI Engine Graph Application) and specified using the --pkg-dir
option to the simulator. The graph is initialized, run, and
terminated by a control thread expressed in the main
application. The AI Engine
compiler compiles that control thread with a PS IP wrapper to be directly loaded
into the simulator.
By default, the graph.run()
option
specifies a graph that runs forever. The AI Engine compiler generates code to execute the data-flow graph in a perpetual While
loop, thus simulation also runs perpetually. To
create terminating programs for debugging, specify graph.run(<number_of_iterations>)
in your graph code to limit
the execution for the specified number of iterations. The specified number of
iterations can be any positive integer value.
The AI Engine simulator command first configures the simulator as specified in the compiler generated Work/config/scsim_config.json file. This includes loading PL IP blocks and their connections, configuring I/O data file drivers, and configuring the NoC and global memory (DDR memory) connections. It then executes the specified PS application and finally exits the simulator.
printfs
in kernel code to appear on the console, and
also generates profile information. Also, the --dump-vcd
<filename> option generates a value change dump (VCD) for the
duration of the simulation. The --simulation-cycle-timeout
<number-of-cycles> can be used to exit the simulation after a
given number of clock cycles. graph.run()
the simulation runs
forever. You need to press Ctrl+c twice to exit the
simulator--simulation-cycle-timeout
option to stop the simulator on the exact
cycle. The total cycles that appear on the profiling report are same on each
run.