-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathSdc.hh
More file actions
1418 lines (1381 loc) · 51.9 KB
/
Sdc.hh
File metadata and controls
1418 lines (1381 loc) · 51.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2025, Parallax Software, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software.
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// This notice may not be removed or altered from any source distribution.
#pragma once
#include <mutex>
#include "StringUtil.hh"
#include "StringSet.hh"
#include "Map.hh"
#include "UnorderedMap.hh"
#include "MinMax.hh"
#include "StaState.hh"
#include "NetworkClass.hh"
#include "LibertyClass.hh"
#include "GraphClass.hh"
#include "SdcClass.hh"
#include "RiseFallValues.hh"
#include "Clock.hh"
#include "DataCheck.hh"
#include "CycleAccting.hh"
#include "ExceptionPath.hh"
namespace sta {
class OperatingConditions;
class PortExtCap;
class ClockGatingCheck;
class InputDriveCell;
class DisabledPorts;
class GraphLoop;
class DeratingFactors;
class DeratingFactorsGlobal;
class DeratingFactorsNet;
class DeratingFactorsCell;
class PatternMatch;
class FindNetCaps;
class ClkHpinDisable;
class FindClkHpinDisables;
class Corner;
class ClockPinIterator;
class ClockIterator;
typedef std::pair<const Pin*, const Clock*> PinClockPair;
class ClockInsertionkLess
{
public:
ClockInsertionkLess(const Network *network);
bool operator()(const ClockInsertion *insert1,
const ClockInsertion *insert2) const;
private:
const Network *network_;
};
class ClockLatencyLess
{
public:
ClockLatencyLess(const Network *network);
bool operator()(const ClockLatency *latency1,
const ClockLatency *latency2) const;
private:
const Network *network_;
};
// This is symmetric with respect to the clocks
// in the pair so Pair(clk1, clk2) is the same
// as Pair(clk2, clk1).
class ClockPairLess
{
public:
bool operator()(const ClockPair &pair1,
const ClockPair &pair2) const;
};
class PinClockPairLess
{
public:
PinClockPairLess(const Network *network);
bool operator()(const PinClockPair &pin_clk1,
const PinClockPair &pin_clk2) const;
protected:
const Network *network_;
};
class ClkHpinDisableLess
{
public:
ClkHpinDisableLess(const Network *network);
bool operator()(const ClkHpinDisable *disable1,
const ClkHpinDisable *disable2) const;
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;
typedef Map<const Pin*, InputDelaySet*, PinIdLess> InputDelaysPinMap;
typedef Set<OutputDelay*> OutputDelaySet;
typedef Map<const Pin*,OutputDelaySet*, PinIdLess> OutputDelaysPinMap;
typedef UnorderedMap<const Pin*,ExceptionPathSet> PinExceptionsMap;
typedef UnorderedMap<const Clock*,ExceptionPathSet> ClockExceptionsMap;
typedef UnorderedMap<const Instance*,ExceptionPathSet> InstanceExceptionsMap;
typedef UnorderedMap<const Net*,ExceptionPathSet> NetExceptionsMap;
typedef UnorderedMap<EdgePins, ExceptionPathSet,
PinPairHash, PinPairEqual> EdgeExceptionsMap;
typedef Vector<ExceptionThru*> ExceptionThruSeq;
typedef Map<const Port*,InputDrive*> InputDriveMap;
typedef Map<size_t, ExceptionPathSet, std::less<size_t>> ExceptionPathPtHash;
typedef Set<ClockLatency*, ClockLatencyLess> ClockLatencies;
typedef Map<const Pin*, ClockUncertainties*> PinClockUncertaintyMap;
typedef Set<InterClockUncertainty*, InterClockUncertaintyLess> InterClockUncertaintySet;
typedef Map<const Clock*, ClockGatingCheck*> ClockGatingCheckMap;
typedef Map<const Instance*, ClockGatingCheck*> InstanceClockGatingCheckMap;
typedef Map<const Pin*, ClockGatingCheck*> PinClockGatingCheckMap;
typedef Set<ClockInsertion*, ClockInsertionkLess> ClockInsertions;
typedef Map<const Pin*, float> PinLatchBorrowLimitMap;
typedef Map<const Instance*, float> InstLatchBorrowLimitMap;
typedef Map<const Clock*, float> ClockLatchBorrowLimitMap;
typedef Set<DataCheck*, DataCheckLess> DataCheckSet;
typedef Map<const Pin*, DataCheckSet*> DataChecksMap;
typedef Map<const Net*, MinMaxFloatValues> NetResistanceMap;
typedef Map<const Port*, MinMaxFloatValues> PortSlewLimitMap;
typedef Map<const Pin*, MinMaxFloatValues> PinSlewLimitMap;
typedef Map<const Cell*, MinMaxFloatValues> CellSlewLimitMap;
typedef Map<const Cell*, MinMaxFloatValues> CellCapLimitMap;
typedef Map<const Port*, MinMaxFloatValues> PortCapLimitMap;
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*, 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;
typedef Map<const Clock*, RiseFallValues*> ClockMinPulseWidthMap;
typedef Map<const Instance*, RiseFallValues*> InstMinPulseWidthMap;
typedef Map<const Net*, DeratingFactorsNet*> NetDeratingFactorsMap;
typedef Map<const Instance*, DeratingFactorsCell*> InstDeratingFactorsMap;
typedef Map<const LibertyCell*, DeratingFactorsCell*> CellDeratingFactorsMap;
typedef Set<ClockGroups*> ClockGroupsSet;
typedef Map<const Clock*, ClockGroupsSet*> ClockGroupsClkMap;
typedef Map<const char*, ClockGroups*, CharPtrLess> ClockGroupsNameMap;
typedef Map<PinClockPair, ClockSense, PinClockPairLess> ClockSenseMap;
typedef Set<ClkHpinDisable*, ClkHpinDisableLess> ClkHpinDisables;
typedef Set<GroupPath*, ExceptionPathLess> GroupPathSet;
typedef Map<const char*, GroupPathSet*, CharPtrLess> GroupPathMap;
typedef Set<ClockPair, ClockPairLess> ClockPairSet;
typedef Map<const Net*, MinMaxFloatValues> NetVoltageMap;
void
findLeafLoadPins(const Pin *pin,
const Network *network,
PinSet *leaf_pins);
void
findLeafDriverPins(const Pin *pin,
const Network *network,
PinSet *leaf_pins);
class Sdc : public StaState
{
public:
Sdc(StaState *sta);
~Sdc();
// Note that Search may reference a Filter exception removed by clear().
void clear();
void makeCornersBefore();
void makeCornersAfter(Corners *corners);
// Return true if pin is referenced by any constraint.
bool isConstrained(const Pin *pin) const;
// Return true if inst is referenced by any constraint.
// Does NOT include references by pins connected to the instance.
bool isConstrained(const Instance *inst) const;
// Return true if net is referenced by any constraint.
// Does NOT include references by pins connected to the net.
bool isConstrained(const Net *net) const;
// Build data structures for search.
void searchPreamble();
void deleteNetBefore(const Net *net);
void deleteInstanceBefore(const Instance *inst);
// SWIG sdc interface.
PortSeq allInputs(bool no_clks);
PortSeq allOutputs();
AnalysisType analysisType() { return analysis_type_; }
void setAnalysisType(AnalysisType analysis_type);
void setOperatingConditions(OperatingConditions *op_cond,
const MinMaxAll *min_max);
void setOperatingConditions(OperatingConditions *op_cond,
const MinMax *min_max);
void setTimingDerate(TimingDerateType type,
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate);
// Delay type is always net for net derating.
void setTimingDerate(const Net *net,
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate);
void setTimingDerate(const Instance *inst,
TimingDerateCellType type,
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate);
void setTimingDerate(const LibertyCell *cell,
TimingDerateCellType type,
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate);
float timingDerateInstance(const Pin *pin,
TimingDerateCellType type,
PathClkOrData clk_data,
const RiseFall *rf,
const EarlyLate *early_late) const;
float timingDerateNet(const Pin *pin,
PathClkOrData clk_data,
const RiseFall *rf,
const EarlyLate *early_late) const;
void unsetTimingDerate();
static void swapDeratingFactors(Sdc *sdc1,
Sdc *sdc2);
void setInputSlew(const Port *port,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float slew);
// Set the rise/fall drive resistance on design port.
void setDriveResistance(const Port *port,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float res);
// Set the drive on design port using external cell timing arcs of
// cell driven by from_slews between from_port and to_port.
void setDriveCell(const LibertyLibrary *library,
const LibertyCell *cell,
const Port *port,
const LibertyPort *from_port,
float *from_slews,
const LibertyPort *to_port,
const RiseFallBoth *rf,
const MinMaxAll *min_max);
void setLatchBorrowLimit(const Pin *pin,
float limit);
void setLatchBorrowLimit(const Instance *inst,
float limit);
void setLatchBorrowLimit(const Clock *clk,
float limit);
// Return the latch borrow limit respecting precedence if multiple
// limits apply.
void latchBorrowLimit(const Pin *data_pin,
const Pin *enable_pin,
const Clock *clk,
// Return values.
float &limit,
bool &exists);
void setMinPulseWidth(const RiseFallBoth *rf,
float min_width);
void setMinPulseWidth(const Pin *pin,
const RiseFallBoth *rf,
float min_width);
void setMinPulseWidth(const Instance *inst,
const RiseFallBoth *rf,
float min_width);
void setMinPulseWidth(const Clock *clk,
const RiseFallBoth *rf,
float min_width);
// Return min pulse with respecting precedence.
void minPulseWidth(const Pin *pin,
const Clock *clk,
const RiseFall *hi_low,
float &min_width,
bool &exists) const;
void setSlewLimit(Clock *clk,
const RiseFallBoth *rf,
const PathClkOrData clk_data,
const MinMax *min_max,
float slew);
bool haveClkSlewLimits() const;
void slewLimit(Clock *clk,
const RiseFall *rf,
const PathClkOrData clk_data,
const MinMax *min_max,
float &slew,
bool &exists);
void slewLimit(Port *port,
const MinMax *min_max,
float &slew,
bool &exists);
void setSlewLimit(Port *port,
const MinMax *min_max,
float slew);
void slewLimit(Cell *cell,
const MinMax *min_max,
float &slew,
bool &exists);
void setSlewLimit(Cell *cell,
const MinMax *min_max,
float slew);
void capacitanceLimit(Port *port,
const MinMax *min_max,
float &cap,
bool &exists);
void capacitanceLimit(Pin *pin,
const MinMax *min_max,
float &cap,
bool &exists);
void capacitanceLimit(Cell *cell,
const MinMax *min_max,
float &cap,
bool &exists);
void setCapacitanceLimit(Port *port,
const MinMax *min_max,
float cap);
void setCapacitanceLimit(Pin *pin,
const MinMax *min_max,
float cap);
void setCapacitanceLimit(Cell *cell,
const MinMax *min_max,
float cap);
void fanoutLimit(Port *port,
const MinMax *min_max,
float &fanout,
bool &exists);
void setFanoutLimit(Port *port,
const MinMax *min_max,
float fanout);
void fanoutLimit(Cell *cell,
const MinMax *min_max,
float &fanout,
bool &exists);
void setFanoutLimit(Cell *cell,
const MinMax *min_max,
float fanout);
void setMaxArea(float area);
float maxArea() const;
void createLibertyGeneratedClocks(Clock *clk);
Clock *makeClock(const char *name,
PinSet *pins,
bool add_to_pins,
float period,
FloatSeq *waveform,
const char *comment);
// edges size must be 3.
Clock *makeGeneratedClock(const char *name,
PinSet *pins,
bool add_to_pins,
Pin *src_pin,
Clock *master_clk,
int divide_by,
int multiply_by,
float duty_cycle,
bool invert,
bool combinational,
IntSeq *edges,
FloatSeq *edge_shifts,
const char *comment);
// Invalidate all generated clock waveforms.
void invalidateGeneratedClks() const;
void removeClock(Clock *clk);
// Clock used for inputs without defined arrivals.
ClockEdge *defaultArrivalClockEdge() const;
Clock *defaultArrivalClock() const { return default_arrival_clk_; }
// Propagated (non-ideal) clocks.
void setPropagatedClock(Clock *clk);
void removePropagatedClock(Clock *clk);
void setPropagatedClock(Pin *pin);
void removePropagatedClock(Pin *pin);
bool isPropagatedClock(const Pin *pin);
void setClockSlew(Clock *clk,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float slew);
void removeClockSlew(Clock *clk);
// Latency can be on a clk, pin, or clk/pin combination.
void setClockLatency(Clock *clk,
Pin *pin,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float delay);
void removeClockLatency(const Clock *clk,
const Pin *pin);
ClockLatency *clockLatency(Edge *edge) const;
bool hasClockLatency(const Pin *pin) const;
void clockLatency(Edge *edge,
const RiseFall *rf,
const MinMax *min_max,
// Return values.
float &latency,
bool &exists) const;
ClockLatencies *clockLatencies() { return &clk_latencies_; }
const ClockLatencies *clockLatencies() const { return &clk_latencies_; }
// Clock latency on pin with respect to clk.
// This does NOT check for latency on clk (without pin).
void clockLatency(const Clock *clk,
const Pin *pin,
const RiseFall *rf,
const MinMax *min_max,
// Return values.
float &latency,
bool &exists) const;
void clockLatency(const Clock *clk,
const RiseFall *rf,
const MinMax *min_max,
// Return values.
float &latency,
bool &exists) const;
float clockLatency(const Clock *clk,
const RiseFall *rf,
const MinMax *min_max) const;
// Clock insertion delay (set_clk_latency -source).
// Insertion delay can be on a clk, pin, or clk/pin combination.
void setClockInsertion(const Clock *clk,
const Pin *pin,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
const EarlyLateAll *early_late,
float delay);
void setClockInsertion(const Clock *clk, const Pin *pin,
const RiseFall *rf,
const MinMax *min_max,
const EarlyLate *early_late,
float delay);
void removeClockInsertion(const Clock *clk,
const Pin *pin);
static void swapClockInsertions(Sdc *sdc1,
Sdc *sdc2);
bool hasClockInsertion(const Pin *pin) const;
float clockInsertion(const Clock *clk,
const RiseFall *rf,
const MinMax *min_max,
const EarlyLate *early_late) const;
// Respects precedence of pin/clk and set_input_delay on clk pin.
void clockInsertion(const Clock *clk,
const Pin *pin,
const RiseFall *rf,
const MinMax *min_max,
const EarlyLate *early_late,
// Return values.
float &insertion,
bool &exists) const;
const ClockInsertions &clockInsertions() const { return clk_insertions_; }
// Clock uncertainty.
void setClockUncertainty(Pin *pin,
const SetupHoldAll *setup_hold,
float uncertainty);
void removeClockUncertainty(Pin *pin,
const SetupHoldAll *setup_hold);
void setClockUncertainty(Clock *from_clk,
const RiseFallBoth *from_rf,
Clock *to_clk,
const RiseFallBoth *to_rf,
const SetupHoldAll *setup_hold,
float uncertainty);
void removeClockUncertainty(Clock *from_clk,
const RiseFallBoth *from_rf,
Clock *to_clk,
const RiseFallBoth *to_rf,
const SetupHoldAll *setup_hold);
ClockGroups *makeClockGroups(const char *name,
bool logically_exclusive,
bool physically_exclusive,
bool asynchronous,
bool allow_paths,
const char *comment);
void makeClockGroup(ClockGroups *clk_groups,
ClockSet *clks);
void removeClockGroups(const char *name);
// nullptr name removes all.
void removeClockGroupsLogicallyExclusive(const char *name);
void removeClockGroupsPhysicallyExclusive(const char *name);
void removeClockGroupsAsynchronous(const char *name);
bool sameClockGroup(const Clock *clk1,
const Clock *clk2);
// Clocks explicitly excluded by set_clock_group.
bool sameClockGroupExplicit(const Clock *clk1,
const Clock *clk2);
void setClockSense(PinSet *pins,
ClockSet *clks,
ClockSense sense);
bool clkStopPropagation(const Pin *pin,
const Clock *clk) const;
bool clkStopPropagation(const Clock *clk,
const Pin *from_pin,
const RiseFall *from_rf,
const Pin *to_pin,
const RiseFall *to_rf) const;
void setClockGatingCheck(const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin);
void setClockGatingCheck(Instance *inst,
const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin,
LogicValue active_value);
void setClockGatingCheck(Clock *clk,
const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin);
void setClockGatingCheck(const Pin *pin,
const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin,
LogicValue active_value);
void setDataCheck(Pin *from,
const RiseFallBoth *from_rf,
Pin *to,
const RiseFallBoth *to_rf,
Clock *clk,
const SetupHoldAll *setup_hold,
float margin);
void removeDataCheck(Pin *from,
const RiseFallBoth *from_rf,
Pin *to,
const RiseFallBoth *to_rf,
Clock *clk,
const SetupHoldAll *setup_hold);
DataCheckSet *dataChecksFrom(const Pin *from) const;
DataCheckSet *dataChecksTo(const Pin *to) const;
void setInputDelay(const Pin *pin,
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_rf,
const Pin *ref_pin,
bool source_latency_included,
bool network_latency_included,
const MinMaxAll *min_max,
bool add,
float delay);
void removeInputDelay(const Pin *pin,
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_rf,
const MinMaxAll *min_max);
void setOutputDelay(const Pin *pin,
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_tr,
const Pin *ref_pin,
bool source_latency_included,
bool network_latency_included,
const MinMaxAll *min_max,
bool add,
float delay);
void removeOutputDelay(const Pin *pin,
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_rf,
const MinMaxAll *min_max);
static void swapPortDelays(Sdc *sdc1,
Sdc *sdc2);
// Set port external pin load (set_load -pin_load port).
void setPortExtPinCap(const Port *port,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max,
float cap);
// Set port external wire load (set_load -wire port).
void setPortExtWireCap(const Port *port,
bool subtract_pin_cap,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max,
float cap);
static void swapPortExtCaps(Sdc *sdc1,
Sdc *sdc2);
// Remove all "set_load net" annotations.
void removeNetLoadCaps();
void setNetWireCap(const Net *net,
bool subtract_pin_cap,
const Corner *corner,
const MinMax *min_max,
float wire_cap);
bool hasNetWireCap(const Net *net) const;
// True if driver pin net has wire capacitance.
bool drvrPinHasWireCap(const Pin *pin,
const Corner *corner);
// Net wire capacitance (set_load -wire net).
void drvrPinWireCap(const Pin *drvr_pin,
const Corner *corner,
const MinMax *min_max,
// Return values.
float &cap,
bool &exists,
bool &subtract_pin_cap) const;
// Pin capacitance derated by operating conditions and instance pvt.
float pinCapacitance(const Pin *pin,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max);
void setResistance(const Net *net,
const MinMaxAll *min_max,
float res);
void resistance(const Net *net,
const MinMax *min_max,
float &res,
bool &exists);
NetResistanceMap &netResistances() { return net_res_map_; }
void setPortExtFanout(const Port *port,
const Corner *corner,
const MinMax *min_max,
int fanout);
// set_disable_timing cell [-from] [-to]
// Disable all edges thru cell if from/to are null.
// Bus and bundle ports are NOT supported.
void disable(LibertyCell *cell,
LibertyPort *from,
LibertyPort *to);
void removeDisable(LibertyCell *cell,
LibertyPort *from,
LibertyPort *to);
// set_disable_timing liberty port.
// Bus and bundle ports are NOT supported.
void disable(LibertyPort *port);
void removeDisable(LibertyPort *port);
// set_disable_timing port (top level instance port).
// Bus and bundle ports are NOT supported.
void disable(Port *port);
void removeDisable(Port *port);
// set_disable_timing instance [-from] [-to].
// Disable all edges thru instance if from/to are null.
// Bus and bundle ports are NOT supported.
void disable(Instance *inst,
LibertyPort *from,
LibertyPort *to);
void removeDisable(Instance *inst,
LibertyPort *from,
LibertyPort *to);
// set_disable_timing pin
void disable(const Pin *pin);
void removeDisable(Pin *pin);
// set_disable_timing [get_timing_arc -of_objects instance]]
void disable(Edge *edge);
void removeDisable(Edge *edge);
// set_disable_timing [get_timing_arc -of_objects lib_cell]]
void disable(TimingArcSet *arc_set);
void removeDisable(TimingArcSet *arc_set);
// Disable a wire edge. From/to pins musts be on the same net.
// There is no SDC equivalent to this.
void disable(Pin *from, Pin *to);
void removeDisable(Pin *from, Pin *to);
bool isDisabled(const Pin *pin) const;
// Edge disabled by hierarchical pin disable or instance/cell port pair.
// Disables do NOT apply to timing checks.
// inst can be either the from_pin or to_pin instance because it
// is only referenced when they are the same (non-wire edge).
bool isDisabled(const Instance *inst,
const Pin *from_pin,
const Pin *to_pin,
const TimingRole *role) const;
bool isDisabled(Edge *edge);
bool isDisabled(TimingArcSet *arc_set) const;
DisabledCellPortsMap *disabledCellPorts();
const DisabledInstancePortsMap *disabledInstancePorts() const;
const PinSet *disabledPins() const { return &disabled_pins_; }
const PortSet *disabledPorts() const { return &disabled_ports_; }
const LibertyPortSet *disabledLibPorts() const { return &disabled_lib_ports_; }
const EdgeSet *disabledEdges() const { return &disabled_edges_; }
void disableClockGatingCheck(Instance *inst);
void disableClockGatingCheck(Pin *pin);
void removeDisableClockGatingCheck(Instance *inst);
void removeDisableClockGatingCheck(Pin *pin);
bool isDisableClockGatingCheck(const Pin *pin);
bool isDisableClockGatingCheck(const Instance *inst);
// set_LogicValue::zero, set_LogicValue::one, set_logic_dc
void setLogicValue(const Pin *pin,
LogicValue value);
// set_case_analysis
void setCaseAnalysis(const Pin *pin,
LogicValue value);
void removeCaseAnalysis(const Pin *pin);
void logicValue(const Pin *pin,
LogicValue &value,
bool &exists);
void caseLogicValue(const Pin *pin,
LogicValue &value,
bool &exists);
// Pin has set_case_analysis or set_logic constant value.
bool hasLogicValue(const Pin *pin);
// The from/thrus/to arguments passed into the following functions
// that make exceptions are owned by the constraints once they are
// passed in. The constraint internals may change or delete them do
// to exception merging.
void makeFalsePath(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max,
const char *comment);
// Loop paths are false paths used to disable paths around
// combinational loops when dynamic loop breaking is enabled.
void makeLoopExceptions();
void makeLoopExceptions(GraphLoop *loop);
void deleteLoopExceptions();
void makeMulticyclePath(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max,
bool use_end_clk,
int path_multiplier,
const char *comment);
void makePathDelay(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMax *min_max,
bool ignore_clk_latency,
bool break_path,
float delay,
const char *comment);
bool pathDelaysWithoutTo() const { return path_delays_without_to_; }
// Delete matching false/multicycle/path_delay exceptions.
// Caller owns from, thrus, to exception points (and must delete them).
void resetPath(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max);
void makeGroupPath(const char *name,
bool is_default,
ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const char *comment);
bool isGroupPathName(const char *group_name);
GroupPathMap &groupPaths() { return group_path_map_; }
void addException(ExceptionPath *exception);
// The pin/clk/instance/net set arguments passed into the following
// functions that make exception from/thru/to's are owned by the
// constraints once they are passed in.
ExceptionFrom *makeExceptionFrom(PinSet *from_pins,
ClockSet *from_clks,
InstanceSet *from_insts,
const RiseFallBoth *from_rf);
bool isExceptionStartpoint(const Pin *pin) const;
// Make an exception -through specification.
ExceptionThru *makeExceptionThru(PinSet *pins,
NetSet *nets,
InstanceSet *insts,
const RiseFallBoth *rf);
bool isExceptionEndpoint(const Pin *pin);
// Make an exception -to specification.
ExceptionTo *makeExceptionTo(PinSet *pins,
ClockSet *clks,
InstanceSet *insts,
const RiseFallBoth *rf,
const RiseFallBoth *end_rf);
FilterPath *makeFilterPath(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to);
Wireload *wireload(const MinMax *min_max);
void setWireload(Wireload *wireload,
const MinMaxAll *min_max);
WireloadMode wireloadMode();
void setWireloadMode(WireloadMode mode);
const WireloadSelection *wireloadSelection(const MinMax *min_max);
void setWireloadSelection(WireloadSelection *selection,
const MinMaxAll *min_max);
// STA interface.
InputDelaySet *refPinInputDelays(const Pin *ref_pin) const;
LogicValueMap &logicValues() { return logic_value_map_; }
LogicValueMap &caseLogicValues() { return case_value_map_; }
// Returns nullptr if set_operating_conditions has not been called.
OperatingConditions *operatingConditions(const MinMax *min_max) const;
// Instance specific process/voltage/temperature.
const Pvt *pvt(const Instance *inst,
const MinMax *min_max) const;
// Pvt may be shared among multiple instances.
void setPvt(const Instance *inst,
const MinMaxAll *min_max,
const Pvt &pvt);
void voltage(const MinMax *min_max,
// Return values.
float &voltage,
bool &exists);
void voltage(const Net *net,
const MinMax *min_max,
// Return values.
float &voltage,
bool &exists);
void setVoltage(const MinMax *min_max,
float voltage);
void setVoltage(const Net *net,
const MinMax *min_max,
float voltage);
InputDrive *findInputDrive(Port *port);
Clock *findClock(const char *name) const;
ClockSeq findClocksMatching(PatternMatch *pattern) const;
// True if pin is defined as a clock source (pin may be hierarchical).
bool isClock(const Pin *pin) const;
// True if pin is a clock source vertex.
bool isLeafPinClock(const Pin *pin) const;
// True if pin is a non-generated clock source vertex.
bool isLeafPinNonGeneratedClock(const Pin *pin) const;
// Find the clocks defined for pin.
ClockSet *findClocks(const Pin *pin) const;
ClockSet *findLeafPinClocks(const Pin *pin) const;
void sortedClocks(ClockSeq &clks);
ClockSeq *clocks() { return &clocks_; }
ClockSeq &clks() { return clocks_; }
bool clkDisabledByHpinThru(const Clock *clk,
const Pin *from_pin,
const Pin *to_pin);
void clkHpinDisablesInvalid();
ClockUncertainties *clockUncertainties(const Pin *pin);
void clockUncertainty(const Pin *pin,
const SetupHold *setup_hold,
float &uncertainty,
bool &exists);
// Inter-clock uncertainty.
void clockUncertainty(const Clock *src_clk,
const RiseFall *src_rf,
const Clock *tgt_clk,
const RiseFall *tgt_rf,
const SetupHold *setup_hold,
float &uncertainty, bool &exists);
void clockGatingMarginEnablePin(const Pin *enable_pin,
const RiseFall *enable_rf,
const SetupHold *setup_hold,
bool &exists, float &margin);
void clockGatingMarginInstance(Instance *inst,
const RiseFall *enable_rf,
const SetupHold *setup_hold,
bool &exists, float &margin);
void clockGatingMarginClkPin(const Pin *clk_pin,
const RiseFall *enable_rf,
const SetupHold *setup_hold,
bool &exists, float &margin);
void clockGatingMarginClk(const Clock *clk,
const RiseFall *enable_rf,
const SetupHold *setup_hold,
bool &exists, float &margin);
void clockGatingMargin(const RiseFall *enable_rf,
const SetupHold *setup_hold,
bool &exists, float &margin);
// Gated clock active (non-controlling) logic value.
LogicValue clockGatingActiveValue(const Pin *clk_pin,
const Pin *enable_pin);
// Find the cycle accounting info for paths that start at src clock
// edge and end at target clock edge.
CycleAccting *cycleAccting(const ClockEdge *src,
const ClockEdge *tgt);
// Report clock to clock relationships that exceed max_cycle_count.
void reportClkToClkMaxCycleWarnings();
const InputDelaySet &inputDelays() const { return input_delays_; }
// Pin -> input delays.
const InputDelaysPinMap &inputDelayPinMap() const { return input_delay_pin_map_; }
// Input delays on leaf_pin.
InputDelaySet *inputDelaysLeafPin(const Pin *leaf_pin);
bool hasInputDelay(const Pin *leaf_pin) const;
// Pin is internal (not top level port) and has an input arrival.
bool isInputDelayInternal(const Pin *pin) const;
const OutputDelaySet &outputDelays() const { return output_delays_; }
// Pin -> output delays.
const OutputDelaysPinMap &outputDelaysPinMap() const { return output_delay_pin_map_; }
// Output delays on leaf_pin.
OutputDelaySet *outputDelaysLeafPin(const Pin *leaf_pin);
bool hasOutputDelay(const Pin *leaf_pin) const;
PortExtCap *portExtCap(const Port *port,
const Corner *corner) const;
bool hasPortExtCap(const Port *port) const;
void portExtCap(const Port *port,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max,
// Return values.
float &pin_cap,
bool &has_pin_cap,
float &wire_cap,
bool &has_wire_cap,
int &fanout,
bool &has_fanout) const;
float portExtCap(const Port *port,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max) const;
// Connected total capacitance.
// pin_cap = pin capacitance + port external pin
// wire_cap = port external wire capacitance + net wire capacitance
void connectedCap(const Pin *pin,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max,
float &pin_cap,
float &wire_cap,
float &fanout,
bool &has_net_load) const;
void pinCaps(const Pin *pin,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max,
float &pin_cap,
float &wire_cap,
float &fanout) const;
void portExtFanout(const Port *port,
const Corner *corner,
const MinMax *min_max,
// Return values.
int &fanout,
bool &exists);
int portExtFanout(Port *port,
const Corner *corner,
const MinMax *min_max);
// Return true if search should proceed from pin/clk (no false paths
// start at pin/clk). When thru is true, consider -thru exceptions
// that start at pin/net/instance also). Transition tr applies to
// pin, not clk.
bool exceptionFromStates(const Pin *pin,
const RiseFall *rf,
const Clock *clk,
const RiseFall *clk_rf,
const MinMax *min_max,
ExceptionStateSet *&states) const;
bool exceptionFromStates(const Pin *pin,
const RiseFall *rf,
const Clock *clk,
const RiseFall *clk_rf,
const MinMax *min_max,
bool include_filter,
ExceptionStateSet *&states) const;
void exceptionFromClkStates(const Pin *pin,
const RiseFall *rf,
const Clock *clk,
const RiseFall *clk_rf,
const MinMax *min_max,
ExceptionStateSet *&states) const;
void filterRegQStates(const Pin *to_pin,
const RiseFall *to_rf,
const MinMax *min_max,
ExceptionStateSet *&states) const;
// Return hierarchical -thru exceptions that start between
// from_pin and to_pin.
void exceptionThruStates(const Pin *from_pin,
const Pin *to_pin,
const RiseFall *to_rf,
const MinMax *min_max,
ExceptionStateSet *&states) const;
// Find the highest priority exception with first exception pt at
// pin/clk end.
void exceptionTo(ExceptionPathType type,
const Pin *pin,
const RiseFall *rf,
const ClockEdge *clk_edge,
const MinMax *min_max,
bool match_min_max_exactly,
// Return values.
ExceptionPath *&hi_priority_exception,
int &hi_priority) const;
bool exceptionMatchesTo(ExceptionPath *exception,
const Pin *pin,
const RiseFall *rf,
const ClockEdge *clk_edge,
const MinMax *min_max,
bool match_min_max_exactly,
bool require_to_pin) const;
void groupPathsTo(const Pin *pin,