分层约束 - 2022.1 简体中文

Versal ACAP AI 引擎编程环境 用户指南 (UG1076)

Document ID
UG1076
Release Date
2022-05-25
Version
2022.1 简体中文

创建含多个子 graph 类的复合 graph 或者相同子 graph 类的多个实例时,先前所述的位置约束也可以在子 graph 例化时,单独应用于每个内核实例或内核端口实例以代替定义。在此情况下,您需要在约束中指定该内核实例或内核端口实例的 graph 标准名称,如以下示例所示。并且,确保按前文所述进行约束的内核或者其端口均定义为该子 graph 的公共成员。

class ToplevelGraph : public graph {
 public:
  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]);
    }
  };
};
注释: 您可以在下一次编译时重新循环先前设计布局。这样即可显著缩短映射器运行时间。运行编译器时,它会在 Work 目录中生成布局约束文件。在命令行上可以为下一次迭代指定此约束文件。
aiecompiler --constraints Work/temp/graph_aie_mapped.aiecst src/graph.cpp

要复用 FIFO 位置约束,请使用 aie_routed.aiecst 文件。

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