forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sta.hh
1434 lines (1384 loc) · 50.5 KB
/
Sta.hh
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) 2023, 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/>.
#pragma once
#include <string>
#include "StringSeq.hh"
#include "LibertyClass.hh"
#include "NetworkClass.hh"
#include "SdcClass.hh"
#include "GraphClass.hh"
#include "ParasiticsClass.hh"
#include "StaState.hh"
#include "VertexVisitor.hh"
#include "SearchClass.hh"
#include "PowerClass.hh"
struct Tcl_Interp;
namespace sta {
using std::string;
using ::Tcl_Interp;
// Don't include headers to minimize dependencies.
class MinMax;
class MinMaxAll;
class RiseFallBoth;
class RiseFall;
class ReportPath;
class CheckTiming;
class DcalcAnalysisPt;
class CheckSlewLimits;
class CheckFanoutLimits;
class CheckCapacitanceLimits;
class CheckMinPulseWidths;
class CheckMinPeriods;
class CheckMaxSkews;
class PatternMatch;
class CheckPeriods;
class LibertyReader;
class SearchPred;
class Corner;
class ClkSkews;
class ReportField;
class Power;
class PowerResult;
class EquivCells;
typedef InstanceSeq::Iterator SlowDrvrIterator;
typedef Vector<const char*> CheckError;
typedef Vector<CheckError*> CheckErrorSeq;
typedef Vector<Corner*> CornerSeq;
enum class CmdNamespace { sta, sdc };
// Initialize sta functions that are not part of the Sta class.
void initSta();
// Call before exit to make leak detection simpler for purify and valgrind.
void
deleteAllMemory();
// The Lord, God, King, Master of the Timing Universe.
// This class is a FACADE used to present an API to the collection of
// objects that hold the collective state of the static timing analyzer.
// It should only hold pointers to objects so that only the referenced
// class declarations and not their definitions are needed by this header.
//
// The report object is not owned by the sta object.
class Sta : public StaState
{
public:
Sta();
// The Sta is a FACTORY for the components.
// makeComponents calls the make{Component} virtual functions.
// Ideally this would be called by the Sta constructor, but a
// virtual function called in a base class constructor does not
// call the derived class function.
virtual void makeComponents();
// Call copyState for each component to notify it that some
// pointers to some components have changed.
// This must be called after changing any of the StaState components.
virtual void updateComponentsState();
virtual ~Sta();
// Singleton accessor used by tcl command interpreter.
static Sta *sta();
static void setSta(Sta *sta);
// Default number of threads to use.
virtual int defaultThreadCount() const;
void setThreadCount(int thread_count);
virtual LibertyLibrary *readLiberty(const char *filename,
Corner *corner,
const MinMaxAll *min_max,
bool infer_latches);
bool setMinLibrary(const char *min_filename,
const char *max_filename);
// Network readers call this to notify the Sta to delete any previously
// linked network.
void readNetlistBefore();
// Return true if successful.
bool linkDesign(const char *top_cell_name);
bool linkMakeBlackBoxes() const;
void setLinkMakeBlackBoxes(bool make);
// SDC Swig API.
Instance *currentInstance() const;
void setCurrentInstance(Instance *inst);
virtual void setAnalysisType(AnalysisType analysis_type);
void setOperatingConditions(OperatingConditions *op_cond,
const MinMaxAll *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);
void unsetTimingDerate();
void setInputSlew(const Port *port,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float slew);
// Set port external pin load (set_load -pin port).
void setPortExtPinCap(const Port *port,
const RiseFallBoth *rf,
const Corner *corner,
const MinMaxAll *min_max,
float cap);
void portExtCaps(const Port *port,
const Corner *corner,
const MinMax *min_max,
float &pin_cap,
float &wire_cap,
int &fanout);
// Set port external wire load (set_load -wire port).
void setPortExtWireCap(const Port *port,
bool subtract_pin_cap,
const RiseFallBoth *rf,
const Corner *corner,
const MinMaxAll *min_max,
float cap);
// Set net wire capacitance (set_load -wire net).
void setNetWireCap(const Net *net,
bool subtract_pin_load,
const Corner *corner,
const MinMaxAll *min_max,
float cap);
// Remove all "set_load net" annotations.
void removeNetLoadCaps() const;
// Set port external fanout (used by wireload models).
void setPortExtFanout(const Port *port,
int fanout,
const Corner *corner,
const MinMaxAll *min_max);
// Liberty port capacitance.
float capacitance(const LibertyPort *port,
Corner *corner,
const MinMax *min_max);
// pin_cap = net pin capacitances + port external pin capacitance,
// wire_cap = annotated net capacitance + port external wire capacitance.
void connectedCap(const Pin *drvr_pin,
const RiseFall *rf,
const Corner *corner,
const MinMax *min_max,
float &pin_cap,
float &wire_cap) const;
void connectedCap(const Net *net,
Corner *corner,
const MinMax *min_max,
float &pin_cap,
float &wire_cap) const;
void setResistance(const Net *net,
const MinMaxAll *min_max,
float res);
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 setDriveResistance(const Port *port,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float res);
void setLatchBorrowLimit(const Pin *pin,
float limit);
void setLatchBorrowLimit(const Instance *inst,
float limit);
void setLatchBorrowLimit(const Clock *clk,
float limit);
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);
void setWireload(Wireload *wireload,
const MinMaxAll *min_max);
void setWireloadMode(WireloadMode mode);
void setWireloadSelection(WireloadSelection *selection,
const MinMaxAll *min_max);
void setSlewLimit(Clock *clk,
const RiseFallBoth *rf,
const PathClkOrData clk_data,
const MinMax *min_max,
float slew);
void setSlewLimit(Port *port,
const MinMax *min_max,
float slew);
void setSlewLimit(Cell *cell,
const MinMax *min_max,
float slew);
void setCapacitanceLimit(Cell *cell,
const MinMax *min_max,
float cap);
void setCapacitanceLimit(Port *port,
const MinMax *min_max,
float cap);
void setCapacitanceLimit(Pin *pin,
const MinMax *min_max,
float cap);
void setFanoutLimit(Cell *cell,
const MinMax *min_max,
float fanout);
void setFanoutLimit(Port *port,
const MinMax *min_max,
float fanout);
void setMaxArea(float area);
void makeClock(const char *name,
PinSet *pins,
bool add_to_pins,
float period,
FloatSeq *waveform,
char *comment);
// edges size must be 3.
void 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,
char *comment);
void removeClock(Clock *clk);
// Update period/waveform for generated clocks from source pin clock.
void updateGeneratedClks();
// True if pin is defined as a clock source (pin may be hierarchical).
bool isClockSrc(const Pin *pin) const;
// Propagated (non-ideal) clocks.
void setPropagatedClock(Clock *clk);
void removePropagatedClock(Clock *clk);
void setPropagatedClock(Pin *pin);
void removePropagatedClock(Pin *pin);
void setClockSlew(Clock *clock,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float slew);
void removeClockSlew(Clock *clk);
// Clock latency.
// 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);
// Clock insertion delay (source latency).
void setClockInsertion(const Clock *clk,
const Pin *pin,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
const EarlyLateAll *early_late,
float delay);
void removeClockInsertion(const Clock *clk,
const Pin *pin);
// Clock uncertainty.
virtual void setClockUncertainty(Clock *clk,
const SetupHoldAll *setup_hold,
float uncertainty);
virtual void removeClockUncertainty(Clock *clk,
const SetupHoldAll *setup_hold);
virtual void setClockUncertainty(Pin *pin,
const SetupHoldAll *setup_hold,
float uncertainty);
virtual void removeClockUncertainty(Pin *pin,
const SetupHoldAll *setup_hold);
// Inter-clock uncertainty.
virtual void setClockUncertainty(Clock *from_clk,
const RiseFallBoth *from_rf,
Clock *to_clk,
const RiseFallBoth *to_rf,
const SetupHoldAll *setup_hold,
float uncertainty);
virtual 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);
// nullptr name removes all.
void removeClockGroupsLogicallyExclusive(const char *name);
void removeClockGroupsPhysicallyExclusive(const char *name);
void removeClockGroupsAsynchronous(const char *name);
void makeClockGroup(ClockGroups *clk_groups,
ClockSet *clks);
void setClockSense(PinSet *pins,
ClockSet *clks,
ClockSense sense);
void setClockGatingCheck(const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin);
void setClockGatingCheck(Clock *clk,
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(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);
// 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.
// Hierarchical instances 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(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);
// Edge is disabled by constant.
bool isDisabledConstant(Edge *edge);
// Edge is default cond disabled by timing_disable_cond_default_arcs var.
bool isDisabledCondDefault(Edge *edge);
// Edge is disabled to prpath a clock from propagating.
bool isDisabledClock(Edge *edge);
// Return a set of constant pins that disabled edge.
// Caller owns the returned set.
PinSet disabledConstantPins(Edge *edge);
// Edge timing sense with propagated constants.
TimingSense simTimingSense(Edge *edge);
// Edge is disabled by set_disable_timing constraint.
bool isDisabledConstraint(Edge *edge);
// Edge is disabled to break combinational loops.
bool isDisabledLoop(Edge *edge) const;
// Edge is disabled internal bidirect output path.
bool isDisabledBidirectInstPath(Edge *edge) const;
// Edge is disabled bidirect net path.
bool isDisabledBidirectNetPath(Edge *edge) const;
bool isDisabledPresetClr(Edge *edge) const;
// Return a vector of graph edges that are disabled, sorted by
// from/to vertex names. Caller owns the returned vector.
EdgeSeq disabledEdges();
EdgeSeq disabledEdgesSorted();
void disableClockGatingCheck(Instance *inst);
void disableClockGatingCheck(Pin *pin);
void removeDisableClockGatingCheck(Instance *inst);
void removeDisableClockGatingCheck(Pin *pin);
void setLogicValue(Pin *pin,
LogicValue value);
void setCaseAnalysis(Pin *pin,
LogicValue value);
void removeCaseAnalysis(Pin *pin);
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_rf,
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);
void makeFalsePath(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max,
const char *comment);
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,
float delay,
const char *comment);
void makeGroupPath(const char *name,
bool is_default,
ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const char *comment);
bool isGroupPathName(const char *group_name);
void resetPath(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max);
// Make an exception -from specification.
ExceptionFrom *makeExceptionFrom(PinSet *from_pins,
ClockSet *from_clks,
InstanceSet *from_insts,
const RiseFallBoth *from_rf);
void checkExceptionFromPins(ExceptionFrom *from,
const char *file,
int line) const;
bool exceptionFromInvalid(const Pin *pin) const;
void deleteExceptionFrom(ExceptionFrom *from);
// Make an exception -through specification.
ExceptionThru *makeExceptionThru(PinSet *pins,
NetSet *nets,
InstanceSet *insts,
const RiseFallBoth *rf);
void deleteExceptionThru(ExceptionThru *thru);
// Make an exception -to specification.
ExceptionTo *makeExceptionTo(PinSet *to_pins,
ClockSet *to_clks,
InstanceSet *to_insts,
const RiseFallBoth *rf,
RiseFallBoth *end_rf);
void checkExceptionToPins(ExceptionTo *to,
const char *file, int) const;
void deleteExceptionTo(ExceptionTo *to);
InstanceSet findRegisterInstances(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool edge_triggered,
bool latches);
PinSet findRegisterDataPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
bool latches);
PinSet findRegisterClkPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
bool latches);
PinSet findRegisterAsyncPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
bool latches);
PinSet findRegisterOutputPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
bool latches);
PinSet findFaninPins(PinSeq *to,
bool flat,
bool startpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
bool thru_constants);
InstanceSet
findFaninInstances(PinSeq *to,
bool flat,
bool startpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
bool thru_constants);
PinSet
findFanoutPins(PinSeq *from,
bool flat,
bool endpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
bool thru_constants);
InstanceSet
findFanoutInstances(PinSeq *from,
bool flat,
bool endpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
bool thru_constants);
// The set of clocks that arrive at vertex in the clock network.
ClockSet clocks(const Pin *pin);
// Clock domains for a pin.
ClockSet clockDomains(const Pin *pin);
void checkSlewLimitPreamble();
// Return pins with the min/max slew limit slack.
// net=null check all nets
// corner=nullptr checks all corners.
PinSeq checkSlewLimits(Net *net,
bool violators,
const Corner *corner,
const MinMax *min_max);
void reportSlewLimitShortHeader();
void reportSlewLimitShort(Pin *pin,
const Corner *corner,
const MinMax *min_max);
void reportSlewLimitVerbose(Pin *pin,
const Corner *corner,
const MinMax *min_max);
// requires checkSlewLimitPreamble()
void checkSlew(const Pin *pin,
const Corner *corner,
const MinMax *min_max,
bool check_clks,
// Return values.
const Corner *&corner1,
const RiseFall *&tr,
Slew &slew,
float &limit,
float &slack);
void maxSlewCheck(// Return values.
const Pin *&pin,
Slew &slew,
float &slack,
float &limit);
void findSlewLimit(const LibertyPort *port,
const Corner *corner,
const MinMax *min_max,
// Return values.
float &limit,
bool &exists);
void checkFanoutLimitPreamble();
// Return pins with the min/max fanout limit slack.
// net=null check all nets
// corner=nullptr checks all corners.
PinSeq checkFanoutLimits(Net *net,
bool violators,
const MinMax *min_max);
void reportFanoutLimitShortHeader();
void reportFanoutLimitShort(Pin *pin,
const MinMax *min_max);
void reportFanoutLimitVerbose(Pin *pin,
const MinMax *min_max);
// requires checkFanoutLimitPreamble()
void checkFanout(const Pin *pin,
const MinMax *min_max,
// Return values.
float &fanout,
float &limit,
float &slack);
void maxFanoutCheck(// Return values.
const Pin *&pin,
float &fanout,
float &slack,
float &limit);
void checkCapacitanceLimitPreamble();
// Return pins with the min/max slew limit slack.
// net=null check all nets
// corner=nullptr checks all corners.
PinSeq checkCapacitanceLimits(Net *net,
bool violators,
const Corner *corner,
const MinMax *min_max);
void reportCapacitanceLimitShortHeader();
void reportCapacitanceLimitShort(Pin *pin,
const Corner *corner,
const MinMax *min_max);
void reportCapacitanceLimitVerbose(Pin *pin,
const Corner *corner,
const MinMax *min_max);
// requires checkCapacitanceLimitPreamble()
void checkCapacitance(const Pin *pin,
const Corner *corner,
const MinMax *min_max,
// Return values.
const Corner *&corner1,
const RiseFall *&tr,
float &capacitance,
float &limit,
float &slack);
void maxCapacitanceCheck(// Return values.
const Pin *&pin,
float &capacitance,
float &slack,
float &limit);
// Min pulse width check with the least slack.
// corner=nullptr checks all corners.
MinPulseWidthCheck *minPulseWidthSlack(const Corner *corner);
// All violating min pulse width checks.
// corner=nullptr checks all corners.
MinPulseWidthCheckSeq &minPulseWidthViolations(const Corner *corner);
// Min pulse width checks for pins.
// corner=nullptr checks all corners.
MinPulseWidthCheckSeq &minPulseWidthChecks(PinSeq *pins,
const Corner *corner);
// All min pulse width checks.
// corner=nullptr checks all corners.
MinPulseWidthCheckSeq &minPulseWidthChecks(const Corner *corner);
void reportMpwChecks(MinPulseWidthCheckSeq *checks,
bool verbose);
void reportMpwCheck(MinPulseWidthCheck *check,
bool verbose);
// Min period check with the least slack.
MinPeriodCheck *minPeriodSlack();
// All violating min period checks.
MinPeriodCheckSeq &minPeriodViolations();
void reportChecks(MinPeriodCheckSeq *checks,
bool verbose);
void reportCheck(MinPeriodCheck *check,
bool verbose);
// Max skew check with the least slack.
MaxSkewCheck *maxSkewSlack();
// All violating min period checks.
MaxSkewCheckSeq &maxSkewViolations();
void reportChecks(MaxSkewCheckSeq *checks,
bool verbose);
void reportCheck(MaxSkewCheck *check,
bool verbose);
////////////////////////////////////////////////////////////////
// User visible but non SDC commands.
// Instance specific process/voltage/temperature.
// Defaults to operating condition if instance is not annotated.
const Pvt *pvt(Instance *inst,
const MinMax *min_max);
void setPvt(Instance *inst,
const MinMaxAll *min_max,
float process,
float voltage,
float temperature);
// Pvt may be shared among multiple instances.
void setPvt(const Instance *inst,
const MinMaxAll *min_max,
const Pvt &pvt);
// Clear all state except network.
virtual void clear();
// Remove all constraints.
virtual void removeConstraints();
// Notify the sta that the constraints have changed directly rather
// than thru this sta API.
virtual void constraintsChanged();
// Namespace used by command interpreter.
CmdNamespace cmdNamespace();
void setCmdNamespace(CmdNamespace namespc);
OperatingConditions *operatingConditions(const MinMax *min_max) const;
// Set the delay on a timing arc.
// Required/arrival times are incrementally updated.
void setArcDelay(Edge *edge,
TimingArc *arc,
const Corner *corner,
const MinMaxAll *min_max,
ArcDelay delay);
// Set annotated slew on a vertex for delay calculation.
void setAnnotatedSlew(Vertex *vertex,
const Corner *corner,
const MinMaxAll *min_max,
const RiseFallBoth *rf,
float slew);
void writeSdf(const char *filename,
Corner *corner,
char divider,
bool include_typ,
int digits,
bool gzip,
bool no_timestamp,
bool no_version);
// Remove all delay and slew annotations.
void removeDelaySlewAnnotations();
// TCL variable sta_crpr_enabled.
// Common Reconvergent Clock Removal (CRPR).
// Timing check source/target common clock path overlap for search
// with analysis mode on_chip_variation.
bool crprEnabled() const;
void setCrprEnabled(bool enabled);
// TCL variable sta_crpr_mode.
CrprMode crprMode() const;
void setCrprMode(CrprMode mode);
// TCL variable sta_pocv_enabled.
// Parametric on chip variation (statisical sta).
bool pocvEnabled() const;
void setPocvEnabled(bool enabled);
// Number of std deviations from mean to use for normal distributions.
void setSigmaFactor(float factor);
// TCL variable sta_propagate_gated_clock_enable.
// Propagate gated clock enable arrivals.
bool propagateGatedClockEnable() const;
void setPropagateGatedClockEnable(bool enable);
// TCL variable sta_preset_clear_arcs_enabled.
// Enable search through preset/clear arcs.
bool presetClrArcsEnabled() const;
void setPresetClrArcsEnabled(bool enable);
// TCL variable sta_cond_default_arcs_enabled.
// Enable/disable default arcs when conditional arcs exist.
bool condDefaultArcsEnabled() const;
void setCondDefaultArcsEnabled(bool enabled);
// TCL variable sta_internal_bidirect_instance_paths_enabled.
// Enable/disable timing from bidirect pins back into the instance.
bool bidirectInstPathsEnabled() const;
void setBidirectInstPathsEnabled(bool enabled);
// TCL variable sta_bidirect_net_paths_enabled.
// Enable/disable timing from bidirect driver pins to their own loads.
bool bidirectNetPathsEnabled() const;
void setBidirectNetPathsEnabled(bool enabled);
// TCL variable sta_recovery_removal_checks_enabled.
bool recoveryRemovalChecksEnabled() const;
void setRecoveryRemovalChecksEnabled(bool enabled);
// TCL variable sta_gated_clock_checks_enabled.
bool gatedClkChecksEnabled() const;
void setGatedClkChecksEnabled(bool enabled);
// TCL variable sta_dynamic_loop_breaking.
bool dynamicLoopBreaking() const;
void setDynamicLoopBreaking(bool enable);
// TCL variable sta_propagate_all_clocks.
// Clocks defined after sta_propagate_all_clocks is true
// are propagated (existing clocks are not effected).
bool propagateAllClocks() const;
void setPropagateAllClocks(bool prop);
// TCL var sta_clock_through_tristate_enabled.
bool clkThruTristateEnabled() const;
void setClkThruTristateEnabled(bool enable);
// TCL variable sta_input_port_default_clock.
bool useDefaultArrivalClock() const;
void setUseDefaultArrivalClock(bool enable);
virtual CheckErrorSeq &checkTiming(bool no_input_delay,
bool no_output_delay,
bool reg_multiple_clks,
bool reg_no_clks,
bool unconstrained_endpoints,
bool loops,
bool generated_clks);
// Path from/thrus/to filter.
// from/thrus/to are owned and deleted by Search.
// PathEnds in the returned PathEndSeq are owned by Search PathGroups
// and deleted on next call.
virtual PathEndSeq findPathEnds(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
bool unconstrained,
// Use corner nullptr to report timing
// for all corners.
const Corner *corner,
// max for setup checks.
// min for hold checks.
// min_max for setup and hold checks.
const MinMaxAll *min_max,
// Number of path ends to report in
// each group.
int group_count,
// Number of paths to report for
// each endpoint.
int endpoint_count,
// endpoint_count paths report unique pins
// without rise/fall variations.
bool unique_pins,
// Min/max bounds for slack of
// returned path ends.
float slack_min,
float slack_max,
// Sort path ends by slack ignoring path groups.
bool sort_by_slack,
// Path groups to report.
// Null or empty list reports all groups.
PathGroupNameSet *group_names,
// Predicates to filter the type of path
// ends returned.
bool setup,
bool hold,
bool recovery,
bool removal,
bool clk_gating_setup,
bool clk_gating_hold);
void setReportPathFormat(ReportPathFormat format);
void setReportPathFieldOrder(StringSeq *field_names);
void setReportPathFields(bool report_input_pin,
bool report_net,
bool report_cap,
bool report_slew);
ReportField *findReportPathField(const char *name);
void setReportPathDigits(int digits);
void setReportPathNoSplit(bool no_split);
void setReportPathSigmas(bool report_sigmas);
// Report clk skews for clks.
void reportClkSkew(ClockSet *clks,
const Corner *corner,
const SetupHold *setup_hold,
int digits);
float findWorstClkSkew(const SetupHold *setup_hold);
// Header above reportPathEnd results.
void reportPathEndHeader();
// Footer below reportPathEnd results.
void reportPathEndFooter();
// Format report_path_endpoint only:
// Previous path end is used to detect path group changes
// so headers are reported by group.
void reportPathEnd(PathEnd *end,
PathEnd *prev_end);
void reportPathEnd(PathEnd *end);
void reportPathEnds(PathEndSeq *ends);
ReportPath *reportPath() { return report_path_; }
void reportPath(Path *path);
// Update arrival times for all pins.
// If necessary updateTiming propagates arrivals around latch
// loops until the arrivals converge.
// If full=false update arrivals incrementally.
// If full=true update all arrivals from scratch.
// NOTE WELL: There is rarely any reason to call updateTiming directly because
// arrival/required/slack functions implicitly update timing incrementally.
// If you are calling this function you are either very confused or there is
// bug that should be reported.
void updateTiming(bool full);
// Invalidate all delay calculations. Arrivals also invalidated.
void delaysInvalid();
// Invalidate all arrival and required times.
void arrivalsInvalid();
void visitStartpoints(VertexVisitor *visitor);
void visitEndpoints(VertexVisitor *visitor);
VertexSet *endpoints();
int endpointViolationCount(const MinMax *min_max);
// Find the fanin vertices for a group path.
// Vertices in the clock network are NOT included.
PinSet findGroupPathPins(const char *group_path_name);
// Find all required times after updateTiming().
void findRequireds();
string reportDelayCalc(Edge *edge,
TimingArc *arc,
const Corner *corner,
const MinMax *min_max,
int digits);
void writeSdc(const char *filename,
// Map hierarchical pins and instances to leaf pins and instances.
bool leaf,
// Replace non-sdc get functions with OpenSTA equivalents.
bool native,
int digits,
bool gzip,
bool no_timestamp);
// The sum of all negative endpoints slacks.
// Incrementally updated.
Slack totalNegativeSlack(const MinMax *min_max);
Slack totalNegativeSlack(const Corner *corner,
const MinMax *min_max);
// Worst endpoint slack and vertex.
// Incrementally updated.
Slack worstSlack(const MinMax *min_max);
void worstSlack(const MinMax *min_max,
// Return values.
Slack &worst_slack,
Vertex *&worst_vertex);
void worstSlack(const Corner *corner,
const MinMax *min_max,
// Return values.
Slack &worst_slack,
Vertex *&worst_vertex);
VertexPathIterator *vertexPathIterator(Vertex *vertex,
const RiseFall *rf,
const PathAnalysisPt *path_ap);
VertexPathIterator *vertexPathIterator(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
PathRef vertexWorstArrivalPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
PathRef vertexWorstArrivalPath(Vertex *vertex,
const MinMax *min_max);
PathRef vertexWorstRequiredPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
PathRef vertexWorstRequiredPath(Vertex *vertex,
const MinMax *min_max);
PathRef vertexWorstSlackPath(Vertex *vertex,
const MinMax *min_max);
PathRef vertexWorstSlackPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
// Find the min clock period for rise/rise and fall/fall paths of a clock
// using the slack. This does NOT correctly predict min period when there
// are paths between different clocks.
float findClkMinPeriod(const Clock *clk,
bool include_port_paths);
// The following arrival/required/slack functions incrementally
// update timing to the level of the vertex. They do NOT do multiple
// passes required propagate arrivals around latch loops.
// See Sta::updateTiming() to propagate arrivals around latch loops.