Hierarchical Constraints - 2022.1 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
Release Date
2022.1 English

When creating complex graphs with multiple subgraph classes, or multiple instances of the same subgraph class, the location constraints described previously can also be applied to each kernel instance or kernel port instance individually at the point of subgraph instantiation instead of the definition. In this case, you need to specify the graph qualified name of that kernel instance or kernel port instance in the constraint as shown in the following example. Also, make sure that the kernels or their ports being constrained as described previously are defined to be public members of the subgraph.

class ToplevelGraph : public graph {
  indep_nodes_graph1<1,2,3,2> mygraph;
  port<input> datain[2] ;
  port<output> dataout[2] ;

  ToplevelGraph() {
    for (int i = 0; i < 2; i++) {
      connect<stream, window<64> >(datain[i], mygraph.datain[i]);
      connect<window<64>, stream >(mygraph.dataout[i], dataout[i]);

      // hierarchical constraints
      location<stack>(mygraph.kr[i]) = bank(3, 2+i, 2);
      location<buffer>(mygraph.kr[i].out[0]) = location<kernel>(mygraph.kr[i]);
Note: You can recirculate the previous design placement in your next compilation. This significantly reduces the mapper run time. When the compiler runs, it generates a placement constraints file in the Work directory. This constraint file can be specified on the command line for the next iteration.
aiecompiler --constraints Work/temp/graph_aie_mapped.aiecst src/graph.cpp

To reuse FIFO location constraints, use aie_routed.aiecst file.

aiecompiler --constraints Work/temp/graph_aie_routed.aiecst src/graph.cpp