-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to dump a choice network? #349
Comments
Yes and no.
It is because the choices nodes(specifically speaking the candidates nodes, not the representative one with fanout) have no fanout, they are treated as dangling nodes, and are collected and cleaned up by: Line 584 in 6754da1
If you comment out this line, you will get back your aiger with all dangling nodes(all choices candidates):
but you can't tell the relations between representative node and candidate nodes (As you can see, there's no Line 145 in 6754da1
in ABC (See Figure 4 in this paper for a clear illustration), so after dumping all these nodes without fanout into file format, this information is lost, so I am wondering if the write_aiger forgets to check and remove all choices candidates, it only checks the Ntk type:abc/src/base/io/ioWriteAiger.c Line 655 in 6754da1
and when you use write_aiger it dump choices candidates if you have them in your network, actually I don't see the point here. Maybe there's other application I don't know, let's just ask @alanminko for his opinion to see if this is by intention or just a small typo missing case.
So yes, you could get back all your nodes, but no, you can't tell which candidate belongs to which representative node easily. Further more, I think it's not totally impossible if you'd like to save the relations of the choices somewhere else before dumping by yourself, and you can recover it after read aiger back anyway. |
Hi Wang, thanks for sharing. I am doing some testing. It seems that in AIG, pData is used to maintain the linked list of all equivalent choices of each node. Line 145 in 6754da1
in Aig_Man_t, pEquivs uses a linked list to represent the equivalent nodes corresponding to each node. Line 132 in 8ba3d9b
By traversing the support nodes of each choice node, their representative (the logic cone of the root node) can be obtained. And when reading back, the mapping of which AIG node each choice node belongs to is not written in the AIG file, which results in the issue you mentioned: they are dumped but cannot be recognized as choices when read back. I’m testing in GIA to see if this information will be dumped, and I’ve also found that there are still some issues that I’m currently fixing when covert GIA choice network into AIG network. Line 1226 in 8ba3d9b
It should be said that for each choice node, this assert must be satisfied—having pData. However, it is currently unclear why the assert fails. If this assert is commented out, the program can run, but it can be observed that even after dumping back to an AIG, the information about the choice nodes still isn't saved. By turning the below test from 0 to 1, it can be seen that the Abc_AigNodeIsChoice check still doesn't succeed. Lines 1241 to 1254 in 8ba3d9b
I will continue to investigate where the issues lie. If there is any progress, I will provide continuous updates |
Solved with:#350 |
read /abc/32_32_S_SP_AR_BK_GenMul.aig;choice;ps;
abc/32_32_S_SP_AR_BK_GenMul: i/o = 64/ 64 lat = 0 and = 18822 (choice = 2782) lev =304
write test.aig
read test.aig;ps
abc/test : i/o = 64/ 64 lat = 0 and = 11682 lev =304
``
Can the choice network be dumped and read back in ABC? It seems that the dumped AIG contains choice nodes, but when reading it back, the choices cannot be recognized. I also tried using GIA write and read, which seems to keep the choice networks. However, when transferring it back to the AIG manager with &put, there are errors. If it cannot be put back into the AIG manager, it seems that ASIC tech mapping cannot be done in GIA.
The text was updated successfully, but these errors were encountered: