ElectricalNet.cc (10447:a465576671d4) ElectricalNet.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 */
1
21
22
2#include "model/timing_graph/ElectricalNet.h"
3#include "model/timing_graph/ElectricalLoad.h"
4
5namespace DSENT
6{
7 //-------------------------------------------------------------------------
8 // Electrical Net
9 //-------------------------------------------------------------------------
10
11 ElectricalNet::ElectricalNet(const String& instance_name_, ElectricalModel* model_)
12 : ElectricalTimingNode(instance_name_, model_), m_distributed_res_(0), m_distributed_cap_(0)
13 {
14
15 }
16
17 ElectricalNet::~ElectricalNet()
18 {
19
20 }
21
22 double ElectricalNet::calculateDelay() const
23 {
24 // Remember that this is a pi model, delay is distributed cap * distributed_res / 2 +
25 // distributed res * (other downstream caps)
26 return 0.693 * (getTotalDownstreamCap() - m_distributed_cap_ / 2) * m_distributed_res_;
27 }
28
29 double ElectricalNet::calculateTransition() const
30 {
31 return 1.386 * getMaxUpstreamRes() * (m_distributed_cap_ * 0.2 + ElectricalTimingNode::getTotalDownstreamCap());
32 }
33
34 double ElectricalNet::getMaxUpstreamRes() const
35 {
36 return m_distributed_res_ + ElectricalTimingNode::getMaxUpstreamRes();
37 }
38
39 double ElectricalNet::getTotalDownstreamCap() const
40 {
41 return m_distributed_cap_ + ElectricalTimingNode::getTotalDownstreamCap();
42 }
43
44 void ElectricalNet::setDistributedCap(double distributed_cap_)
45 {
46 m_distributed_cap_ = distributed_cap_;
47 return;
48 }
49
50 void ElectricalNet::setDistributedRes(double distributed_res_)
51 {
52 m_distributed_res_ = distributed_res_;
53 return;
54 }
55
56 double ElectricalNet::getDistributedCap() const
57 {
58 return m_distributed_cap_;
59 }
60
61 double ElectricalNet::getDistributedRes() const
62 {
63 return m_distributed_res_;
64 }
65
66 bool ElectricalNet::isNet() const
67 {
68 return true;
69 }
70
71} // namespace DSENT
72
73
23#include "model/timing_graph/ElectricalNet.h"
24#include "model/timing_graph/ElectricalLoad.h"
25
26namespace DSENT
27{
28 //-------------------------------------------------------------------------
29 // Electrical Net
30 //-------------------------------------------------------------------------
31
32 ElectricalNet::ElectricalNet(const String& instance_name_, ElectricalModel* model_)
33 : ElectricalTimingNode(instance_name_, model_), m_distributed_res_(0), m_distributed_cap_(0)
34 {
35
36 }
37
38 ElectricalNet::~ElectricalNet()
39 {
40
41 }
42
43 double ElectricalNet::calculateDelay() const
44 {
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_;
48 }
49
50 double ElectricalNet::calculateTransition() const
51 {
52 return 1.386 * getMaxUpstreamRes() * (m_distributed_cap_ * 0.2 + ElectricalTimingNode::getTotalDownstreamCap());
53 }
54
55 double ElectricalNet::getMaxUpstreamRes() const
56 {
57 return m_distributed_res_ + ElectricalTimingNode::getMaxUpstreamRes();
58 }
59
60 double ElectricalNet::getTotalDownstreamCap() const
61 {
62 return m_distributed_cap_ + ElectricalTimingNode::getTotalDownstreamCap();
63 }
64
65 void ElectricalNet::setDistributedCap(double distributed_cap_)
66 {
67 m_distributed_cap_ = distributed_cap_;
68 return;
69 }
70
71 void ElectricalNet::setDistributedRes(double distributed_res_)
72 {
73 m_distributed_res_ = distributed_res_;
74 return;
75 }
76
77 double ElectricalNet::getDistributedCap() const
78 {
79 return m_distributed_cap_;
80 }
81
82 double ElectricalNet::getDistributedRes() const
83 {
84 return m_distributed_res_;
85 }
86
87 bool ElectricalNet::isNet() const
88 {
89 return true;
90 }
91
92} // namespace DSENT
93
94