forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimingArc.cc
796 lines (724 loc) · 20.3 KB
/
TimingArc.cc
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
// 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/>.
#include "TimingModel.hh"
#include "EnumNameMap.hh"
#include "FuncExpr.hh"
#include "TimingRole.hh"
#include "Liberty.hh"
#include "TimingArc.hh"
namespace sta {
using std::make_shared;
static bool
timingArcsEquiv(const TimingArcSet *set1,
const TimingArcSet *set2);
static bool
timingArcsLess(const TimingArcSet *set1,
const TimingArcSet *set2);
////////////////////////////////////////////////////////////////
TimingArcAttrs::TimingArcAttrs() :
timing_type_(TimingType::combinational),
timing_sense_(TimingSense::unknown),
cond_(nullptr),
sdf_cond_(nullptr),
sdf_cond_start_(nullptr),
sdf_cond_end_(nullptr),
mode_name_(nullptr),
mode_value_(nullptr),
ocv_arc_depth_(0.0),
models_{nullptr, nullptr}
{
}
TimingArcAttrs::TimingArcAttrs(TimingSense sense) :
timing_type_(TimingType::combinational),
timing_sense_(sense),
cond_(nullptr),
sdf_cond_(nullptr),
sdf_cond_start_(nullptr),
sdf_cond_end_(nullptr),
mode_name_(nullptr),
mode_value_(nullptr),
ocv_arc_depth_(0.0),
models_{nullptr, nullptr}
{
}
TimingArcAttrs::~TimingArcAttrs()
{
if (cond_)
cond_->deleteSubexprs();
if (sdf_cond_start_ != sdf_cond_)
stringDelete(sdf_cond_start_);
if (sdf_cond_end_ != sdf_cond_)
stringDelete(sdf_cond_end_);
stringDelete(sdf_cond_);
stringDelete(mode_name_);
stringDelete(mode_value_);
delete models_[RiseFall::riseIndex()];
delete models_[RiseFall::fallIndex()];
}
void
TimingArcAttrs::setTimingType(TimingType type)
{
timing_type_ = type;
}
void
TimingArcAttrs::setTimingSense(TimingSense sense)
{
timing_sense_ = sense;
}
void
TimingArcAttrs::setSdfCond(const char *cond)
{
stringDelete(sdf_cond_);
sdf_cond_ = stringCopy(cond);
sdf_cond_start_ = sdf_cond_end_ = sdf_cond_;
}
void
TimingArcAttrs::setSdfCondStart(const char *cond)
{
stringDelete(sdf_cond_start_);
sdf_cond_start_ = stringCopy(cond);
}
void
TimingArcAttrs::setSdfCondEnd(const char *cond)
{
stringDelete(sdf_cond_end_);
sdf_cond_end_ = stringCopy(cond);
}
void
TimingArcAttrs::setModeName(const char *name)
{
stringDelete(mode_name_);
mode_name_ = stringCopy(name);
}
void
TimingArcAttrs::setModeValue(const char *value)
{
stringDelete(mode_value_);
mode_value_ = stringCopy(value);
}
TimingModel *
TimingArcAttrs::model(const RiseFall *rf) const
{
return models_[rf->index()];
}
void
TimingArcAttrs::setModel(const RiseFall *rf,
TimingModel *model)
{
models_[rf->index()] = model;
}
void
TimingArcAttrs::setOcvArcDepth(float depth)
{
ocv_arc_depth_ = depth;
}
float
TimingArc::driveResistance() const
{
GateTimingModel *model = dynamic_cast<GateTimingModel*>(model_);
if (model)
return model->driveResistance(nullptr);
else
return 0.0;
}
ArcDelay
TimingArc::intrinsicDelay() const
{
GateTimingModel *model = dynamic_cast<GateTimingModel*>(model_);
if (model) {
ArcDelay arc_delay;
Slew slew;
model->gateDelay(nullptr, 0.0, 0.0, 0.0, false, arc_delay, slew);
return arc_delay;
}
else
return 0.0;
}
////////////////////////////////////////////////////////////////
TimingArcAttrsPtr TimingArcSet::wire_timing_arc_attrs_ = nullptr;
TimingArcSet *TimingArcSet::wire_timing_arc_set_ = nullptr;
TimingArcSet::TimingArcSet(LibertyCell *cell,
LibertyPort *from,
LibertyPort *to,
LibertyPort *related_out,
TimingRole *role,
TimingArcAttrsPtr attrs) :
from_(from),
to_(to),
related_out_(related_out),
role_(role),
attrs_(attrs),
is_cond_default_(false),
index_(cell->addTimingArcSet(this)),
is_disabled_constraint_(false),
from_arc1_{nullptr, nullptr},
from_arc2_{nullptr, nullptr},
to_arc_{nullptr, nullptr}
{
}
TimingArcSet::TimingArcSet(TimingRole *role,
TimingArcAttrsPtr attrs) :
from_(nullptr),
to_(nullptr),
related_out_(nullptr),
role_(role),
attrs_(attrs),
is_cond_default_(false),
index_(0),
is_disabled_constraint_(false),
from_arc1_{nullptr, nullptr},
from_arc2_{nullptr, nullptr},
to_arc_{nullptr, nullptr}
{
}
TimingArcSet::~TimingArcSet()
{
arcs_.deleteContents();
}
bool
TimingArcSet::isWire() const
{
return this == wire_timing_arc_set_;
}
LibertyCell *
TimingArcSet::libertyCell() const
{
if (from_)
return from_->libertyCell();
else
// Wire timing arc set.
return nullptr;
}
TimingArcIndex
TimingArcSet::addTimingArc(TimingArc *arc)
{
TimingArcIndex arc_index = arcs_.size();
// Rise/fall to rise/fall.
if (arc_index > RiseFall::index_count * RiseFall::index_count)
criticalError(243, "timing arc max index exceeded\n");
arcs_.push_back(arc);
int from_rf_index = arc->fromEdge()->asRiseFall()->index();
if (from_arc1_[from_rf_index] == nullptr)
from_arc1_[from_rf_index] = arc;
else if (from_arc2_[from_rf_index] == nullptr)
from_arc2_[from_rf_index] = arc;
int to_rf_index = arc->toEdge()->asRiseFall()->index();
to_arc_[to_rf_index] = arc;
return arc_index;
}
void
TimingArcSet::deleteTimingArc(TimingArc *arc)
{
TimingArc *last_arc = arcs_.back();
if (arc == last_arc)
arcs_.pop_back();
else {
last_arc->setIndex(arc->index());
arcs_[arc->index()] = last_arc;
arcs_.pop_back();
}
int from_rf_index = arc->fromEdge()->asRiseFall()->index();
if (from_arc1_[from_rf_index] == arc) {
from_arc1_[from_rf_index] = from_arc2_[from_rf_index];
from_arc2_[from_rf_index] = nullptr;
}
else if (from_arc2_[from_rf_index] == arc)
from_arc2_[from_rf_index] = nullptr;
delete arc;
}
TimingArc *
TimingArcSet::findTimingArc(unsigned arc_index)
{
return arcs_[arc_index];
}
void
TimingArcSet::setRole(TimingRole *role)
{
role_ = role;
}
void
TimingArcSet::setIsCondDefault(bool is_default)
{
is_cond_default_ = is_default;
}
void
TimingArcSet::arcsFrom(const RiseFall *from_rf,
// Return values.
TimingArc *&arc1,
TimingArc *&arc2) const
{
int tr_index = from_rf->index();
arc1 = from_arc1_[tr_index];
arc2 = from_arc2_[tr_index];
}
TimingArc *
TimingArcSet::arcTo(const RiseFall *to_rf) const
{
return to_arc_[to_rf->index()];
}
TimingSense
TimingArcSet::sense() const
{
return attrs_->timingSense();
}
RiseFall *
TimingArcSet::isRisingFallingEdge() const
{
int arc_count = arcs_.size();
if (arc_count == 2) {
RiseFall *from_rf1 = arcs_[0]->fromEdge()->asRiseFall();
RiseFall *from_rf2 = arcs_[1]->fromEdge()->asRiseFall();
if (from_rf1 == from_rf2)
return from_rf1;
}
if (arcs_.size() == 1)
return arcs_[0]->fromEdge()->asRiseFall();
else
return nullptr;
}
void
TimingArcSet::setIsDisabledConstraint(bool is_disabled)
{
is_disabled_constraint_ = is_disabled;
}
float
TimingArcSet::ocvArcDepth() const
{
if (from_) {
float depth = attrs_->ocvArcDepth();
if (depth != 0.0)
return depth;
else {
LibertyCell *cell = from_->libertyCell();
depth = cell->ocvArcDepth();
if (depth != 0.0)
return depth;
else {
depth = cell->libertyLibrary()->ocvArcDepth();
if (depth != 0.0)
return depth;
}
}
}
// Wire timing arc set.
return 1.0;
}
bool
TimingArcSet::equiv(const TimingArcSet *set1,
const TimingArcSet *set2)
{
return LibertyPort::equiv(set1->from(), set2->from())
&& LibertyPort::equiv(set1->to(), set2->to())
&& set1->role() == set2->role()
&& FuncExpr::equiv(set1->cond(), set2->cond())
&& stringEqIf(set1->sdfCond(), set2->sdfCond())
&& stringEqIf(set1->sdfCondStart(), set2->sdfCondStart())
&& stringEqIf(set1->sdfCondEnd(), set2->sdfCondEnd())
&& timingArcsEquiv(set1, set2);
}
static bool
timingArcsEquiv(const TimingArcSet *arc_set1,
const TimingArcSet *arc_set2)
{
const TimingArcSeq &arcs1 = arc_set1->arcs();
const TimingArcSeq &arcs2 = arc_set2->arcs();
if (arcs1.size() != arcs2.size())
return false;
auto arc_itr1 = arcs1.begin(), arc_itr2 = arcs2.begin();
for (;
arc_itr1 != arcs1.end() && arc_itr2 != arcs2.end();
arc_itr1++, arc_itr2++) {
const TimingArc *arc1 = *arc_itr1;
const TimingArc *arc2 = *arc_itr2;
if (!TimingArc::equiv(arc1, arc2))
return false;
}
return true;
}
bool
TimingArcSet::less(const TimingArcSet *set1,
const TimingArcSet *set2)
{
return timingArcSetLess(set1, set2);
}
bool
timingArcSetLess(const TimingArcSet *set1,
const TimingArcSet *set2)
{
LibertyPort *from1 = set1->from();
LibertyPort *from2 = set2->from();
if (LibertyPort::equiv(from1, from2)) {
LibertyPort *to1 = set1->to();
LibertyPort *to2 = set2->to();
if (LibertyPort::equiv(to1, to2)) {
TimingRole *role1 = set1->role();
TimingRole *role2 = set2->role();
if (role1 == role2) {
const FuncExpr *cond1 = set1->cond();
const FuncExpr *cond2 = set2->cond();
if (FuncExpr::equiv(cond1, cond2)) {
const char *sdf_cond1 = set1->sdfCond();
const char *sdf_cond2 = set2->sdfCond();
if (stringEqIf(sdf_cond1, sdf_cond2)) {
const char *sdf_cond_start1 = set1->sdfCondStart();
const char *sdf_cond_start2 = set2->sdfCondStart();
if (stringEqIf(sdf_cond_start1, sdf_cond_start2)) {
const char *sdf_cond_end1 = set1->sdfCondEnd();
const char *sdf_cond_end2 = set2->sdfCondEnd();
if (stringEqIf(sdf_cond_end1, sdf_cond_end2)) {
const char *mode_name1 = set1->modeName();
const char *mode_name2 = set2->modeName();
if (stringEqIf(mode_name1, mode_name2)) {
const char *mode_value1 = set1->modeValue();
const char *mode_value2 = set2->modeValue();
if (stringEqIf(mode_value1, mode_value2))
return timingArcsLess(set1, set2);
else
return stringLessIf(mode_value1, mode_value2);
}
else
return stringLessIf(mode_name1, mode_name2);
}
else
return stringLessIf(sdf_cond_end1, sdf_cond_end2);
}
else
return stringLessIf(sdf_cond_start1, sdf_cond_start2);
}
else
return stringLessIf(sdf_cond1, sdf_cond2);
}
else
return FuncExpr::less(cond1, cond2);
}
else
return TimingRole::less(role1, role2);
}
else
return LibertyPort::less(to1, to2);
}
else
return LibertyPort::less(from1, from2);
}
static bool
timingArcsLess(const TimingArcSet *arc_set1,
const TimingArcSet *arc_set2)
{
const TimingArcSeq &arcs1 = arc_set1->arcs();
const TimingArcSeq &arcs2 = arc_set2->arcs();
if (arcs1.size() < arcs2.size())
return true;
if (arcs1.size() > arcs2.size())
return false;
auto arc_itr1 = arcs1.begin(), arc_itr2 = arcs2.begin();
for (;
arc_itr1 != arcs1.end() && arc_itr2 != arcs2.end();
arc_itr1++, arc_itr2++) {
const TimingArc *arc1 = *arc_itr1;
const TimingArc *arc2 = *arc_itr2;
int from_index1 = arc1->fromEdge()->index();
int from_index2 = arc2->fromEdge()->index();
if (from_index1 < from_index2)
return true;
if (from_index1 > from_index2)
return false;
// from_index1 == from_index2
int to_index1 = arc1->toEdge()->index();
int to_index2 = arc2->toEdge()->index();
if (to_index1 < to_index2)
return true;
if (to_index1 > to_index2)
return false;
// Continue if arc transitions are equal.
}
return false;
}
////////////////////////////////////////////////////////////////
int
TimingArcSet::wireArcIndex(const RiseFall *rf)
{
return rf->index();
}
void
TimingArcSet::init()
{
wire_timing_arc_attrs_ = make_shared<TimingArcAttrs>(TimingSense::positive_unate);
wire_timing_arc_set_ = new TimingArcSet(TimingRole::wire(), wire_timing_arc_attrs_);
new TimingArc(wire_timing_arc_set_, Transition::rise(),
Transition::rise(), nullptr);
new TimingArc(wire_timing_arc_set_, Transition::fall(),
Transition::fall(), nullptr);
}
void
TimingArcSet::destroy()
{
delete wire_timing_arc_set_;
wire_timing_arc_set_ = nullptr;
wire_timing_arc_attrs_ = nullptr;
}
////////////////////////////////////////////////////////////////
TimingArc::TimingArc(TimingArcSet *set,
Transition *from_rf,
Transition *to_rf,
TimingModel *model) :
set_(set),
from_rf_(from_rf),
to_rf_(to_rf),
model_(model),
scaled_models_(nullptr)
{
index_ = set->addTimingArc(this);
}
TimingArc::~TimingArc()
{
// The models referenced by scaled_models_ are owned by the scaled
// cells and are deleted by ~LibertyCell.
delete scaled_models_;
}
TimingModel *
TimingArc::model(const OperatingConditions *op_cond) const
{
if (scaled_models_) {
TimingModel *model = scaled_models_->findKey(op_cond);
if (model)
return model;
else
return model_;
}
else
return model_;
}
void
TimingArc::addScaledModel(const OperatingConditions *op_cond,
TimingModel *scaled_model)
{
if (scaled_models_ == nullptr)
scaled_models_ = new ScaledTimingModelMap;
(*scaled_models_)[op_cond] = scaled_model;
}
bool
TimingArc::equiv(const TimingArc *arc1,
const TimingArc *arc2)
{
return arc1->fromEdge() == arc2->fromEdge()
&& arc1->toEdge() == arc2->toEdge();
}
void
TimingArc::setIndex(unsigned index)
{
index_ = index;
}
const TimingArc *
TimingArc::cornerArc(int ap_index) const
{
if (ap_index < static_cast<int>(corner_arcs_.size())) {
TimingArc *corner_arc = corner_arcs_[ap_index];
if (corner_arc)
return corner_arc;
}
return this;
}
void
TimingArc::setCornerArc(TimingArc *corner_arc,
int ap_index)
{
if (ap_index >= static_cast<int>(corner_arcs_.size()))
corner_arcs_.resize(ap_index + 1);
corner_arcs_[ap_index] = corner_arc;
}
////////////////////////////////////////////////////////////////
TimingSense
TimingArc::sense() const
{
if ((from_rf_ == Transition::rise()
&& to_rf_ == Transition::rise())
|| (from_rf_ == Transition::fall()
&& to_rf_ == Transition::fall()))
return TimingSense::positive_unate;
else if ((from_rf_ == Transition::rise()
&& to_rf_ == Transition::fall())
|| (from_rf_ == Transition::fall()
&& to_rf_ == Transition::rise()))
return TimingSense::negative_unate;
else
return TimingSense::non_unate;
}
static EnumNameMap<TimingSense> timing_sense_name_map =
{{TimingSense::positive_unate, "positive_unate"},
{TimingSense::negative_unate, "negative_unate"},
{TimingSense::non_unate, "non_unate"},
{TimingSense::none, "none"},
{TimingSense::unknown, "unknown"}
};
const char *
timingSenseString(TimingSense sense)
{
return timing_sense_name_map.find(sense);
}
TimingSense
timingSenseOpposite(TimingSense sense)
{
switch (sense) {
case TimingSense::positive_unate:
return TimingSense::negative_unate;
case TimingSense::negative_unate:
return TimingSense::positive_unate;
case TimingSense::non_unate:
return TimingSense::non_unate;
case TimingSense::unknown:
return TimingSense::unknown;
case TimingSense::none:
return TimingSense::none;
}
// Prevent warnings from lame compilers.
return TimingSense::unknown;
}
////////////////////////////////////////////////////////////////
// Same order as enum TimingType.
EnumNameMap<TimingType> timing_type_name_map =
{{TimingType::clear, "clear"},
{TimingType::combinational, "combinational"},
{TimingType::combinational_fall, "combinational_fall"},
{TimingType::combinational_rise, "combinational_rise"},
{TimingType::falling_edge, "falling_edge"},
{TimingType::hold_falling, "hold_falling"},
{TimingType::hold_rising, "hold_rising"},
{TimingType::min_pulse_width, "min_pulse_width"},
{TimingType::minimum_period, "minimum_period"},
{TimingType::nochange_high_high, "nochange_high_high"},
{TimingType::nochange_high_low, "nochange_high_low"},
{TimingType::nochange_low_high, "nochange_low_high"},
{TimingType::nochange_low_low, "nochange_low_low"},
{TimingType::non_seq_hold_falling, "non_seq_hold_falling"},
{TimingType::non_seq_hold_rising, "non_seq_hold_rising"},
{TimingType::non_seq_setup_falling, "non_seq_setup_falling"},
{TimingType::non_seq_setup_rising, "non_seq_setup_rising"},
{TimingType::preset, "preset"},
{TimingType::recovery_falling, "recovery_falling"},
{TimingType::recovery_rising, "recovery_rising"},
{TimingType::removal_falling, "removal_falling"},
{TimingType::removal_rising, "removal_rising"},
{TimingType::retaining_time, "retaining_time"},
{TimingType::rising_edge, "rising_edge"},
{TimingType::setup_falling, "setup_falling"},
{TimingType::setup_rising, "setup_rising"},
{TimingType::skew_falling, "skew_falling"},
{TimingType::skew_rising, "skew_rising"},
{TimingType::three_state_disable, "three_state_disable"},
{TimingType::three_state_disable_fall, "three_state_disable_fall"},
{TimingType::three_state_disable_rise, "three_state_disable_rise"},
{TimingType::three_state_enable, "three_state_enable"},
{TimingType::three_state_enable_fall, "three_state_enable_fall"},
{TimingType::three_state_enable_rise, "three_state_enable_rise"},
{TimingType::min_clock_tree_path, "min_clock_tree_path"},
{TimingType::max_clock_tree_path, "max_clock_tree_path"},
{TimingType::unknown, "unknown"}
};
const char *
timingTypeString(TimingType type)
{
return timing_type_name_map.find(type);
}
TimingType
findTimingType(const char *type_name)
{
return timing_type_name_map.find(type_name, TimingType::unknown);
}
bool
timingTypeIsCheck(TimingType type)
{
switch (type) {
case TimingType::hold_falling:
case TimingType::hold_rising:
case TimingType::min_pulse_width:
case TimingType::minimum_period:
case TimingType::nochange_high_high:
case TimingType::nochange_high_low:
case TimingType::nochange_low_high:
case TimingType::nochange_low_low:
case TimingType::non_seq_hold_falling:
case TimingType::non_seq_hold_rising:
case TimingType::non_seq_setup_falling:
case TimingType::non_seq_setup_rising:
case TimingType::recovery_falling:
case TimingType::recovery_rising:
case TimingType::removal_falling:
case TimingType::removal_rising:
case TimingType::retaining_time:
case TimingType::setup_falling:
case TimingType::setup_rising:
case TimingType::skew_falling:
case TimingType::skew_rising:
return true;
default:
return false;
}
}
ScaleFactorType
timingTypeScaleFactorType(TimingType type)
{
switch (type) {
case TimingType::non_seq_setup_falling:
case TimingType::non_seq_setup_rising:
case TimingType::setup_falling:
case TimingType::setup_rising:
return ScaleFactorType::setup;
case TimingType::hold_falling:
case TimingType::hold_rising:
case TimingType::non_seq_hold_falling:
case TimingType::non_seq_hold_rising:
return ScaleFactorType::hold;
case TimingType::recovery_falling:
case TimingType::recovery_rising:
return ScaleFactorType::recovery;
case TimingType::removal_falling:
case TimingType::removal_rising:
return ScaleFactorType::removal;
case TimingType::skew_falling:
case TimingType::skew_rising:
return ScaleFactorType::skew;
case TimingType::minimum_period:
return ScaleFactorType::min_period;
case TimingType::nochange_high_high:
case TimingType::nochange_high_low:
case TimingType::nochange_low_high:
case TimingType::nochange_low_low:
return ScaleFactorType::nochange;
case TimingType::min_pulse_width:
return ScaleFactorType::min_pulse_width;
case TimingType::clear:
case TimingType::combinational:
case TimingType::combinational_fall:
case TimingType::combinational_rise:
case TimingType::falling_edge:
case TimingType::preset:
case TimingType::retaining_time:
case TimingType::rising_edge:
case TimingType::three_state_disable:
case TimingType::three_state_disable_fall:
case TimingType::three_state_disable_rise:
case TimingType::three_state_enable:
case TimingType::three_state_enable_fall:
case TimingType::three_state_enable_rise:
case TimingType::min_clock_tree_path:
case TimingType::max_clock_tree_path:
return ScaleFactorType::cell;
case TimingType::unknown:
return ScaleFactorType::unknown;
}
return ScaleFactorType::unknown;
}
} // namespace