| 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/OR2.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::max; 18 19 OR2::OR2(const String& instance_name_, const TechModel* tech_model_) 20 : StdCell(instance_name_, tech_model_) 21 { 22 initProperties(); 23 } 24 25 OR2::~OR2() 26 {} 27 28 void OR2::initProperties() 29 { 30 return; 31 } 32 33 void OR2::constructModel() 34 { 35 createInputPort("A"); 36 createInputPort("B"); 37 createOutputPort("Y"); 38 39 createLoad("A_Cap"); 40 createLoad("B_Cap"); 41 createDelay("A_to_Y_delay"); 42 createDelay("B_to_Y_delay"); 43 createDriver("Y_Ron", true); 44 45 ElectricalLoad* a_cap = getLoad("A_Cap"); 46 ElectricalLoad* b_cap = getLoad("B_Cap"); 47 ElectricalDelay* a_to_y_delay = getDelay("A_to_Y_delay"); 48 ElectricalDelay* b_to_y_delay = getDelay("B_to_Y_delay"); 49 ElectricalDriver* y_ron = getDriver("Y_Ron"); 50 51 getNet("A")->addDownstreamNode(a_cap); 52 getNet("B")->addDownstreamNode(b_cap); 53 a_cap->addDownstreamNode(a_to_y_delay); 54 b_cap->addDownstreamNode(b_to_y_delay); 55 a_to_y_delay->addDownstreamNode(y_ron); 56 b_to_y_delay->addDownstreamNode(y_ron); 57 y_ron->addDownstreamNode(getNet("Y")); 58 59 // Create Area result 60 // Create NDD Power result 61 createElectricalAtomicResults(); 62 // Create OR Event Energy Result 63 createElectricalEventAtomicResult("OR2"); 64 65 getEventInfo("Idle")->setStaticTransitionInfos(); 66 67 return; 68 } 69 70 void OR2::updateModel() 71 { 72 // Get parameters 73 double drive_strength = getDrivingStrength(); 74 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache(); 75 76 // Standard cell cache string 77 const String& cell_name = "OR2_X" + (String) drive_strength; 78 79 // Get timing parameters 80 getLoad("A_Cap")->setLoadCap(cache->get(cell_name + "->Cap->A")); 81 getLoad("B_Cap")->setLoadCap(cache->get(cell_name + "->Cap->B")); 82 getDelay("A_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->A_to_Y")); 83 getDelay("B_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->B_to_Y")); 84 getDriver("Y_Ron")->setOutputRes(cache->get(cell_name + "->DriveRes->Y")); 85 86 // Set the cell area 87 getAreaResult("Active")->setValue(cache->get(cell_name + "->ActiveArea")); 88 getAreaResult("Metal1Wire")->setValue(cache->get(cell_name + "->ActiveArea")); 89 90 return; 91 } 92 93 void OR2::evaluateModel() 94 { 95 return; 96 } 97 98 void OR2::useModel() 99 { 100 // Get parameters 101 double drive_strength = getDrivingStrength(); 102 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache(); 103 104 // Stadard cell cache string 105 const String& cell_name = "OR2_X" + (String) drive_strength; 106 107 // Propagate the transition info and get the 0->1 transtion count 108 propagateTransitionInfo(); 109 double P_A = getInputPort("A")->getTransitionInfo().getProbability1(); 110 double P_B = getInputPort("B")->getTransitionInfo().getProbability1(); 111 double Y_num_trans_01 = getOutputPort("Y")->getTransitionInfo().getNumberTransitions01(); 112 113 // Calculate leakage 114 double leakage = 0; 115 leakage += cache->get(cell_name + "->Leakage->!A!B") * (1 - P_A) * (1 - P_B); 116 leakage += cache->get(cell_name + "->Leakage->!AB") * (1 - P_A) * P_B; 117 leakage += cache->get(cell_name + "->Leakage->A!B") * P_A * (1 - P_B); 118 leakage += cache->get(cell_name + "->Leakage->AB") * P_A * P_B; 119 getNddPowerResult("Leakage")->setValue(leakage); 120 121 // Get VDD 122 double vdd = getTechModel()->get("Vdd"); 123 124 // Get capacitances 125 double y_b_cap = cache->get(cell_name + "->Cap->Y_b"); 126 double y_cap = cache->get(cell_name + "->Cap->Y"); 127 double y_load_cap = getNet("Y")->getTotalDownstreamCap(); 128 129 // Calculate OR2Event energy 130 double energy_per_trans_01 = (y_b_cap + y_cap + y_load_cap) * vdd * vdd; 131 getEventResult("OR2")->setValue(energy_per_trans_01 * Y_num_trans_01); 132 133 return; 134 } 135 136 void OR2::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_00; 157 double Y_prob_01 = A_prob_00 * B_prob_01 + 158 A_prob_01 * (B_prob_00 + B_prob_01); 159 double Y_prob_11 = A_prob_00 * B_prob_11 + 160 A_prob_01 * (B_prob_10 + B_prob_11) + 161 A_prob_10 * (B_prob_01 + B_prob_11) + 162 A_prob_11; 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), "[Error] " + getInstanceName() + 166 "Output transition probabilities must add up to 1 (" + (String) Y_prob_00 + ", " + 167 (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 // Creates the standard cell, characterizes and abstracts away the details 176 void OR2::cacheStdCell(StdCellLib* cell_lib_, double drive_strength_) 177 { 178 // Get parameters 179 double gate_pitch = cell_lib_->getTechModel()->get("Gate->PitchContacted"); 180 Map<double>* cache = cell_lib_->getStdCellCache(); 181 182 // Stadard cell cache string 183 const String& cell_name = "OR2_X" + (String) drive_strength_; 184 185 Log::printLine("=== " + cell_name + " ==="); 186 187 // Now actually build the full standard cell model 188 createInputPort("A"); 189 createInputPort("B"); 190 createOutputPort("Y"); 191 192 createNet("Y_b"); 193 194 // Adds macros 195 CellMacros::addNor2(this, "NOR2", false, true, true, "A", "B", "Y_b"); 196 CellMacros::addInverter(this, "INV", false, true, "Y_b", "Y"); 197 198 // Update macros 199 CellMacros::updateNor2(this, "NOR2", drive_strength_ * 0.66); 200 CellMacros::updateInverter(this, "INV", drive_strength_ * 1.0); 201 202 // Cache area result 203 double area = 0.0; 204 area += gate_pitch * getTotalHeight() * 1; 205 area += gate_pitch * getTotalHeight() * getGenProperties()->get("NOR2_GatePitches").toDouble(); 206 area += gate_pitch * getTotalHeight() * getGenProperties()->get("INV_GatePitches").toDouble(); 207 cache->set(cell_name + "->ActiveArea", area); 208 Log::printLine(cell_name + "->ActiveArea=" + (String)area); 209 210 // -------------------------------------------------------------------- 211 // Leakage Model Calculation 212 // -------------------------------------------------------------------- 213 // Cache leakage power results (for every single signal combination) 214 double leakage_00 = 0.0; // !A, !B 215 double leakage_01 = 0.0; // !A, B 216 double leakage_10 = 0.0; // A, !B 217 double leakage_11 = 0.0; // A, B 218 219 leakage_00 += getGenProperties()->get("NOR2_LeakagePower_00").toDouble(); 220 leakage_00 += getGenProperties()->get("INV_LeakagePower_1").toDouble(); 221 222 leakage_01 += getGenProperties()->get("NOR2_LeakagePower_01").toDouble(); 223 leakage_01 += getGenProperties()->get("INV_LeakagePower_0").toDouble(); 224 225 leakage_10 += getGenProperties()->get("NOR2_LeakagePower_10").toDouble(); 226 leakage_10 += getGenProperties()->get("INV_LeakagePower_0").toDouble(); 227 228 leakage_11 += getGenProperties()->get("NOR2_LeakagePower_11").toDouble(); 229 leakage_11 += getGenProperties()->get("INV_LeakagePower_0").toDouble(); 230 231 cache->set(cell_name + "->Leakage->!A!B", leakage_00); 232 cache->set(cell_name + "->Leakage->!AB", leakage_01); 233 cache->set(cell_name + "->Leakage->A!B", leakage_10); 234 cache->set(cell_name + "->Leakage->AB", leakage_11); 235 Log::printLine(cell_name + "->Leakage->!A!B=" + (String) leakage_00); 236 Log::printLine(cell_name + "->Leakage->!AB=" + (String) leakage_01); 237 Log::printLine(cell_name + "->Leakage->A!B=" + (String) leakage_10); 238 Log::printLine(cell_name + "->Leakage->AB=" + (String) leakage_11); 239 // -------------------------------------------------------------------- 240 241 // -------------------------------------------------------------------- 242 // Get Node Capacitances 243 // -------------------------------------------------------------------- 244 double a_cap = getNet("A")->getTotalDownstreamCap(); 245 double b_cap = getNet("B")->getTotalDownstreamCap(); 246 double y_b_cap = getNet("Y_b")->getTotalDownstreamCap(); 247 double y_cap = getNet("Y")->getTotalDownstreamCap(); 248 249 cache->set(cell_name + "->Cap->A", a_cap); 250 cache->set(cell_name + "->Cap->B", b_cap); 251 cache->set(cell_name + "->Cap->Y_b", y_b_cap); 252 cache->set(cell_name + "->Cap->Y", y_cap); 253 Log::printLine(cell_name + "->Cap->A_Cap=" + (String) a_cap); 254 Log::printLine(cell_name + "->Cap->B_Cap=" + (String) b_cap); 255 Log::printLine(cell_name + "->Cap->Y_b_Cap=" + (String) y_b_cap); 256 Log::printLine(cell_name + "->Cap->Y_Cap=" + (String) y_cap); 257 // -------------------------------------------------------------------- 258 259 // -------------------------------------------------------------------- 260 // Build Internal Delay Model 261 // -------------------------------------------------------------------- 262 double y_ron = getDriver("INV_RonZN")->getOutputRes(); 263 double a_to_y_delay = getDriver("NOR2_RonZN")->calculateDelay() + 264 getDriver("INV_RonZN")->calculateDelay(); 265 double b_to_y_delay = getDriver("NOR2_RonZN")->calculateDelay() + 266 getDriver("INV_RonZN")->calculateDelay(); 267 268 cache->set(cell_name + "->DriveRes->Y", y_ron); 269 cache->set(cell_name + "->Delay->A_to_Y", a_to_y_delay); 270 cache->set(cell_name + "->Delay->B_to_Y", b_to_y_delay); 271 Log::printLine(cell_name + "->DriveRes->Y=" + (String) y_ron); 272 Log::printLine(cell_name + "->Delay->A_to_Y=" + (String) a_to_y_delay); 273 Log::printLine(cell_name + "->Delay->B_to_Y=" + (String) b_to_y_delay); 274 // -------------------------------------------------------------------- 275 276 return; 277 } 278} // namespace DSENT 279
| 22#include "model/std_cells/OR2.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::max; 39 40 OR2::OR2(const String& instance_name_, const TechModel* tech_model_) 41 : StdCell(instance_name_, tech_model_) 42 { 43 initProperties(); 44 } 45 46 OR2::~OR2() 47 {} 48 49 void OR2::initProperties() 50 { 51 return; 52 } 53 54 void OR2::constructModel() 55 { 56 createInputPort("A"); 57 createInputPort("B"); 58 createOutputPort("Y"); 59 60 createLoad("A_Cap"); 61 createLoad("B_Cap"); 62 createDelay("A_to_Y_delay"); 63 createDelay("B_to_Y_delay"); 64 createDriver("Y_Ron", true); 65 66 ElectricalLoad* a_cap = getLoad("A_Cap"); 67 ElectricalLoad* b_cap = getLoad("B_Cap"); 68 ElectricalDelay* a_to_y_delay = getDelay("A_to_Y_delay"); 69 ElectricalDelay* b_to_y_delay = getDelay("B_to_Y_delay"); 70 ElectricalDriver* y_ron = getDriver("Y_Ron"); 71 72 getNet("A")->addDownstreamNode(a_cap); 73 getNet("B")->addDownstreamNode(b_cap); 74 a_cap->addDownstreamNode(a_to_y_delay); 75 b_cap->addDownstreamNode(b_to_y_delay); 76 a_to_y_delay->addDownstreamNode(y_ron); 77 b_to_y_delay->addDownstreamNode(y_ron); 78 y_ron->addDownstreamNode(getNet("Y")); 79 80 // Create Area result 81 // Create NDD Power result 82 createElectricalAtomicResults(); 83 // Create OR Event Energy Result 84 createElectricalEventAtomicResult("OR2"); 85 86 getEventInfo("Idle")->setStaticTransitionInfos(); 87 88 return; 89 } 90 91 void OR2::updateModel() 92 { 93 // Get parameters 94 double drive_strength = getDrivingStrength(); 95 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache(); 96 97 // Standard cell cache string 98 const String& cell_name = "OR2_X" + (String) drive_strength; 99 100 // Get timing parameters 101 getLoad("A_Cap")->setLoadCap(cache->get(cell_name + "->Cap->A")); 102 getLoad("B_Cap")->setLoadCap(cache->get(cell_name + "->Cap->B")); 103 getDelay("A_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->A_to_Y")); 104 getDelay("B_to_Y_delay")->setDelay(cache->get(cell_name + "->Delay->B_to_Y")); 105 getDriver("Y_Ron")->setOutputRes(cache->get(cell_name + "->DriveRes->Y")); 106 107 // Set the cell area 108 getAreaResult("Active")->setValue(cache->get(cell_name + "->ActiveArea")); 109 getAreaResult("Metal1Wire")->setValue(cache->get(cell_name + "->ActiveArea")); 110 111 return; 112 } 113 114 void OR2::evaluateModel() 115 { 116 return; 117 } 118 119 void OR2::useModel() 120 { 121 // Get parameters 122 double drive_strength = getDrivingStrength(); 123 Map<double>* cache = getTechModel()->getStdCellLib()->getStdCellCache(); 124 125 // Stadard cell cache string 126 const String& cell_name = "OR2_X" + (String) drive_strength; 127 128 // Propagate the transition info and get the 0->1 transtion count 129 propagateTransitionInfo(); 130 double P_A = getInputPort("A")->getTransitionInfo().getProbability1(); 131 double P_B = getInputPort("B")->getTransitionInfo().getProbability1(); 132 double Y_num_trans_01 = getOutputPort("Y")->getTransitionInfo().getNumberTransitions01(); 133 134 // Calculate leakage 135 double leakage = 0; 136 leakage += cache->get(cell_name + "->Leakage->!A!B") * (1 - P_A) * (1 - P_B); 137 leakage += cache->get(cell_name + "->Leakage->!AB") * (1 - P_A) * P_B; 138 leakage += cache->get(cell_name + "->Leakage->A!B") * P_A * (1 - P_B); 139 leakage += cache->get(cell_name + "->Leakage->AB") * P_A * P_B; 140 getNddPowerResult("Leakage")->setValue(leakage); 141 142 // Get VDD 143 double vdd = getTechModel()->get("Vdd"); 144 145 // Get capacitances 146 double y_b_cap = cache->get(cell_name + "->Cap->Y_b"); 147 double y_cap = cache->get(cell_name + "->Cap->Y"); 148 double y_load_cap = getNet("Y")->getTotalDownstreamCap(); 149 150 // Calculate OR2Event energy 151 double energy_per_trans_01 = (y_b_cap + y_cap + y_load_cap) * vdd * vdd; 152 getEventResult("OR2")->setValue(energy_per_trans_01 * Y_num_trans_01); 153 154 return; 155 } 156 157 void OR2::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_00; 178 double Y_prob_01 = A_prob_00 * B_prob_01 + 179 A_prob_01 * (B_prob_00 + B_prob_01); 180 double Y_prob_11 = A_prob_00 * B_prob_11 + 181 A_prob_01 * (B_prob_10 + B_prob_11) + 182 A_prob_10 * (B_prob_01 + B_prob_11) + 183 A_prob_11; 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), "[Error] " + getInstanceName() + 187 "Output transition probabilities must add up to 1 (" + (String) Y_prob_00 + ", " + 188 (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 // Creates the standard cell, characterizes and abstracts away the details 197 void OR2::cacheStdCell(StdCellLib* cell_lib_, double drive_strength_) 198 { 199 // Get parameters 200 double gate_pitch = cell_lib_->getTechModel()->get("Gate->PitchContacted"); 201 Map<double>* cache = cell_lib_->getStdCellCache(); 202 203 // Stadard cell cache string 204 const String& cell_name = "OR2_X" + (String) drive_strength_; 205 206 Log::printLine("=== " + cell_name + " ==="); 207 208 // Now actually build the full standard cell model 209 createInputPort("A"); 210 createInputPort("B"); 211 createOutputPort("Y"); 212 213 createNet("Y_b"); 214 215 // Adds macros 216 CellMacros::addNor2(this, "NOR2", false, true, true, "A", "B", "Y_b"); 217 CellMacros::addInverter(this, "INV", false, true, "Y_b", "Y"); 218 219 // Update macros 220 CellMacros::updateNor2(this, "NOR2", drive_strength_ * 0.66); 221 CellMacros::updateInverter(this, "INV", drive_strength_ * 1.0); 222 223 // Cache area result 224 double area = 0.0; 225 area += gate_pitch * getTotalHeight() * 1; 226 area += gate_pitch * getTotalHeight() * getGenProperties()->get("NOR2_GatePitches").toDouble(); 227 area += gate_pitch * getTotalHeight() * getGenProperties()->get("INV_GatePitches").toDouble(); 228 cache->set(cell_name + "->ActiveArea", area); 229 Log::printLine(cell_name + "->ActiveArea=" + (String)area); 230 231 // -------------------------------------------------------------------- 232 // Leakage Model Calculation 233 // -------------------------------------------------------------------- 234 // Cache leakage power results (for every single signal combination) 235 double leakage_00 = 0.0; // !A, !B 236 double leakage_01 = 0.0; // !A, B 237 double leakage_10 = 0.0; // A, !B 238 double leakage_11 = 0.0; // A, B 239 240 leakage_00 += getGenProperties()->get("NOR2_LeakagePower_00").toDouble(); 241 leakage_00 += getGenProperties()->get("INV_LeakagePower_1").toDouble(); 242 243 leakage_01 += getGenProperties()->get("NOR2_LeakagePower_01").toDouble(); 244 leakage_01 += getGenProperties()->get("INV_LeakagePower_0").toDouble(); 245 246 leakage_10 += getGenProperties()->get("NOR2_LeakagePower_10").toDouble(); 247 leakage_10 += getGenProperties()->get("INV_LeakagePower_0").toDouble(); 248 249 leakage_11 += getGenProperties()->get("NOR2_LeakagePower_11").toDouble(); 250 leakage_11 += getGenProperties()->get("INV_LeakagePower_0").toDouble(); 251 252 cache->set(cell_name + "->Leakage->!A!B", leakage_00); 253 cache->set(cell_name + "->Leakage->!AB", leakage_01); 254 cache->set(cell_name + "->Leakage->A!B", leakage_10); 255 cache->set(cell_name + "->Leakage->AB", leakage_11); 256 Log::printLine(cell_name + "->Leakage->!A!B=" + (String) leakage_00); 257 Log::printLine(cell_name + "->Leakage->!AB=" + (String) leakage_01); 258 Log::printLine(cell_name + "->Leakage->A!B=" + (String) leakage_10); 259 Log::printLine(cell_name + "->Leakage->AB=" + (String) leakage_11); 260 // -------------------------------------------------------------------- 261 262 // -------------------------------------------------------------------- 263 // Get Node Capacitances 264 // -------------------------------------------------------------------- 265 double a_cap = getNet("A")->getTotalDownstreamCap(); 266 double b_cap = getNet("B")->getTotalDownstreamCap(); 267 double y_b_cap = getNet("Y_b")->getTotalDownstreamCap(); 268 double y_cap = getNet("Y")->getTotalDownstreamCap(); 269 270 cache->set(cell_name + "->Cap->A", a_cap); 271 cache->set(cell_name + "->Cap->B", b_cap); 272 cache->set(cell_name + "->Cap->Y_b", y_b_cap); 273 cache->set(cell_name + "->Cap->Y", y_cap); 274 Log::printLine(cell_name + "->Cap->A_Cap=" + (String) a_cap); 275 Log::printLine(cell_name + "->Cap->B_Cap=" + (String) b_cap); 276 Log::printLine(cell_name + "->Cap->Y_b_Cap=" + (String) y_b_cap); 277 Log::printLine(cell_name + "->Cap->Y_Cap=" + (String) y_cap); 278 // -------------------------------------------------------------------- 279 280 // -------------------------------------------------------------------- 281 // Build Internal Delay Model 282 // -------------------------------------------------------------------- 283 double y_ron = getDriver("INV_RonZN")->getOutputRes(); 284 double a_to_y_delay = getDriver("NOR2_RonZN")->calculateDelay() + 285 getDriver("INV_RonZN")->calculateDelay(); 286 double b_to_y_delay = getDriver("NOR2_RonZN")->calculateDelay() + 287 getDriver("INV_RonZN")->calculateDelay(); 288 289 cache->set(cell_name + "->DriveRes->Y", y_ron); 290 cache->set(cell_name + "->Delay->A_to_Y", a_to_y_delay); 291 cache->set(cell_name + "->Delay->B_to_Y", b_to_y_delay); 292 Log::printLine(cell_name + "->DriveRes->Y=" + (String) y_ron); 293 Log::printLine(cell_name + "->Delay->A_to_Y=" + (String) a_to_y_delay); 294 Log::printLine(cell_name + "->Delay->B_to_Y=" + (String) b_to_y_delay); 295 // -------------------------------------------------------------------- 296 297 return; 298 } 299} // namespace DSENT 300
|