Skip to content

Commit

Permalink
Merge pull request #4612 from georgerennie/george/opt_demorgan_zero_w…
Browse files Browse the repository at this point in the history
…idth

opt_demorgan: skip zero width cells
  • Loading branch information
widlarizer authored Nov 20, 2024
2 parents 18459b4 + e105cae commit cc17d5b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions passes/opt/opt_demorgan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ void demorgan_worker(
return;

auto insig = sigmap(cell->getPort(ID::A));

if (GetSize(insig) < 1)
return;

log("Inspecting %s cell %s (%d inputs)\n", log_id(cell->type), log_id(cell->name), GetSize(insig));
int num_inverted = 0;
for(int i=0; i<GetSize(insig); i++)
Expand Down
15 changes: 15 additions & 0 deletions tests/opt/bug4610.ys
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
read_ilang <<EOT
autoidx 1
module \top
wire output 1 \Y
cell $reduce_or $reduce_or$rtl.v:29$20
parameter \A_SIGNED 0
parameter \A_WIDTH 0
parameter \Y_WIDTH 1
connect \A { }
connect \Y \Y
end
end
EOT

equiv_opt -assert opt_demorgan

0 comments on commit cc17d5b

Please sign in to comment.