Can/does SigMap produce canonical output?

橙三吉。 提交于 2019-12-11 13:53:40

问题


An instance of SigMap is guaranteed to produce the same output for every connected wire in a design. But does this hold true for different instances of SigMap running in different versions of yosys across different platforms?

What about if the initial queries are done in the same order? Is there some way to cause SigMap to return the same SigBit across multiple runs on multiple versions?


回答1:


SigMap is not guaranteed to produce a canonical output with the SigMap(module) constructor, the exact behavior of such a SigMap object depends on the iterator order for module->connections() and the exact structure of the connections array.

You can "canonicalize" a SigMap using the following technique:

SigMap sigmap(module);
for (auto bit : sigmap.allbits())
    if (my_canonical_cmp(sigmap(bit), bit))
        sigmap.add(bit);

(I have added SigMap::allbits() just now. So you need to update to latest git head for this to work.)



来源:https://stackoverflow.com/questions/32280118/can-does-sigmap-produce-canonical-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!