Skip to content

Commit

Permalink
TimingArcSet attrs
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Jun 25, 2022
1 parent c230ba0 commit 74bc7af
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 51 deletions.
18 changes: 6 additions & 12 deletions include/sta/TimingArc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,19 @@ public:
void deleteTimingArc(TimingArc *arc);
TimingArc *findTimingArc(unsigned arc_index);
void setRole(TimingRole *role);
FuncExpr *cond() const { return cond_; }
FuncExpr *cond() const { return attrs_->cond(); }
// Cond default is the timing arcs with no condition when there are
// other conditional timing arcs between the same pins.
bool isCondDefault() const { return is_cond_default_; }
void setIsCondDefault(bool is_default);
// SDF IOPATHs match sdfCond.
// sdfCond (IOPATH) reuses sdfCondStart (timing check) variable.
const char *sdfCond() const { return sdf_cond_start_; }
const char *sdfCond() const { return attrs_->sdfCondStart(); }
// SDF timing checks match sdfCondStart/sdfCondEnd.
const char *sdfCondStart() const { return sdf_cond_start_; }
const char *sdfCondEnd() const { return sdf_cond_end_; }
const char *modeName() const { return mode_name_; }
const char *modeValue() const { return mode_value_; }
const char *sdfCondStart() const { return attrs_->sdfCondStart(); }
const char *sdfCondEnd() const { return attrs_->sdfCondEnd(); }
const char *modeName() const { return attrs_->modeName(); }
const char *modeValue() const { return attrs_->modeValue(); }
// Timing arc set index in cell.
TimingArcIndex index() const { return index_; }
bool isDisabledConstraint() const { return is_disabled_constraint_; }
Expand Down Expand Up @@ -203,13 +203,7 @@ protected:
TimingRole *role_;
TimingArcAttrs *attrs_;
TimingArcSeq arcs_;
FuncExpr *cond_;
bool is_cond_default_;
const char *sdf_cond_start_;
const char *sdf_cond_end_;
const char *mode_name_;
const char *mode_value_;
float ocv_arc_depth_;
unsigned index_;
bool is_disabled_constraint_;
TimingArc *from_arc1_[RiseFall::index_count];
Expand Down
34 changes: 14 additions & 20 deletions liberty/LibertyReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3925,38 +3925,32 @@ LibertyReader::makeTable(LibertyAttr *attr,
FloatTable *table = makeFloatTable(attr,
axis_[0]->size()*axis_[1]->size(),
axis_[2]->size(), scale);
if (table)
table_ = new Table3(table,
axis_[0], own_axis_[0],
axis_[1], own_axis_[1],
axis_[2], own_axis_[2]);
table_ = new Table3(table,
axis_[0], own_axis_[0],
axis_[1], own_axis_[1],
axis_[2], own_axis_[2]);
}
else if (axis_[0] && axis_[1]) {
// Row variable1/axis[0]
// Column variable2/axis[1]
FloatTable *table = makeFloatTable(attr, axis_[0]->size(),
axis_[1]->size(), scale);
if (table)
table_ = new Table2(table,
axis_[0], own_axis_[0],
axis_[1], own_axis_[1]);
table_ = new Table2(table,
axis_[0], own_axis_[0],
axis_[1], own_axis_[1]);
}
else if (axis_[0]) {
FloatTable *table = makeFloatTable(attr, 1, axis_[0]->size(), scale);
if (table) {
FloatSeq *values = (*table)[0];
delete table;
table_ = new Table1(values, axis_[0], own_axis_[0]);
}
FloatSeq *values = (*table)[0];
delete table;
table_ = new Table1(values, axis_[0], own_axis_[0]);
}
else {
FloatTable *table = makeFloatTable(attr, 1, 1, scale);
if (table) {
float value = (*(*table)[0])[0];
delete (*table)[0];
delete table;
table_ = new Table0(value);
}
float value = (*(*table)[0])[0];
delete (*table)[0];
delete table;
table_ = new Table0(value);
}
}
else
Expand Down
25 changes: 6 additions & 19 deletions liberty/TimingArc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ TimingArcAttrs::setSdfCond(const char *cond)
{
stringDelete(sdf_cond_);
sdf_cond_ = stringCopy(cond);
sdf_cond_start_ = sdf_cond_end_ = sdf_cond_;
}

void
Expand Down Expand Up @@ -184,20 +185,10 @@ TimingArcSet::TimingArcSet(LibertyCell *cell,
related_out_(related_out),
role_(role),
attrs_(attrs),
cond_(attrs->cond()),
is_cond_default_(false),
sdf_cond_start_(attrs->sdfCondStart()),
sdf_cond_end_(attrs->sdfCondEnd()),
mode_name_(attrs->modeName()),
mode_value_(attrs->modeValue()),
ocv_arc_depth_(attrs->ocvArcDepth()),
index_(0),
is_disabled_constraint_(false)
{
const char *sdf_cond = attrs->sdfCond();
if (sdf_cond)
sdf_cond_start_ = sdf_cond_end_ = sdf_cond;

init(cell);
}

Expand All @@ -208,12 +199,7 @@ TimingArcSet::TimingArcSet(TimingRole *role,
related_out_(nullptr),
role_(role),
attrs_(attrs),
cond_(nullptr),
is_cond_default_(false),
sdf_cond_start_(nullptr),
sdf_cond_end_(nullptr),
mode_name_(nullptr),
mode_value_(nullptr),
index_(0),
is_disabled_constraint_(false)
{
Expand Down Expand Up @@ -363,15 +349,16 @@ float
TimingArcSet::ocvArcDepth() const
{
if (from_) {
if (ocv_arc_depth_ != 0.0)
return ocv_arc_depth_;
float depth = attrs_->ocvArcDepth();
if (depth != 0.0)
return depth;
else {
LibertyCell *cell = from_->libertyCell();
float depth = cell->ocvArcDepth();
depth = cell->ocvArcDepth();
if (depth != 0.0)
return depth;
else {
float depth = cell->libertyLibrary()->ocvArcDepth();
depth = cell->libertyLibrary()->ocvArcDepth();
if (depth != 0.0)
return depth;
}
Expand Down

0 comments on commit 74bc7af

Please sign in to comment.