mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-05-30 00:24:12 +08:00
commit bd5c1fc5a8e933ff63728f890bc7e03bf1155328 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Sep 23 18:02:40 2024 -0700 read_saif doc, rename read_power_activities to read_vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 16a18595b13e9f72ea2a4fc6bca84b21ab98757f Author: James Cherry <cherry@parallaxsw.com> Date: Mon Sep 23 17:37:05 2024 -0700 saif parser Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 18f2448fb5fa8e83ee93fc9a3d15f4fe055d3a66 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Sep 23 16:11:47 2024 -0700 read saif basically matches vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a31be85f7557f847134e5bf47ead0ff78ce8c407 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Sep 22 20:15:00 2024 -0700 saif light Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2aef1731f20421caf762c2908bef62279d3564b7 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Sep 22 18:36:17 2024 -0700 saif reader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a7933ec57bc023893240b59fe1637cf33a2a95cd Author: James Cherry <cherry@parallaxsw.com> Date: Sun Sep 22 15:24:00 2024 -0700 saif parser success Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6deab8231345c6e28b3bc891dc56c82cdfe18ff0 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Sep 21 20:13:05 2024 -0700 saif reader Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
85 lines
1.9 KiB
C++
85 lines
1.9 KiB
C++
// OpenSTA, Static Timing Analyzer
|
|
// Copyright (c) 2024, Parallax Software, Inc.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
#pragma once
|
|
|
|
namespace sta {
|
|
|
|
class Power;
|
|
|
|
enum class PwrActivityOrigin
|
|
{
|
|
global,
|
|
input,
|
|
user,
|
|
vcd,
|
|
saif,
|
|
propagated,
|
|
clock,
|
|
constant,
|
|
defaulted,
|
|
unknown
|
|
};
|
|
|
|
class PwrActivity
|
|
{
|
|
public:
|
|
PwrActivity();
|
|
PwrActivity(float activity,
|
|
float duty,
|
|
PwrActivityOrigin origin);
|
|
float activity() const { return activity_; }
|
|
void setActivity(float activity);
|
|
float duty() const { return duty_; }
|
|
void setDuty(float duty);
|
|
PwrActivityOrigin origin() { return origin_; }
|
|
void setOrigin(PwrActivityOrigin origin);
|
|
const char *originName() const;
|
|
void set(float activity,
|
|
float duty,
|
|
PwrActivityOrigin origin);
|
|
bool isSet() const;
|
|
|
|
private:
|
|
void check();
|
|
|
|
// In general activity is per clock cycle, NOT per second.
|
|
float activity_;
|
|
float duty_;
|
|
PwrActivityOrigin origin_;
|
|
|
|
static constexpr float min_activity = 1E-10;
|
|
};
|
|
|
|
class PowerResult
|
|
{
|
|
public:
|
|
PowerResult();
|
|
void clear();
|
|
float &internal() { return internal_; }
|
|
float &switching() { return switching_; }
|
|
float &leakage() { return leakage_; }
|
|
float total() const;
|
|
void incr(PowerResult &result);
|
|
|
|
private:
|
|
float internal_;
|
|
float switching_;
|
|
float leakage_;
|
|
};
|
|
|
|
} // namespace
|