1 // OpenSTA, Static Timing Analyzer
2 // Copyright (c) 2021, Parallax Software, Inc.
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17 #include "LeakagePower.hh"
18
19 #include "FuncExpr.hh"
20 #include "TableModel.hh"
21 #include "Liberty.hh"
22
23 namespace sta {
24
LeakagePowerAttrs()25 LeakagePowerAttrs::LeakagePowerAttrs() :
26 when_(nullptr),
27 power_(0.0)
28 {
29 }
30
31 void
setPower(float power)32 LeakagePowerAttrs::setPower(float power)
33 {
34 power_ = power;
35 }
36
37 ////////////////////////////////////////////////////////////////
38
LeakagePower(LibertyCell * cell,LeakagePowerAttrs * attrs)39 LeakagePower::LeakagePower(LibertyCell *cell,
40 LeakagePowerAttrs *attrs) :
41 cell_(cell),
42 when_(attrs->when()),
43 power_(attrs->power())
44 {
45 cell->addLeakagePower(this);
46 }
47
~LeakagePower()48 LeakagePower::~LeakagePower()
49 {
50 if (when_)
51 when_->deleteSubexprs();
52 }
53
54 } // namespace
55