Describe the bug
What went wrong? (e.g. the optimized circuit was not equivalent to the original one, an assertion failed, etc.)
mig_inv_propagation crashes with out-of-bounds access when PO is derived by a complement of PI. I believe this part needs to skip non-MIG node (since invert-node assumes that node is a MIG node).
|
if ( ntk.is_complemented( f ) ) |
|
{ |
|
// if it is complemented, invert the node |
|
auto const old_node = ntk.get_node( f ); |
|
auto const new_node = invert_node( old_node ); |
To Reproduce
Steps to reproduce the behavior:
-
Which version of mockturtle (commit or PR number) are you using? (Preferably the latest, unless there are special reasons.)
latest(9f3a6c9)
-
A complete snippet of your code (usually a cpp file including main).
#include <mockturtle/algorithms/mig_inv_propagation.hpp>
#include <mockturtle/networks/mig.hpp>
#include <iostream>
mockturtle::mig_network build_Foo() {
mockturtle::mig_network ntk;
auto a = ntk.create_pi();
ntk.create_po(!a);
return ntk;
}
int main() {
auto ntk = build_Foo();
mockturtle::mig_inv_propagation(ntk);
std::cout << "after mig_inv_propagation: gates=" << ntk.num_gates() << '\n';
return 0;
}
- The benchmark circuit for which the error occurs. Please try to minimize it first by using the testcase minimizer (docs, example code).
It was found in random test case.
- Error messages or print-outs you see (if any) (preferably copy-pasted as-is).
Environment
- OS: Linux
- Compiler: clang 20
- Compilation mode: DEBUG
Additional context
Add any other context about the problem here.
Check list
Describe the bug
What went wrong? (e.g. the optimized circuit was not equivalent to the original one, an assertion failed, etc.)
mig_inv_propagationcrashes with out-of-bounds access when PO is derived by a complement of PI. I believe this part needs to skip non-MIG node (sinceinvert-nodeassumes that node is a MIG node).mockturtle/include/mockturtle/algorithms/mig_inv_propagation.hpp
Lines 95 to 99 in 9f3a6c9
To Reproduce
Steps to reproduce the behavior:
Which version of
mockturtle(commit or PR number) are you using? (Preferably the latest, unless there are special reasons.)latest(9f3a6c9)
A complete snippet of your code (usually a cpp file including
main).It was found in random test case.
Environment
Additional context
Add any other context about the problem here.
Check list