logic analysis passes — balance, AIG/MIG conversion, cut enumeration . Co-authored with Claude Opus 4.8 and sonnet 4.6#7
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 108 |
| Duplication | 39 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Thanks! Seems like legit bugs, I'll merge those On the other hand, there's a very AI feeling to it. The code seems okay, but it's a large chunk so I'd appreciate more context please:
|
|
Yup did it with the help of AI i used claude opus 4.8 and sonnet 4.6. I will update PR . |
|
also if i have to do some contribution in future (which i will do ig cuz i kinda like rust) so i will make sure to make PRs with a little code changes only when possible. |
Did some Bug fixes, depth analysis, and four new non-ATPG features built on top of the existing network representation.
Bug fixes
io/blif.rs:.flopwriter emitted the enable signal forR=and used rawDisplayinstead ofsig_to_stringfor bothE=/R=fieldsnetwork/stats.rs:nb_gates()excluded LUTs from the count; Display showednb_dffin place ofnb_dffe/nb_dffrsub-countsNew: depth analysis (
network/stats.rs)levels(net)anddepth(net)— combinational logic level per node (Buf does not add a level; Dff = 0). Surfaced inquaigh show.New: balance pass (
optim/balance.rs,--balance)Flattens And/Xor associativity chains and rebuilds minimum-depth balanced 2-input trees using a min-heap on node level. A 16-input AND chain goes from depth 15 to 4. Verified equivalent post-balance.
New: AIG conversion (
optim/aig.rs,--aig)Lowers every gate to 2-input And + implicit inverters. Xor, Mux, Maj, and Lut are decomposed via SoP. Flip-flops preserved via pre-allocate-then-wire two-pass approach. Verified equivalent (combinational and bounded sequential).
New: MIG conversion (
optim/mig.rs,--mig)Lowers to 3-input Majority gates + implicit inverters (
And = Maj(a,b,0),Or = Maj(a,b,1)). Intentionally skipsmake_canonicalafter construction (which would collapseMaj(a,b,0)back to And) — usesdeduplicate()instead.New: k-feasible cut enumeration (
optim/cuts.rs)Bottom-up priority-cut enumeration with dominance pruning and per-node cap (default 8). Flip-flops are combinational boundaries. Includes
is_valid_cutverifier andcount_cuts. Surfaced inquaigh showas "4-feasible cuts: N".Tests
90 unit + 6 doc-tests, all green.
cargo fmtand clippy clean.