NOR2.cc (10447:a465576671d4) NOR2.cc (10448:bc1a3b7ab5ef)
1/* Copyright (c) 2012 Massachusetts Institute of Technology
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 * THE SOFTWARE.
20 */
21
1#include "model/std_cells/NOR2.h"
2
3#include <cmath>
4
5#include "model/PortInfo.h"
6#include "model/TransitionInfo.h"
7#include "model/EventInfo.h"
8#include "model/std_cells/StdCellLib.h"
9#include "model/std_cells/CellMacros.h"
10#include "model/timing_graph/ElectricalNet.h"
11#include "model/timing_graph/ElectricalDriver.h"
12#include "model/timing_graph/ElectricalLoad.h"
13#include "model/timing_graph/ElectricalDelay.h"
14
15namespace DSENT
16{
17 using std::ceil;
18 using std::max;
19
20 NOR2::NOR2(const String& instance_name_, const TechModel* tech_model_)
21 : StdCell(instance_name_, tech_model_)
22 {
23 initProperties();
24 }
25
26 NOR2::~NOR2()
27 {}
28
29 void NOR2::initProperties()
30 {
31 return;
32 }
33
34 void NOR2::constructModel()
35 {
36 // All constructModel should do is create Area/NDDPower/Energy Results as
37 // well as instantiate any sub-instances using only the hard parameters
38
39 createInputPort("A");
40 createInputPort("B");
41 createOutputPort("Y");
42
43 createLoad("A_Cap");
44 createLoad("B_Cap");
45 createDelay("A_to_Y_delay");
46 createDelay("B_to_Y_delay");
47 createDriver("Y_Ron", true);
48
49 ElectricalLoad* a_cap = getLoad("A_Cap");
50 ElectricalLoad* b_cap = getLoad("A_Cap");
51 ElectricalDelay* a_to_y_delay = getDelay("A_to_Y_delay");
52 ElectricalDelay* b_to_y_delay = getDelay("B_to_Y_delay");
53 ElectricalDriver* y_ron = getDriver("Y_Ron");
54
55 getNet("A")->addDownstreamNode(a_cap);
56 getNet("B")->addDownstreamNode(b_cap);
57 a_cap->addDownstreamNode(a_to_y_delay);
58 b_cap->addDownstreamNode(b_to_y_delay);
59 a_to_y_delay->addDownstreamNode(y_ron);
60 b_to_y_delay->addDownstreamNode(y_ron);
61 y_ron->addDownstreamNode(getNet("Y"));
62
63 // Create Area result
64 // Create NDD Power result
65 createElectricalAtomicResults();
66 // Create NOR Event Energy Result
67 createElectricalEventAtomicResult("NOR2");
68
69 getEventInfo("Idle")->setStaticTransitionInfos();
70
71 return;
72 }
73
74 void NOR2::updateModel()
75 {
76 // All updateModel should do is calculate numbers for the Area/NDDPower/Energy
77 // Results as anything else that needs to be done using either soft or hard parameters
78
79 // Get parameters
80 double drive_strength = getDrivingStrength();
81 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache();
82
83 // Standard cell cache string
84 String cell_name = "NOR2_X" + (String) drive_strength;
85
86 // Get timing parameters
87 getLoad("A_Cap")->setLoadCap(cache->get(cell_name + "->Cap->A"));
88 getLoad("B_Cap")->setLoadCap(cache->get(cell_name + "->Cap->B"));
89 getDelay("A_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->A_to_Y"));
90 getDelay("B_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->B_to_Y"));
91 getDriver("Y_Ron")->setOutputRes(cache->get(cell_name + "->DriveRes->Y"));
92
93 // Set the cell area
94 getAreaResult("Active")->setValue(cache->get(cell_name + "->ActiveArea"));
95 getAreaResult("Metal1Wire")->setValue(cache->get(cell_name + "->ActiveArea"));
96
97 return;
98 }
99
100 void NOR2::useModel()
101 {
102 // Get parameters
103 double drive_strength = getDrivingStrength();
104 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache();
105
106 // Standard cell cache string
107 String cell_name = "NOR2_X" + (String) drive_strength;
108
109 // Propagate the transition info and get the 0->1 transtion count
110 propagateTransitionInfo();
111 double P_A = getInputPort("A")->getTransitionInfo().getProbability1();
112 double P_B = getInputPort("B")->getTransitionInfo().getProbability1();
113 double Y_num_trans_01 = getOutputPort("Y")->getTransitionInfo().getNumberTransitions01();
114
115 // Calculate leakage
116 double leakage = 0;
117 leakage += cache->get(cell_name + "->Leakage->!A!B") * (1 - P_A) * (1 - P_B);
118 leakage += cache->get(cell_name + "->Leakage->!AB") * (1 - P_A) * P_B;
119 leakage += cache->get(cell_name + "->Leakage->A!B") * P_A * (1 - P_B);
120 leakage += cache->get(cell_name + "->Leakage->AB") * P_A * P_B;
121 getNddPowerResult("Leakage")->setValue(leakage);
122
123 // Get VDD
124 double vdd = getTechModel()->get("Vdd");
125 // Get capacitances
126 double y_cap = cache->get(cell_name + "->Cap->Y");
127 double y_load_cap = getNet("Y")->getTotalDownstreamCap();
128
129 // Calculate NOR2Event energy
130 double energy_per_trans_01 = (y_cap + y_load_cap) * vdd * vdd;
131 getEventResult("NOR2")->setValue(energy_per_trans_01 * Y_num_trans_01);
132
133 return;
134 }
135
136 void NOR2::propagateTransitionInfo()
137 {
138 // Get input signal transition info
139 const TransitionInfo& trans_A = getInputPort("A")->getTransitionInfo();
140 const TransitionInfo& trans_B = getInputPort("B")->getTransitionInfo();
141
142 double max_freq_mult = max(trans_A.getFrequencyMultiplier(), trans_B.getFrequencyMultiplier());
143 const TransitionInfo& scaled_trans_A = trans_A.scaleFrequencyMultiplier(max_freq_mult);
144 const TransitionInfo& scaled_trans_B = trans_B.scaleFrequencyMultiplier(max_freq_mult);
145
146 double A_prob_00 = scaled_trans_A.getNumberTransitions00() / max_freq_mult;
147 double A_prob_01 = scaled_trans_A.getNumberTransitions01() / max_freq_mult;
148 double A_prob_10 = A_prob_01;
149 double A_prob_11 = scaled_trans_A.getNumberTransitions11() / max_freq_mult;
150 double B_prob_00 = scaled_trans_B.getNumberTransitions00() / max_freq_mult;
151 double B_prob_01 = scaled_trans_B.getNumberTransitions01() / max_freq_mult;
152 double B_prob_10 = B_prob_01;
153 double B_prob_11 = scaled_trans_B.getNumberTransitions11() / max_freq_mult;
154
155 // Set output transition info
156 double Y_prob_00 = A_prob_00 * B_prob_11 +
157 A_prob_01 * (B_prob_10 + B_prob_11) +
158 A_prob_10 * (B_prob_01 + B_prob_11) +
159 A_prob_11;
160 double Y_prob_01 = A_prob_00 * B_prob_10 +
161 A_prob_10 * (B_prob_00 + B_prob_10);
162 double Y_prob_11 = A_prob_00 * B_prob_00;
163
164 // Check that probabilities add up to 1.0 with some finite tolerance
165 ASSERT(LibUtil::Math::isEqual((Y_prob_00 + Y_prob_01 + Y_prob_01 + Y_prob_11), 1.0),
166 "[Error] " + getInstanceName() + "Output transition probabilities must add up to 1 (" +
167 (String) Y_prob_00 + ", " + (String) Y_prob_01 + ", " + (String) Y_prob_11 + ")!");
168
169 // Turn probability of transitions per cycle into number of transitions per time unit
170 TransitionInfo trans_Y(Y_prob_00 * max_freq_mult, Y_prob_01 * max_freq_mult, Y_prob_11 * max_freq_mult);
171 getOutputPort("Y")->setTransitionInfo(trans_Y);
172 return;
173 }
174
175 void NOR2::cacheStdCell(StdCellLib* cell_lib_, double drive_strength_)
176 {
177 // Standard cell cache string
178 String cell_name = "NOR2_X" + (String) drive_strength_;
179
180 Log::printLine("=== " + cell_name + " ===");
181
182 // Get parameters
183 double gate_pitch = cell_lib_->getTechModel()->get("Gate->PitchContacted");
184 Map<double>* cache = cell_lib_->getStdCellCache();
185
186 // Now actually build the full standard cell model
187 // Create the two input ports
188 createInputPort("A");
189 createInputPort("B");
190 createOutputPort("Y");
191
192 // Adds macros
193 CellMacros::addNor2(this, "NOR", true, true, true, "A", "B", "Y");
194 CellMacros::updateNor2(this, "NOR", drive_strength_);
195
196 // Cache area result
197 double area = gate_pitch * getTotalHeight() * (1 + getGenProperties()->get("NOR_GatePitches").toDouble());
198 cache->set(cell_name + "->ActiveArea", area);
199 Log::printLine(cell_name + "->ActiveArea=" + (String) area);
200
201 // --------------------------------------------------------------------
202 // Leakage Model Calculation
203 // --------------------------------------------------------------------
204 double leakage_00 = getGenProperties()->get("NOR_LeakagePower_00").toDouble();
205 double leakage_01 = getGenProperties()->get("NOR_LeakagePower_01").toDouble();
206 double leakage_10 = getGenProperties()->get("NOR_LeakagePower_10").toDouble();
207 double leakage_11 = getGenProperties()->get("NOR_LeakagePower_11").toDouble();
208 cache->set(cell_name + "->Leakage->!A!B", leakage_00);
209 cache->set(cell_name + "->Leakage->!AB", leakage_01);
210 cache->set(cell_name + "->Leakage->A!B", leakage_10);
211 cache->set(cell_name + "->Leakage->AB", leakage_11);
212 Log::printLine(cell_name + "->Leakage->!A!B=" + (String) leakage_00);
213 Log::printLine(cell_name + "->Leakage->!AB=" + (String) leakage_01);
214 Log::printLine(cell_name + "->Leakage->A!B=" + (String) leakage_10);
215 Log::printLine(cell_name + "->Leakage->AB=" + (String) leakage_11);
216 // --------------------------------------------------------------------
217
218 /*
219 // Cache event energy results
220 double event_a_flip = getGenProperties()->get("NOR_A1_Flip").toDouble();
221 double event_b_flip = getGenProperties()->get("NOR_A2_Flip").toDouble();
222 double event_zn_flip = getGenProperties()->get("NOR_ZN_Flip").toDouble();
223
224 cache->set(cell_name + "->Event_A_Flip", event_a_flip);
225 cache->set(cell_name + "->Event_B_Flip", event_b_flip);
226 cache->set(cell_name + "->Event_ZN_Flip", event_zn_flip);
227 Log::printLine(cell_name + "->Event_A_Flip=" + (String) event_a_flip);
228 Log::printLine(cell_name + "->Event_B_Flip=" + (String) event_b_flip);
229 Log::printLine(cell_name + "->Event_ZN_Flip=" + (String) event_zn_flip);
230 */
231
232 // --------------------------------------------------------------------
233 // Get Node Capacitances
234 // --------------------------------------------------------------------
235 // Build abstracted timing model
236 double a_cap = getNet("A")->getTotalDownstreamCap();
237 double b_cap = getNet("B")->getTotalDownstreamCap();
238 double y_cap = getNet("Y")->getTotalDownstreamCap();
239
240 cache->set(cell_name + "->Cap->A", a_cap);
241 cache->set(cell_name + "->Cap->B", b_cap);
242 cache->set(cell_name + "->Cap->Y", y_cap);
243 Log::printLine(cell_name + "->Cap->A_Cap=" + (String) a_cap);
244 Log::printLine(cell_name + "->Cap->B_Cap=" + (String) b_cap);
245 Log::printLine(cell_name + "->Cap->Y_Cap=" + (String) y_cap);
246 // --------------------------------------------------------------------
247
248 // --------------------------------------------------------------------
249 // Build Internal Delay Model
250 // --------------------------------------------------------------------
251 double y_ron = getDriver("NOR_RonZN")->getOutputRes();
252 double a_to_y_delay = getDriver("NOR_RonZN")->calculateDelay();
253 double b_to_y_delay = getDriver("NOR_RonZN")->calculateDelay();
254
255 cache->set(cell_name + "->DriveRes->Y", y_ron);
256 cache->set(cell_name + "->Delay->A_to_Y", a_to_y_delay);
257 cache->set(cell_name + "->Delay->B_to_Y", b_to_y_delay);
258 Log::printLine(cell_name + "->DriveRes->Y=" + (String) y_ron);
259 Log::printLine(cell_name + "->Delay->A_to_Y=" + (String) a_to_y_delay);
260 Log::printLine(cell_name + "->Delay->B_to_Y=" + (String) b_to_y_delay);
261 // --------------------------------------------------------------------
262
263 return;
264
265 }
266
267} // namespace DSENT
268
22#include "model/std_cells/NOR2.h"
23
24#include <cmath>
25
26#include "model/PortInfo.h"
27#include "model/TransitionInfo.h"
28#include "model/EventInfo.h"
29#include "model/std_cells/StdCellLib.h"
30#include "model/std_cells/CellMacros.h"
31#include "model/timing_graph/ElectricalNet.h"
32#include "model/timing_graph/ElectricalDriver.h"
33#include "model/timing_graph/ElectricalLoad.h"
34#include "model/timing_graph/ElectricalDelay.h"
35
36namespace DSENT
37{
38 using std::ceil;
39 using std::max;
40
41 NOR2::NOR2(const String& instance_name_, const TechModel* tech_model_)
42 : StdCell(instance_name_, tech_model_)
43 {
44 initProperties();
45 }
46
47 NOR2::~NOR2()
48 {}
49
50 void NOR2::initProperties()
51 {
52 return;
53 }
54
55 void NOR2::constructModel()
56 {
57 // All constructModel should do is create Area/NDDPower/Energy Results as
58 // well as instantiate any sub-instances using only the hard parameters
59
60 createInputPort("A");
61 createInputPort("B");
62 createOutputPort("Y");
63
64 createLoad("A_Cap");
65 createLoad("B_Cap");
66 createDelay("A_to_Y_delay");
67 createDelay("B_to_Y_delay");
68 createDriver("Y_Ron", true);
69
70 ElectricalLoad* a_cap = getLoad("A_Cap");
71 ElectricalLoad* b_cap = getLoad("A_Cap");
72 ElectricalDelay* a_to_y_delay = getDelay("A_to_Y_delay");
73 ElectricalDelay* b_to_y_delay = getDelay("B_to_Y_delay");
74 ElectricalDriver* y_ron = getDriver("Y_Ron");
75
76 getNet("A")->addDownstreamNode(a_cap);
77 getNet("B")->addDownstreamNode(b_cap);
78 a_cap->addDownstreamNode(a_to_y_delay);
79 b_cap->addDownstreamNode(b_to_y_delay);
80 a_to_y_delay->addDownstreamNode(y_ron);
81 b_to_y_delay->addDownstreamNode(y_ron);
82 y_ron->addDownstreamNode(getNet("Y"));
83
84 // Create Area result
85 // Create NDD Power result
86 createElectricalAtomicResults();
87 // Create NOR Event Energy Result
88 createElectricalEventAtomicResult("NOR2");
89
90 getEventInfo("Idle")->setStaticTransitionInfos();
91
92 return;
93 }
94
95 void NOR2::updateModel()
96 {
97 // All updateModel should do is calculate numbers for the Area/NDDPower/Energy
98 // Results as anything else that needs to be done using either soft or hard parameters
99
100 // Get parameters
101 double drive_strength = getDrivingStrength();
102 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache();
103
104 // Standard cell cache string
105 String cell_name = "NOR2_X" + (String) drive_strength;
106
107 // Get timing parameters
108 getLoad("A_Cap")->setLoadCap(cache->get(cell_name + "->Cap->A"));
109 getLoad("B_Cap")->setLoadCap(cache->get(cell_name + "->Cap->B"));
110 getDelay("A_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->A_to_Y"));
111 getDelay("B_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->B_to_Y"));
112 getDriver("Y_Ron")->setOutputRes(cache->get(cell_name + "->DriveRes->Y"));
113
114 // Set the cell area
115 getAreaResult("Active")->setValue(cache->get(cell_name + "->ActiveArea"));
116 getAreaResult("Metal1Wire")->setValue(cache->get(cell_name + "->ActiveArea"));
117
118 return;
119 }
120
121 void NOR2::useModel()
122 {
123 // Get parameters
124 double drive_strength = getDrivingStrength();
125 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache();
126
127 // Standard cell cache string
128 String cell_name = "NOR2_X" + (String) drive_strength;
129
130 // Propagate the transition info and get the 0->1 transtion count
131 propagateTransitionInfo();
132 double P_A = getInputPort("A")->getTransitionInfo().getProbability1();
133 double P_B = getInputPort("B")->getTransitionInfo().getProbability1();
134 double Y_num_trans_01 = getOutputPort("Y")->getTransitionInfo().getNumberTransitions01();
135
136 // Calculate leakage
137 double leakage = 0;
138 leakage += cache->get(cell_name + "->Leakage->!A!B") * (1 - P_A) * (1 - P_B);
139 leakage += cache->get(cell_name + "->Leakage->!AB") * (1 - P_A) * P_B;
140 leakage += cache->get(cell_name + "->Leakage->A!B") * P_A * (1 - P_B);
141 leakage += cache->get(cell_name + "->Leakage->AB") * P_A * P_B;
142 getNddPowerResult("Leakage")->setValue(leakage);
143
144 // Get VDD
145 double vdd = getTechModel()->get("Vdd");
146 // Get capacitances
147 double y_cap = cache->get(cell_name + "->Cap->Y");
148 double y_load_cap = getNet("Y")->getTotalDownstreamCap();
149
150 // Calculate NOR2Event energy
151 double energy_per_trans_01 = (y_cap + y_load_cap) * vdd * vdd;
152 getEventResult("NOR2")->setValue(energy_per_trans_01 * Y_num_trans_01);
153
154 return;
155 }
156
157 void NOR2::propagateTransitionInfo()
158 {
159 // Get input signal transition info
160 const TransitionInfo& trans_A = getInputPort("A")->getTransitionInfo();
161 const TransitionInfo& trans_B = getInputPort("B")->getTransitionInfo();
162
163 double max_freq_mult = max(trans_A.getFrequencyMultiplier(), trans_B.getFrequencyMultiplier());
164 const TransitionInfo& scaled_trans_A = trans_A.scaleFrequencyMultiplier(max_freq_mult);
165 const TransitionInfo& scaled_trans_B = trans_B.scaleFrequencyMultiplier(max_freq_mult);
166
167 double A_prob_00 = scaled_trans_A.getNumberTransitions00() / max_freq_mult;
168 double A_prob_01 = scaled_trans_A.getNumberTransitions01() / max_freq_mult;
169 double A_prob_10 = A_prob_01;
170 double A_prob_11 = scaled_trans_A.getNumberTransitions11() / max_freq_mult;
171 double B_prob_00 = scaled_trans_B.getNumberTransitions00() / max_freq_mult;
172 double B_prob_01 = scaled_trans_B.getNumberTransitions01() / max_freq_mult;
173 double B_prob_10 = B_prob_01;
174 double B_prob_11 = scaled_trans_B.getNumberTransitions11() / max_freq_mult;
175
176 // Set output transition info
177 double Y_prob_00 = A_prob_00 * B_prob_11 +
178 A_prob_01 * (B_prob_10 + B_prob_11) +
179 A_prob_10 * (B_prob_01 + B_prob_11) +
180 A_prob_11;
181 double Y_prob_01 = A_prob_00 * B_prob_10 +
182 A_prob_10 * (B_prob_00 + B_prob_10);
183 double Y_prob_11 = A_prob_00 * B_prob_00;
184
185 // Check that probabilities add up to 1.0 with some finite tolerance
186 ASSERT(LibUtil::Math::isEqual((Y_prob_00 + Y_prob_01 + Y_prob_01 + Y_prob_11), 1.0),
187 "[Error] " + getInstanceName() + "Output transition probabilities must add up to 1 (" +
188 (String) Y_prob_00 + ", " + (String) Y_prob_01 + ", " + (String) Y_prob_11 + ")!");
189
190 // Turn probability of transitions per cycle into number of transitions per time unit
191 TransitionInfo trans_Y(Y_prob_00 * max_freq_mult, Y_prob_01 * max_freq_mult, Y_prob_11 * max_freq_mult);
192 getOutputPort("Y")->setTransitionInfo(trans_Y);
193 return;
194 }
195
196 void NOR2::cacheStdCell(StdCellLib* cell_lib_, double drive_strength_)
197 {
198 // Standard cell cache string
199 String cell_name = "NOR2_X" + (String) drive_strength_;
200
201 Log::printLine("=== " + cell_name + " ===");
202
203 // Get parameters
204 double gate_pitch = cell_lib_->getTechModel()->get("Gate->PitchContacted");
205 Map<double>* cache = cell_lib_->getStdCellCache();
206
207 // Now actually build the full standard cell model
208 // Create the two input ports
209 createInputPort("A");
210 createInputPort("B");
211 createOutputPort("Y");
212
213 // Adds macros
214 CellMacros::addNor2(this, "NOR", true, true, true, "A", "B", "Y");
215 CellMacros::updateNor2(this, "NOR", drive_strength_);
216
217 // Cache area result
218 double area = gate_pitch * getTotalHeight() * (1 + getGenProperties()->get("NOR_GatePitches").toDouble());
219 cache->set(cell_name + "->ActiveArea", area);
220 Log::printLine(cell_name + "->ActiveArea=" + (String) area);
221
222 // --------------------------------------------------------------------
223 // Leakage Model Calculation
224 // --------------------------------------------------------------------
225 double leakage_00 = getGenProperties()->get("NOR_LeakagePower_00").toDouble();
226 double leakage_01 = getGenProperties()->get("NOR_LeakagePower_01").toDouble();
227 double leakage_10 = getGenProperties()->get("NOR_LeakagePower_10").toDouble();
228 double leakage_11 = getGenProperties()->get("NOR_LeakagePower_11").toDouble();
229 cache->set(cell_name + "->Leakage->!A!B", leakage_00);
230 cache->set(cell_name + "->Leakage->!AB", leakage_01);
231 cache->set(cell_name + "->Leakage->A!B", leakage_10);
232 cache->set(cell_name + "->Leakage->AB", leakage_11);
233 Log::printLine(cell_name + "->Leakage->!A!B=" + (String) leakage_00);
234 Log::printLine(cell_name + "->Leakage->!AB=" + (String) leakage_01);
235 Log::printLine(cell_name + "->Leakage->A!B=" + (String) leakage_10);
236 Log::printLine(cell_name + "->Leakage->AB=" + (String) leakage_11);
237 // --------------------------------------------------------------------
238
239 /*
240 // Cache event energy results
241 double event_a_flip = getGenProperties()->get("NOR_A1_Flip").toDouble();
242 double event_b_flip = getGenProperties()->get("NOR_A2_Flip").toDouble();
243 double event_zn_flip = getGenProperties()->get("NOR_ZN_Flip").toDouble();
244
245 cache->set(cell_name + "->Event_A_Flip", event_a_flip);
246 cache->set(cell_name + "->Event_B_Flip", event_b_flip);
247 cache->set(cell_name + "->Event_ZN_Flip", event_zn_flip);
248 Log::printLine(cell_name + "->Event_A_Flip=" + (String) event_a_flip);
249 Log::printLine(cell_name + "->Event_B_Flip=" + (String) event_b_flip);
250 Log::printLine(cell_name + "->Event_ZN_Flip=" + (String) event_zn_flip);
251 */
252
253 // --------------------------------------------------------------------
254 // Get Node Capacitances
255 // --------------------------------------------------------------------
256 // Build abstracted timing model
257 double a_cap = getNet("A")->getTotalDownstreamCap();
258 double b_cap = getNet("B")->getTotalDownstreamCap();
259 double y_cap = getNet("Y")->getTotalDownstreamCap();
260
261 cache->set(cell_name + "->Cap->A", a_cap);
262 cache->set(cell_name + "->Cap->B", b_cap);
263 cache->set(cell_name + "->Cap->Y", y_cap);
264 Log::printLine(cell_name + "->Cap->A_Cap=" + (String) a_cap);
265 Log::printLine(cell_name + "->Cap->B_Cap=" + (String) b_cap);
266 Log::printLine(cell_name + "->Cap->Y_Cap=" + (String) y_cap);
267 // --------------------------------------------------------------------
268
269 // --------------------------------------------------------------------
270 // Build Internal Delay Model
271 // --------------------------------------------------------------------
272 double y_ron = getDriver("NOR_RonZN")->getOutputRes();
273 double a_to_y_delay = getDriver("NOR_RonZN")->calculateDelay();
274 double b_to_y_delay = getDriver("NOR_RonZN")->calculateDelay();
275
276 cache->set(cell_name + "->DriveRes->Y", y_ron);
277 cache->set(cell_name + "->Delay->A_to_Y", a_to_y_delay);
278 cache->set(cell_name + "->Delay->B_to_Y", b_to_y_delay);
279 Log::printLine(cell_name + "->DriveRes->Y=" + (String) y_ron);
280 Log::printLine(cell_name + "->Delay->A_to_Y=" + (String) a_to_y_delay);
281 Log::printLine(cell_name + "->Delay->B_to_Y=" + (String) b_to_y_delay);
282 // --------------------------------------------------------------------
283
284 return;
285
286 }
287
288} // namespace DSENT
289