我正在尝试编写一个程序,将给定电路的每个强连接组件放入一个不同的子模块中。
因此,我尝试在 Yosys 中向 SCC 传递添加一个函数,以将每个 SCC 添加到子模块中。功能是:
void putSelectionIntoParition (RTLIL::Design *design,
std::vector<pair<std::string,RTLIL::Selection>>& SelectionVector)
{
int p_count = 0;
for (std::vector<pair<std::string,RTLIL::Selection>>::iterator it = SelectionVector.begin();
it != SelectionVector.end(); ++it)
{
design->selection_stack[0] = it->second;
design->selection_stack[0].optimize(design);
std::string command = "submod -name ";
command.append(it->first);
Pass::call_on_selection(design, it->second, command);
++p_count;
}
}
但是,我的代码无法正常工作。我想问题出在我使用的“选择”过程上。我想知道 yosys 源中是否有任何实用程序/API 接受单元向量(以及名称子模块)并将它们放入子模块中。