Skip to content

Commit 22acd12

Browse files
committed
set_load -subtract_pin_cap with rise/fall pin caps
Signed-off-by: James Cherry <[email protected]>
1 parent e748b23 commit 22acd12

File tree

4 files changed

+55
-27
lines changed

4 files changed

+55
-27
lines changed

doc/OpenSTA.odt

348 Bytes
Binary file not shown.

doc/OpenSTA.pdf

409 Bytes
Binary file not shown.

include/sta/Sdc.hh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ private:
112112
const Network *network_;
113113
};
114114

115+
class NetWireCaps : public MinMaxFloatValues
116+
{
117+
public:
118+
NetWireCaps();
119+
bool subtractPinCap(const MinMax *min_max);
120+
void setSubtractPinCap(bool subtrace_pin_cap,
121+
const MinMax *min_max);
122+
123+
private:
124+
bool subtract_pin_cap_[MinMax::index_count];
125+
};
126+
115127
typedef Map<const char*,Clock*, CharPtrLess> ClockNameMap;
116128
typedef UnorderedMap<const Pin*, ClockSet*, PinIdHash> ClockPinMap;
117129
typedef Set<InputDelay*> InputDelaySet;
@@ -149,8 +161,8 @@ typedef Map<const Pin*, MinMaxFloatValues> PinCapLimitMap;
149161
typedef Map<const Port*, MinMaxFloatValues> PortFanoutLimitMap;
150162
typedef Map<const Cell*, MinMaxFloatValues> CellFanoutLimitMap;
151163
typedef Map<const Port*, PortExtCap*, PortIdLess> PortExtCapMap;
152-
typedef Map<const Net*, MinMaxFloatValues, NetIdLess> NetWireCapMap;
153-
typedef Map<const Pin*, MinMaxFloatValues*, PinIdLess> PinWireCapMap;
164+
typedef Map<const Net*, NetWireCaps, NetIdLess> NetWireCapMap;
165+
typedef Map<const Pin*, NetWireCaps*, PinIdLess> PinWireCapMap;
154166
typedef Map<const Instance*, Pvt*> InstancePvtMap;
155167
typedef Map<const Edge*, ClockLatency*> EdgeClockLatencyMap;
156168
typedef Map<const Pin*, RiseFallValues*> PinMinPulseWidthMap;
@@ -595,7 +607,7 @@ public:
595607
bool subtract_pin_cap,
596608
const Corner *corner,
597609
const MinMax *min_max,
598-
float cap);
610+
float wire_cap);
599611
bool hasNetWireCap(const Net *net) const;
600612
// True if driver pin net has wire capacitance.
601613
bool drvrPinHasWireCap(const Pin *pin,
@@ -606,7 +618,8 @@ public:
606618
const MinMax *min_max,
607619
// Return values.
608620
float &cap,
609-
bool &exists) const;
621+
bool &exists,
622+
bool &subtract_pin_cap) const;
610623
// Pin capacitance derated by operating conditions and instance pvt.
611624
float pinCapacitance(const Pin *pin,
612625
const RiseFall *rf,

sdc/Sdc.cc

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,14 +3057,18 @@ Sdc::drvrPinWireCap(const Pin *pin,
30573057
const MinMax *min_max,
30583058
// Return values.
30593059
float &cap,
3060-
bool &exists) const
3060+
bool &exists,
3061+
bool &subtract_pin_cap) const
30613062
{
3062-
MinMaxFloatValues *values = drvr_pin_wire_cap_maps_[corner->index()].findKey(pin);
3063-
if (values)
3064-
values->value(min_max, cap, exists);
3063+
NetWireCaps *net_caps = drvr_pin_wire_cap_maps_[corner->index()].findKey(pin);
3064+
if (net_caps) {
3065+
net_caps->value(min_max, cap, exists);
3066+
subtract_pin_cap = net_caps->subtractPinCap(min_max);
3067+
}
30653068
else {
30663069
cap = 0.0;
30673070
exists = false;
3071+
subtract_pin_cap = false;
30683072
}
30693073
}
30703074

@@ -3073,27 +3077,15 @@ Sdc::setNetWireCap(const Net *net,
30733077
bool subtract_pin_cap,
30743078
const Corner *corner,
30753079
const MinMax *min_max,
3076-
float cap)
3080+
float wire_cap)
30773081
{
3078-
float wire_cap = cap;
3079-
if (subtract_pin_cap) {
3080-
NetConnectedPinIterator *pin_iter = network_->connectedPinIterator(net);
3081-
if (pin_iter->hasNext()) {
3082-
const Pin *pin = pin_iter->next();
3083-
float pin_cap_rise = connectedPinCap(pin, RiseFall::rise(), corner, min_max);
3084-
float pin_cap_fall = connectedPinCap(pin, RiseFall::fall(), corner, min_max);
3085-
float pin_cap = (pin_cap_rise + pin_cap_fall) / 2.0F;
3086-
wire_cap -= pin_cap;
3087-
if ((wire_cap + pin_cap) < 0.0)
3088-
wire_cap = -pin_cap;
3089-
delete pin_iter;
3090-
}
3091-
}
3092-
MinMaxFloatValues &values = net_wire_cap_maps_[corner->index()][net];
3093-
values.setValue(min_max, wire_cap);
3082+
NetWireCaps &net_caps = net_wire_cap_maps_[corner->index()][net];
3083+
net_caps.setValue(min_max, wire_cap);
3084+
net_caps.setSubtractPinCap(subtract_pin_cap, min_max);
3085+
30943086

30953087
for (const Pin *pin : *network_->drivers(net))
3096-
drvr_pin_wire_cap_maps_[corner->index()][pin] = &values;
3088+
drvr_pin_wire_cap_maps_[corner->index()][pin] = &net_caps;
30973089
}
30983090

30993091
bool
@@ -3121,7 +3113,10 @@ Sdc::connectedCap(const Pin *pin,
31213113
{
31223114
netCaps(pin, rf, corner, min_max, pin_cap, wire_cap, fanout, has_net_load);
31233115
float net_wire_cap;
3124-
drvrPinWireCap(pin, corner, min_max, net_wire_cap, has_net_load);
3116+
bool subtract_pin_cap;
3117+
drvrPinWireCap(pin, corner, min_max, net_wire_cap, has_net_load, subtract_pin_cap);
3118+
if (subtract_pin_cap)
3119+
pin_cap = 0.0;
31253120
if (has_net_load)
31263121
wire_cap += net_wire_cap;
31273122
}
@@ -5800,4 +5795,24 @@ findLeafDriverPins(const Pin *pin,
58005795
leaf_pins->insert(pin);
58015796
}
58025797

5798+
////////////////////////////////////////////////////////////////
5799+
5800+
NetWireCaps::NetWireCaps() :
5801+
subtract_pin_cap_{false, false}
5802+
{
5803+
}
5804+
5805+
bool
5806+
NetWireCaps::subtractPinCap(const MinMax *min_max)
5807+
{
5808+
return subtract_pin_cap_[min_max->index()];
5809+
}
5810+
5811+
void
5812+
NetWireCaps::setSubtractPinCap(bool subtrace_pin_cap,
5813+
const MinMax *min_max)
5814+
{
5815+
subtract_pin_cap_[min_max->index()] = subtrace_pin_cap;
5816+
}
5817+
58035818
} // namespace

0 commit comments

Comments
 (0)