power NaN from missing clocks resolves #189

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-02-11 22:04:14 -07:00
parent 641d7a7161
commit 8ac65c3dda
1 changed files with 3 additions and 1 deletions

View File

@ -664,7 +664,9 @@ Power::ensureActivities()
// unless it has been set by command.
if (input_activity_.density() == 0.0) {
float min_period = clockMinPeriod();
float density = 0.1 / (min_period != 0.0 ? min_period : 0.0);
float density = 0.1 / (min_period != 0.0
? min_period
: units_->timeUnit()->scale());
input_activity_.set(density, 0.5, PwrActivityOrigin::input);
}
ActivitySrchPred activity_srch_pred(this);