1 /* Copyright (c) 2012 Massachusetts Institute of Technology
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:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
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
23 #include "model/timing_graph/ElectricalNet.h"
24 #include "model/timing_graph/ElectricalLoad.h"
28 //-------------------------------------------------------------------------
30 //-------------------------------------------------------------------------
32 ElectricalNet::ElectricalNet(const String
& instance_name_
, ElectricalModel
* model_
)
33 : ElectricalTimingNode(instance_name_
, model_
), m_distributed_res_(0), m_distributed_cap_(0)
38 ElectricalNet::~ElectricalNet()
43 double ElectricalNet::calculateDelay() const
45 // Remember that this is a pi model, delay is distributed cap * distributed_res / 2 +
46 // distributed res * (other downstream caps)
47 return 0.693 * (getTotalDownstreamCap() - m_distributed_cap_
/ 2) * m_distributed_res_
;
50 double ElectricalNet::calculateTransition() const
52 return 1.386 * getMaxUpstreamRes() * (m_distributed_cap_
* 0.2 + ElectricalTimingNode::getTotalDownstreamCap());
55 double ElectricalNet::getMaxUpstreamRes() const
57 return m_distributed_res_
+ ElectricalTimingNode::getMaxUpstreamRes();
60 double ElectricalNet::getTotalDownstreamCap() const
62 return m_distributed_cap_
+ ElectricalTimingNode::getTotalDownstreamCap();
65 void ElectricalNet::setDistributedCap(double distributed_cap_
)
67 m_distributed_cap_
= distributed_cap_
;
71 void ElectricalNet::setDistributedRes(double distributed_res_
)
73 m_distributed_res_
= distributed_res_
;
77 double ElectricalNet::getDistributedCap() const
79 return m_distributed_cap_
;
82 double ElectricalNet::getDistributedRes() const
84 return m_distributed_res_
;
87 bool ElectricalNet::isNet() const