YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.42k stars 873 forks source link

abc9: Experiment with importing structural choices #4283

Open povik opened 6 months ago

povik commented 6 months ago

This is a bit of code on top of #4282 to have the structural choices that abc9 comes up reimported back into Yosys, for inspection and possibly other uses.

Minimal example where one sees it in action:

read_verilog <<EOF
(* top *)
module top(a, b, y);
    input wire [1:0] a;
    input wire [1:0] b;
    output wire [1:0] y;
    assign y = a * b;
endmodule
EOF
opt_clean
techmap
splitnets -ports
abc9 -script +&synch2;,&ps;;
show

graph

povik commented 5 months ago

Let me leave a note that the imported $__choice nodes represent equivalences up to a negation. (One can find out the value of the referenced nodes under all PIs being zero to recover polarities.)