Skip to content

Commit

Permalink
clockgate: no initvals
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Sep 11, 2024
1 parent 7e47329 commit 8b46434
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions passes/techmap/clockgate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ struct ClockgatePass : public Pass {
// log(" \n");
}

SigMap sigmap;
FfInitVals initvals;

// One ICG will be generated per ClkNetInfo
// if the number of FFs associated with it is sufficent
struct ClkNetInfo {
Expand Down Expand Up @@ -144,13 +141,11 @@ struct ClockgatePass : public Pass {

int gated_flop_count = 0;
for (auto module : design->selected_whole_modules()) {
sigmap.set(module);
initvals.set(&sigmap, module);
for (auto cell : module->cells()) {
if (!RTLIL::builtin_ff_cell_types().count(cell->type))
continue;

FfData ff(&initvals, cell);
FfData ff(nullptr, cell);
// It would be odd to get constants, but we better handle it
if (ff.has_ce && ff.sig_clk.is_wire() && ff.sig_ce.is_wire()) {
ce_ffs.insert(cell);
Expand Down Expand Up @@ -198,7 +193,7 @@ struct ClockgatePass : public Pass {
}

for (auto cell : ce_ffs) {
FfData ff(&initvals, cell);
FfData ff(nullptr, cell);
ClkNetInfo info = clk_info_from_ff(ff);
auto it = clk_nets.find(info);
log_assert(it != clk_nets.end() && "Bug: desync ce_ffs and clk_nets");
Expand Down

0 comments on commit 8b46434

Please sign in to comment.