Platform Ports - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

A top-level application file graph.cpp is created which contains an instance of the graph class and is connected to a simulation platform. 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.

#include "graph.h"

// Virtual platform ports
PLIO* in1 = new PLIO("DataIn1", adf::plio_64_bits, "data/input.txt");
PLIO* out1 = new PLIO("DataOut1", adf::plio_64_bits, "data/output.txt");
simulation::platform<1, 1> platform(in1, out1);

// Graph object
myGraph filter_graph;

// Virtual platform connectivity
connect<> net0(platform.src[0], filter_graph.inptr);
connect<> net1(filter_graph.outptr, platform.sink[0]);
  1. PLIO

    A PLIO port attribute is used to make external stream connections that cross the AI Engine to programmable logic (PL) boundary. PLIO attributes are used to specify the port name, port bit width and the input/output file names. Note that when simulating PLIO with data files, the data should be organized to accomodate both the width of the PL block as well as the data type of connecting port on the AI Engine block.

    //Platform ports
    PLIO* in1 = new PLIO("DataIn1", adf::plio_64_bits, "data/input.txt");
    PLIO* out1 = new PLIO("DataOut1", adf::plio_64_bits, "data/output.txt");
    
  2. GMIO

    A GMIO port attribute is used to make external memory-mapped connections to or from the global memory. These connections are made between an AI Engine graph and the logical global memory ports of a hardware platform design.

    //Platform ports
    GMIO gmioIn1("gmioIn1", 64, 1000);
    GMIO gmioOut("gmioOut", 64, 1000);
    
    //Virtual platform
    simulation::platform<1, 1> platform(&gmioIn1, &gmioOut);
    
    //Graph object
    myGraph filter_graph;
    
    //Platform ports
    connect<> net0(platform.src[0], filter_graph.in1);
    connect<> net1(filter_graph.out1, platform.sink[0]);