Skip to content

Commit 7b4cea5

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents d7cb9be + 771050b commit 7b4cea5

30 files changed

+521
-887
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ set(STA_SOURCE
202202
search/TagGroup.cc
203203
search/VertexVisitor.cc
204204
search/VisitPathEnds.cc
205-
search/VisitPathGroupVertices.cc
206205
search/WorstSlack.cc
207206

208207
spice/WritePathSpice.cc

doc/ApiChanges.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ The following classes now return const objects.
5050
Transition
5151
TimingRole
5252

53+
Liberty PgPorts are now LibertyPorts with additional member functions for
54+
liberty pg_pins.
55+
5356
Release 2.6.1 2025/03/??
5457
-------------------------
5558

doc/ChangeLog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ to remove paths through identical pins and rise/fall edges.
1717

1818
report_checks [-unique_edges_to_endpoint]
1919

20+
Instances now have pins for verilog netlist power/ground connections,
21+
2022
Release 2.6.1 2025/03/30
2123
-------------------------
2224

include/sta/Liberty.hh

Lines changed: 23 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class WriteTimingModel;
4343
class LibertyCellIterator;
4444
class LibertyCellPortIterator;
4545
class LibertyCellPortBitIterator;
46-
class LibertyCellPgPortIterator;
4746
class LibertyPortMemberIterator;
4847
class ModeValueDef;
4948
class TestCell;
@@ -56,7 +55,6 @@ class LibertyReader;
5655
class OcvDerate;
5756
class TimingArcAttrs;
5857
class InternalPowerAttrs;
59-
class LibertyPgPort;
6058
class StaState;
6159
class Corner;
6260
class Corners;
@@ -90,7 +88,6 @@ typedef Vector<LatchEnable*> LatchEnableSeq;
9088
typedef Map<const char *, OcvDerate*, CharPtrLess> OcvDerateMap;
9189
typedef Vector<InternalPowerAttrs*> InternalPowerAttrsSeq;
9290
typedef Map<std::string, float> SupplyVoltageMap;
93-
typedef Map<std::string, LibertyPgPort*> LibertyPgPortMap;
9491
typedef Map<std::string, DriverWaveform*> DriverWaveformMap;
9592
typedef Vector<DcalcAnalysisPt*> DcalcAnalysisPtSeq;
9693

@@ -100,6 +97,12 @@ enum class DelayModelType { cmos_linear, cmos_pwl, cmos2, table, polynomial, dcm
10097

10198
enum class ScanSignalType { enable, enable_inverted, clock, clock_a, clock_b,
10299
input, input_inverted, output, output_inverted, none };
100+
enum class PwrGndType { none,
101+
primary_power, primary_ground,
102+
backup_power, backup_ground,
103+
internal_power, internal_ground,
104+
nwell, pwell,
105+
deepnwell, deeppwell};
103106

104107
enum class ScaleFactorPvt { process, volt, temp, unknown };
105108
constexpr int scale_factor_pvt_count = int(ScaleFactorPvt::unknown) + 1;
@@ -423,8 +426,6 @@ public:
423426
LibertyPort *findLibertyPort(const char *name) const;
424427
LibertyPortSeq findLibertyPortsMatching(PatternMatch *pattern) const;
425428
bool hasInternalPorts() const { return has_internal_ports_; }
426-
LibertyPgPort *findPgPort(const char *name) const;
427-
size_t pgPortCount() const { return pg_port_map_.size(); }
428429
ScaleFactors *scaleFactors() const { return scale_factors_; }
429430
void setScaleFactors(ScaleFactors *scale_factors);
430431
ModeDef *makeModeDef(const char *name);
@@ -533,7 +534,6 @@ public:
533534
void setOcvArcDepth(float depth);
534535
void setOcvDerate(OcvDerate *derate);
535536
void addOcvDerate(OcvDerate *derate);
536-
void addPgPort(LibertyPgPort *pg_port);
537537
void setTestCell(TestCell *test);
538538
void setHasInferedRegTimingArcs(bool infered);
539539
void setIsDisabledConstraint(bool is_disabled);
@@ -643,7 +643,6 @@ protected:
643643
Vector<LibertyCell*> corner_cells_;
644644
float leakage_power_;
645645
bool leakage_power_exists_;
646-
LibertyPgPortMap pg_port_map_;
647646
bool has_internal_ports_;
648647
std::atomic<bool> have_voltage_waveforms_;
649648
std::mutex waveform_lock_;
@@ -653,7 +652,6 @@ protected:
653652
private:
654653
friend class LibertyLibrary;
655654
friend class LibertyCellPortIterator;
656-
friend class LibertyCellPgPortIterator;
657655
friend class LibertyPort;
658656
friend class LibertyBuilder;
659657
};
@@ -681,17 +679,6 @@ private:
681679
ConcreteCellPortBitIterator *iter_;
682680
};
683681

684-
class LibertyCellPgPortIterator : public Iterator<LibertyPgPort*>
685-
{
686-
public:
687-
LibertyCellPgPortIterator(const LibertyCell *cell);
688-
bool hasNext();
689-
LibertyPgPort *next();
690-
691-
private:
692-
LibertyPgPortMap::Iterator iter_;
693-
};
694-
695682
////////////////////////////////////////////////////////////////
696683

697684
class LibertyPort : public ConcretePort
@@ -704,6 +691,16 @@ public:
704691
LibertyPort *bundlePort() const;
705692
BusDcl *busDcl() const { return bus_dcl_; }
706693
void setDirection(PortDirection *dir);
694+
695+
////////////////////////////////////////////////////////////////
696+
// pg_pin functions
697+
bool isPwrGnd() const;
698+
PwrGndType pwrGndType() const { return pwr_gnd_type_; }
699+
void setPwrGndType(PwrGndType type);
700+
const char *voltageName() const { return voltage_name_.c_str(); }
701+
void setVoltageName(const char *voltage_name);
702+
////////////////////////////////////////////////////////////////
703+
707704
ScanSignalType scanSignalType() const { return scan_signal_type_; }
708705
void setScanSignalType(ScanSignalType type);
709706
void fanoutLoad(// Return values.
@@ -887,8 +884,10 @@ protected:
887884

888885
LibertyCell *liberty_cell_;
889886
BusDcl *bus_dcl_;
890-
FuncExpr *function_;
887+
PwrGndType pwr_gnd_type_;
888+
std::string voltage_name_;
891889
ScanSignalType scan_signal_type_;
890+
FuncExpr *function_;
892891
FuncExpr *tristate_enable_;
893892
ScaledPortMap *scaled_ports_;
894893
RiseFallMinMax capacitance_;
@@ -1136,37 +1135,13 @@ private:
11361135
TablePtr derate_[RiseFall::index_count][EarlyLate::index_count][path_type_count];
11371136
};
11381137

1139-
// Power/ground port.
1140-
class LibertyPgPort
1141-
{
1142-
public:
1143-
enum PgType { unknown,
1144-
primary_power, primary_ground,
1145-
backup_power, backup_ground,
1146-
internal_power, internal_ground,
1147-
nwell, pwell,
1148-
deepnwell, deeppwell};
1149-
LibertyPgPort(const char *name,
1150-
LibertyCell *cell);
1151-
const char *name() const { return name_.c_str(); }
1152-
LibertyCell *cell() const { return cell_; }
1153-
PgType pgType() const { return pg_type_; }
1154-
void setPgType(PgType type);
1155-
const char *voltageName() const { return voltage_name_.c_str(); }
1156-
void setVoltageName(const char *voltage_name);
1157-
static bool equiv(const LibertyPgPort *port1,
1158-
const LibertyPgPort *port2);
1159-
1160-
private:
1161-
std::string name_;
1162-
PgType pg_type_;
1163-
std::string voltage_name_;
1164-
LibertyCell *cell_;
1165-
};
1166-
11671138
std::string
11681139
portLibertyToSta(const char *port_name);
11691140
const char *
11701141
scanSignalTypeName(ScanSignalType scan_type);
1142+
const char *
1143+
pwrGndTypeName(PwrGndType pwr_gnd_type);
1144+
PwrGndType
1145+
findPwrGndType(const char *pg_name);
11711146

11721147
} // namespace

include/sta/Sdc.hh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ typedef Set<InputDelay*> InputDelaySet;
136136
typedef Map<const Pin*, InputDelaySet*, PinIdLess> InputDelaysPinMap;
137137
typedef Set<OutputDelay*> OutputDelaySet;
138138
typedef Map<const Pin*,OutputDelaySet*, PinIdLess> OutputDelaysPinMap;
139-
typedef UnorderedMap<const Pin*,ExceptionPathSet*> PinExceptionsMap;
140-
typedef Map<const Clock*,ExceptionPathSet*> ClockExceptionsMap;
141-
typedef Map<const Instance*,ExceptionPathSet*> InstanceExceptionsMap;
142-
typedef Map<const Net*,ExceptionPathSet*> NetExceptionsMap;
143-
typedef UnorderedMap<EdgePins, ExceptionPathSet*,
139+
typedef UnorderedMap<const Pin*,ExceptionPathSet> PinExceptionsMap;
140+
typedef UnorderedMap<const Clock*,ExceptionPathSet> ClockExceptionsMap;
141+
typedef UnorderedMap<const Instance*,ExceptionPathSet> InstanceExceptionsMap;
142+
typedef UnorderedMap<const Net*,ExceptionPathSet> NetExceptionsMap;
143+
typedef UnorderedMap<EdgePins, ExceptionPathSet,
144144
PinPairHash, PinPairEqual> EdgeExceptionsMap;
145145
typedef Vector<ExceptionThru*> ExceptionThruSeq;
146146
typedef Map<const Port*,InputDrive*> InputDriveMap;
147-
typedef Map<size_t, ExceptionPathSet*, std::less<size_t> > ExceptionPathPtHash;
147+
typedef Map<size_t, ExceptionPathSet, std::less<size_t>> ExceptionPathPtHash;
148148
typedef Set<ClockLatency*, ClockLatencyLess> ClockLatencies;
149149
typedef Map<const Pin*, ClockUncertainties*> PinClockUncertaintyMap;
150150
typedef Set<InterClockUncertainty*, InterClockUncertaintyLess> InterClockUncertaintySet;
@@ -1018,7 +1018,7 @@ public:
10181018
const PinSet &pathDelayInternalFrom() const;
10191019
bool isPathDelayInternalTo(const Pin *pin) const;
10201020
bool isPathDelayInternalToBreak(const Pin *pin) const;
1021-
ExceptionPathSet *exceptions() { return &exceptions_; }
1021+
ExceptionPathSet &exceptions() { return exceptions_; }
10221022
void deleteExceptions();
10231023
void deleteException(ExceptionPath *exception);
10241024
void recordException(ExceptionPath *exception);
@@ -1043,7 +1043,6 @@ protected:
10431043
void removeLibertyAnnotations();
10441044
void deleteExceptionsReferencing(Clock *clk);
10451045
void deleteClkPinMappings(Clock *clk);
1046-
void deleteExceptionPtHashMapSets(ExceptionPathPtHash &map);
10471046
void makeClkPinMappings(Clock *clk);
10481047
void deletePinClocks(Clock *defining_clk,
10491048
PinSet *pins);

include/sta/SdcClass.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ typedef Set<LibertyPortPair, LibertyPortPairLess> LibertyPortPairSet;
9595
typedef Map<const Instance*, DisabledInstancePorts*> DisabledInstancePortsMap;
9696
typedef Map<LibertyCell*, DisabledCellPorts*> DisabledCellPortsMap;
9797
typedef MinMaxValues<float> ClockUncertainties;
98-
typedef Set<ExceptionPath*> ExceptionPathSet;
98+
typedef std::set<ExceptionPath*> ExceptionPathSet;
9999
typedef PinPair EdgePins;
100100
typedef PinPairSet EdgePinsSet;
101101
typedef Map<const Pin*, LogicValue> LogicValueMap;

include/sta/Sta.hh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,6 @@ public:
907907
PinSet endpointPins();
908908
VertexSet *endpoints();
909909
int endpointViolationCount(const MinMax *min_max);
910-
// Find the fanin vertices for a group path.
911-
// Vertices in the clock network are NOT included.
912-
PinSet findGroupPathPins(const char *group_path_name);
913910
// Find all required times after updateTiming().
914911
void findRequireds();
915912
std::string reportDelayCalc(Edge *edge,

liberty/EquivCells.cc

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,9 @@ static unsigned
6767
hashFuncExpr(const FuncExpr *expr);
6868
static unsigned
6969
hashPort(const LibertyPort *port);
70-
static unsigned
71-
hashCellPgPorts(const LibertyCell *cell);
72-
static unsigned
73-
hashPgPort(const LibertyPgPort *port);
7470
static bool
7571
cellHasFuncs(const LibertyCell *cell);
7672

77-
static bool
78-
equivCellPgPorts(const LibertyCell *cell1,
79-
const LibertyCell *cell2);
80-
8173
static float
8274
cellDriveResistance(const LibertyCell *cell)
8375
{
@@ -201,7 +193,6 @@ static unsigned
201193
hashCell(const LibertyCell *cell)
202194
{
203195
return hashCellPorts(cell)
204-
+ hashCellPgPorts(cell)
205196
+ hashCellSequentials(cell);
206197
}
207198

@@ -226,25 +217,6 @@ hashPort(const LibertyPort *port)
226217
+ port->direction()->index() * 5;
227218
}
228219

229-
static unsigned
230-
hashCellPgPorts(const LibertyCell *cell)
231-
{
232-
unsigned hash = 0;
233-
LibertyCellPgPortIterator port_iter(cell);
234-
while (port_iter.hasNext()) {
235-
LibertyPgPort *port = port_iter.next();
236-
hash += hashPgPort(port);
237-
}
238-
return hash;
239-
}
240-
241-
static unsigned
242-
hashPgPort(const LibertyPgPort *port)
243-
{
244-
return hashString(port->name()) * 3
245-
+ static_cast<int>(port->pgType()) * 5;
246-
}
247-
248220
static unsigned
249221
hashCellSequentials(const LibertyCell *cell)
250222
{
@@ -333,7 +305,6 @@ equivCells(const LibertyCell *cell1,
333305
{
334306
return equivCellPorts(cell1, cell2)
335307
&& equivCellFuncs(cell1, cell2)
336-
&& equivCellPgPorts(cell1, cell2)
337308
&& equivCellSequentials(cell1, cell2)
338309
&& equivCellStatetables(cell1, cell2)
339310
// Reqwuire timing arc equivalence if there are no functions.
@@ -347,7 +318,6 @@ equivCellsArcs(const LibertyCell *cell1,
347318
{
348319
return equivCellPorts(cell1, cell2)
349320
&& equivCellFuncs(cell1, cell2)
350-
&& equivCellPgPorts(cell1, cell2)
351321
&& equivCellSequentials(cell1, cell2)
352322
&& equivCellStatetables(cell1, cell2)
353323
// Reqwuire timing arc equivalence if there are no functions.
@@ -403,25 +373,6 @@ equivCellPorts(const LibertyCell *cell1,
403373
}
404374
}
405375

406-
static bool
407-
equivCellPgPorts(const LibertyCell *cell1,
408-
const LibertyCell *cell2)
409-
{
410-
if (cell1->pgPortCount() != cell2->pgPortCount())
411-
return false;
412-
else {
413-
LibertyCellPgPortIterator port_iter1(cell1);
414-
while (port_iter1.hasNext()) {
415-
LibertyPgPort *port1 = port_iter1.next();
416-
const char* name = port1->name();
417-
LibertyPgPort *port2 = cell2->findPgPort(name);
418-
if (!(port2 && LibertyPgPort::equiv(port1, port2)))
419-
return false;
420-
}
421-
return true;
422-
}
423-
}
424-
425376
bool
426377
equivCellSequentials(const LibertyCell *cell1,
427378
const LibertyCell *cell2)

0 commit comments

Comments
 (0)