From 0ab75c30bf9003f10730db05725d13154fa33cd4 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 31 Jul 2025 14:20:55 -0700 Subject: [PATCH] Sta::clear() call Power::clear() resolves #278 Signed-off-by: James Cherry --- power/Power.cc | 11 +++++++++++ power/Power.hh | 1 + search/Sta.cc | 1 + 3 files changed, 13 insertions(+) diff --git a/power/Power.cc b/power/Power.cc index c5711be8..dd2210c1 100644 --- a/power/Power.cc +++ b/power/Power.cc @@ -104,6 +104,17 @@ Power::Power(StaState *sta) : { } +void +Power::clear() +{ + global_activity_.init(); + input_activity_.init(); + user_activity_map_.clear(); + seq_activity_map_.clear(); + activity_map_.clear(); + activities_valid_ = false; +} + void Power::setGlobalActivity(float density, float duty) diff --git a/power/Power.hh b/power/Power.hh index f4fde251..18bc3ab9 100644 --- a/power/Power.hh +++ b/power/Power.hh @@ -75,6 +75,7 @@ class Power : public StaState { public: Power(StaState *sta); + void clear(); void power(const Corner *corner, // Return values. PowerResult &total, diff --git a/search/Sta.cc b/search/Sta.cc index 85998dd5..b7c28bbc 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -586,6 +586,7 @@ Sta::clear() parasitics_->clear(); graph_delay_calc_->clear(); sim_->clear(); + power_->clear(); if (check_min_pulse_widths_) check_min_pulse_widths_->clear(); if (check_min_periods_)