Skip to content

Commit

Permalink
Merge branch 'parallaxsw:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy authored Nov 14, 2024
2 parents 9834b58 + 22acd12 commit 6979cea
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 27 deletions.
Binary file modified doc/OpenSTA.odt
Binary file not shown.
Binary file modified doc/OpenSTA.pdf
Binary file not shown.
21 changes: 17 additions & 4 deletions include/sta/Sdc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ private:
const Network *network_;
};

class NetWireCaps : public MinMaxFloatValues
{
public:
NetWireCaps();
bool subtractPinCap(const MinMax *min_max);
void setSubtractPinCap(bool subtrace_pin_cap,
const MinMax *min_max);

private:
bool subtract_pin_cap_[MinMax::index_count];
};

typedef Map<const char*,Clock*, CharPtrLess> ClockNameMap;
typedef UnorderedMap<const Pin*, ClockSet*, PinIdHash> ClockPinMap;
typedef Set<InputDelay*> InputDelaySet;
Expand Down Expand Up @@ -149,8 +161,8 @@ typedef Map<const Pin*, MinMaxFloatValues> PinCapLimitMap;
typedef Map<const Port*, MinMaxFloatValues> PortFanoutLimitMap;
typedef Map<const Cell*, MinMaxFloatValues> CellFanoutLimitMap;
typedef Map<const Port*, PortExtCap*, PortIdLess> PortExtCapMap;
typedef Map<const Net*, MinMaxFloatValues, NetIdLess> NetWireCapMap;
typedef Map<const Pin*, MinMaxFloatValues*, PinIdLess> PinWireCapMap;
typedef Map<const Net*, NetWireCaps, NetIdLess> NetWireCapMap;
typedef Map<const Pin*, NetWireCaps*, PinIdLess> PinWireCapMap;
typedef Map<const Instance*, Pvt*> InstancePvtMap;
typedef Map<const Edge*, ClockLatency*> EdgeClockLatencyMap;
typedef Map<const Pin*, RiseFallValues*> PinMinPulseWidthMap;
Expand Down Expand Up @@ -595,7 +607,7 @@ public:
bool subtract_pin_cap,
const Corner *corner,
const MinMax *min_max,
float cap);
float wire_cap);
bool hasNetWireCap(const Net *net) const;
// True if driver pin net has wire capacitance.
bool drvrPinHasWireCap(const Pin *pin,
Expand All @@ -606,7 +618,8 @@ public:
const MinMax *min_max,
// Return values.
float &cap,
bool &exists) const;
bool &exists,
bool &subtract_pin_cap) const;
// Pin capacitance derated by operating conditions and instance pvt.
float pinCapacitance(const Pin *pin,
const RiseFall *rf,
Expand Down
61 changes: 38 additions & 23 deletions sdc/Sdc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3059,14 +3059,18 @@ Sdc::drvrPinWireCap(const Pin *pin,
const MinMax *min_max,
// Return values.
float &cap,
bool &exists) const
bool &exists,
bool &subtract_pin_cap) const
{
MinMaxFloatValues *values = drvr_pin_wire_cap_maps_[corner->index()].findKey(pin);
if (values)
values->value(min_max, cap, exists);
NetWireCaps *net_caps = drvr_pin_wire_cap_maps_[corner->index()].findKey(pin);
if (net_caps) {
net_caps->value(min_max, cap, exists);
subtract_pin_cap = net_caps->subtractPinCap(min_max);
}
else {
cap = 0.0;
exists = false;
subtract_pin_cap = false;
}
}

Expand All @@ -3075,27 +3079,15 @@ Sdc::setNetWireCap(const Net *net,
bool subtract_pin_cap,
const Corner *corner,
const MinMax *min_max,
float cap)
float wire_cap)
{
float wire_cap = cap;
if (subtract_pin_cap) {
NetConnectedPinIterator *pin_iter = network_->connectedPinIterator(net);
if (pin_iter->hasNext()) {
const Pin *pin = pin_iter->next();
float pin_cap_rise = connectedPinCap(pin, RiseFall::rise(), corner, min_max);
float pin_cap_fall = connectedPinCap(pin, RiseFall::fall(), corner, min_max);
float pin_cap = (pin_cap_rise + pin_cap_fall) / 2.0F;
wire_cap -= pin_cap;
if ((wire_cap + pin_cap) < 0.0)
wire_cap = -pin_cap;
delete pin_iter;
}
}
MinMaxFloatValues &values = net_wire_cap_maps_[corner->index()][net];
values.setValue(min_max, wire_cap);
NetWireCaps &net_caps = net_wire_cap_maps_[corner->index()][net];
net_caps.setValue(min_max, wire_cap);
net_caps.setSubtractPinCap(subtract_pin_cap, min_max);


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

bool
Expand Down Expand Up @@ -3123,7 +3115,10 @@ Sdc::connectedCap(const Pin *pin,
{
netCaps(pin, rf, corner, min_max, pin_cap, wire_cap, fanout, has_net_load);
float net_wire_cap;
drvrPinWireCap(pin, corner, min_max, net_wire_cap, has_net_load);
bool subtract_pin_cap;
drvrPinWireCap(pin, corner, min_max, net_wire_cap, has_net_load, subtract_pin_cap);
if (subtract_pin_cap)
pin_cap = 0.0;
if (has_net_load)
wire_cap += net_wire_cap;
}
Expand Down Expand Up @@ -5826,4 +5821,24 @@ findLeafDriverPins(const Pin *pin,
leaf_pins->insert(pin);
}

////////////////////////////////////////////////////////////////

NetWireCaps::NetWireCaps() :
subtract_pin_cap_{false, false}
{
}

bool
NetWireCaps::subtractPinCap(const MinMax *min_max)
{
return subtract_pin_cap_[min_max->index()];
}

void
NetWireCaps::setSubtractPinCap(bool subtrace_pin_cap,
const MinMax *min_max)
{
subtract_pin_cap_[min_max->index()] = subtrace_pin_cap;
}

} // namespace

0 comments on commit 6979cea

Please sign in to comment.