A virtual platform specification helps to connect the data flow graph written with external I/O mechanisms specific to the chosen target for testing or eventual deployment. The platform could be specified for a simulation, emulation, or an actual hardware execution target.
Current release support is only for a simulation platform, which implies that you can execute a data flow graph in a software simulation environment. This is the specification.
simulation::platform<#inputs, #outputs> platform-name(port-attribute-list);
The #inputs
and #outputs
specify how many input and output ports are needed
in the platform to connect to the data flow graph. The platform object is pre-populated
with src
and sink
arrays of output and input ports (respectively) to make the connection. The simpleGraph
example from AI Engine Programming is used in this example.
simpleGraph mygraph;
simulation::platform<1,1> platform("input.txt","output.txt");
connect<> net0(platform.src[0], mygraph.in);
connect<> net1(mygraph.out, platform.sink[0]);
The port-attribute list within the platform declaration is an enumeration of attributes of each platform port starting with all the inputs and followed by the outputs. These are described in the following sections.