Simulation Output File Processing Considerations - 2021.2 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
UG1076
ft:locale
English (United States)
Release Date
2021-12-17
Version
2021.2 English

The files associated with the simulation output(s) may not be written to completely after graph.end(). If your main() program is reading these files—to verify the results of the simulation, Xilinx recommends a wait of two seconds between graph.end() and opening of the files. In the following example, main() waits for two seconds.

// graph.cpp
#include "simpleGraph.h"
#include 
#include 
simpleGraph mygraph;
simulation::platform<1,1> platform("input1.txt","output1.txt");
..
int main(int argc, char ** argv) 
{
mygraph.init();
mygraph.run(4);
mygraph.end();

// wait 2 seconds after mygraph.end() before opening output files.
sleep(2);
#ifndef __X86SIM__
#define SIM_OUTPUT "aiesimulator_output"
#else
#define SIM_OUTPUT "x86simulator_output"
#endif
std::ifstream fOutput1(SIM_OUTPUT "/data/output1.txt");
..
}