range iterators
This commit is contained in:
parent
73fb94a2dd
commit
9d93130ff2
|
|
@ -148,9 +148,7 @@ GraphDelayCalc::minPeriod(const Pin *pin,
|
||||||
{
|
{
|
||||||
exists = false;
|
exists = false;
|
||||||
const MinMax *min_max = MinMax::max();
|
const MinMax *min_max = MinMax::max();
|
||||||
DcalcAnalysisPtIterator dcalc_ap_iter(this);
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
while (dcalc_ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = dcalc_ap_iter.next();
|
|
||||||
// Sdf annotation.
|
// Sdf annotation.
|
||||||
float min_period1 = 0.0;
|
float min_period1 = 0.0;
|
||||||
bool exists1 = false;
|
bool exists1 = false;
|
||||||
|
|
|
||||||
|
|
@ -140,14 +140,10 @@ MultiDrvrNet::findDelaysSlews(ArcDelayCalc *arc_delay_calc,
|
||||||
int count = TransRiseFall::index_count * corners->dcalcAnalysisPtCount();
|
int count = TransRiseFall::index_count * corners->dcalcAnalysisPtCount();
|
||||||
parallel_delays_ = new ArcDelay[count];
|
parallel_delays_ = new ArcDelay[count];
|
||||||
parallel_slews_ = new Slew[count];
|
parallel_slews_ = new Slew[count];
|
||||||
DcalcAnalysisPtIterator ap_iter(dcalc);
|
for (auto dcalc_ap : corners->dcalcAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
const Pvt *pvt = dcalc_ap->operatingConditions();
|
const Pvt *pvt = dcalc_ap->operatingConditions();
|
||||||
TransRiseFallIterator drvr_tr_iter;
|
for (auto drvr_tr : TransRiseFall::range()) {
|
||||||
while (drvr_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *drvr_tr = drvr_tr_iter.next();
|
|
||||||
int drvr_tr_index = drvr_tr->index();
|
int drvr_tr_index = drvr_tr->index();
|
||||||
int index = ap_index*TransRiseFall::index_count+drvr_tr_index;
|
int index = ap_index*TransRiseFall::index_count+drvr_tr_index;
|
||||||
dcalc->findMultiDrvrGateDelay(this, drvr_tr, pvt, dcalc_ap,
|
dcalc->findMultiDrvrGateDelay(this, drvr_tr, pvt, dcalc_ap,
|
||||||
|
|
@ -184,16 +180,12 @@ MultiDrvrNet::findCaps(const GraphDelayCalc1 *dcalc,
|
||||||
int count = TransRiseFall::index_count * corners->dcalcAnalysisPtCount();
|
int count = TransRiseFall::index_count * corners->dcalcAnalysisPtCount();
|
||||||
net_caps_ = new NetCaps[count];
|
net_caps_ = new NetCaps[count];
|
||||||
const Pin *drvr_pin = dcalc_drvr_->pin();
|
const Pin *drvr_pin = dcalc_drvr_->pin();
|
||||||
DcalcAnalysisPtIterator ap_iter(dcalc);
|
for (auto dcalc_ap : corners->dcalcAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
const Corner *corner = dcalc_ap->corner();
|
const Corner *corner = dcalc_ap->corner();
|
||||||
const OperatingConditions *op_cond = dcalc_ap->operatingConditions();
|
const OperatingConditions *op_cond = dcalc_ap->operatingConditions();
|
||||||
const MinMax *min_max = dcalc_ap->constraintMinMax();
|
const MinMax *min_max = dcalc_ap->constraintMinMax();
|
||||||
TransRiseFallIterator drvr_tr_iter;
|
for (auto drvr_tr : TransRiseFall::range()) {
|
||||||
while (drvr_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *drvr_tr = drvr_tr_iter.next();
|
|
||||||
int drvr_tr_index = drvr_tr->index();
|
int drvr_tr_index = drvr_tr->index();
|
||||||
int index = ap_index * TransRiseFall::index_count + drvr_tr_index;
|
int index = ap_index * TransRiseFall::index_count + drvr_tr_index;
|
||||||
NetCaps &net_caps = net_caps_[index];
|
NetCaps &net_caps = net_caps_[index];
|
||||||
|
|
@ -593,12 +585,8 @@ GraphDelayCalc1::seedDrvrSlew(Vertex *drvr_vertex,
|
||||||
Port *port = network_->port(drvr_pin);
|
Port *port = network_->port(drvr_pin);
|
||||||
drive = sdc_->findInputDrive(port);
|
drive = sdc_->findInputDrive(port);
|
||||||
}
|
}
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
DcalcAnalysisPtIterator ap_iter(this);
|
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
if (drive) {
|
if (drive) {
|
||||||
const MinMax *cnst_min_max = dcalc_ap->constraintMinMax();
|
const MinMax *cnst_min_max = dcalc_ap->constraintMinMax();
|
||||||
LibertyCell *drvr_cell;
|
LibertyCell *drvr_cell;
|
||||||
|
|
@ -697,12 +685,8 @@ GraphDelayCalc1::seedLoadSlew(Vertex *vertex)
|
||||||
vertex->name(sdc_network_));
|
vertex->name(sdc_network_));
|
||||||
ClockSet *clks = sdc_->findVertexPinClocks(pin);
|
ClockSet *clks = sdc_->findVertexPinClocks(pin);
|
||||||
initSlew(vertex);
|
initSlew(vertex);
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
const TransRiseFall *tr = tr_iter.next();
|
|
||||||
DcalcAnalysisPtIterator ap_iter(this);
|
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
||||||
if (!vertex->slewAnnotated(tr, slew_min_max)) {
|
if (!vertex->slewAnnotated(tr, slew_min_max)) {
|
||||||
float slew = 0.0;
|
float slew = 0.0;
|
||||||
|
|
@ -956,14 +940,10 @@ GraphDelayCalc1::findDriverDelays1(Vertex *drvr_vertex,
|
||||||
void
|
void
|
||||||
GraphDelayCalc1::initRootSlews(Vertex *vertex)
|
GraphDelayCalc1::initRootSlews(Vertex *vertex)
|
||||||
{
|
{
|
||||||
DcalcAnalysisPtIterator ap_iter(this);
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
if (!vertex->slewAnnotated(tr, slew_min_max))
|
if (!vertex->slewAnnotated(tr, slew_min_max))
|
||||||
graph_->setSlew(vertex, tr, ap_index, default_slew);
|
graph_->setSlew(vertex, tr, ap_index, default_slew);
|
||||||
}
|
}
|
||||||
|
|
@ -986,9 +966,7 @@ GraphDelayCalc1::findDriverEdgeDelays(LibertyCell *drvr_cell,
|
||||||
bool delay_changed = false;
|
bool delay_changed = false;
|
||||||
if (related_out_port)
|
if (related_out_port)
|
||||||
related_out_pin = network_->findPin(drvr_inst, related_out_port);
|
related_out_pin = network_->findPin(drvr_inst, related_out_port);
|
||||||
DcalcAnalysisPtIterator ap_iter(this);
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
const Pvt *pvt = sdc_->pvt(drvr_inst, dcalc_ap->constraintMinMax());
|
const Pvt *pvt = sdc_->pvt(drvr_inst, dcalc_ap->constraintMinMax());
|
||||||
if (pvt == nullptr)
|
if (pvt == nullptr)
|
||||||
pvt = dcalc_ap->operatingConditions();
|
pvt = dcalc_ap->operatingConditions();
|
||||||
|
|
@ -1027,9 +1005,7 @@ GraphDelayCalc1::loadCap(const Pin *drvr_pin,
|
||||||
{
|
{
|
||||||
const MinMax *min_max = dcalc_ap->constraintMinMax();
|
const MinMax *min_max = dcalc_ap->constraintMinMax();
|
||||||
float load_cap = 0.0;
|
float load_cap = 0.0;
|
||||||
TransRiseFallIterator drvr_tr_iter;
|
for (auto drvr_tr : TransRiseFall::range()) {
|
||||||
while (drvr_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *drvr_tr = drvr_tr_iter.next();
|
|
||||||
Parasitic *drvr_parasitic = arc_delay_calc_->findParasitic(drvr_pin, drvr_tr,
|
Parasitic *drvr_parasitic = arc_delay_calc_->findParasitic(drvr_pin, drvr_tr,
|
||||||
dcalc_ap);
|
dcalc_ap);
|
||||||
float cap = loadCap(drvr_pin, nullptr, drvr_parasitic, drvr_tr, dcalc_ap);
|
float cap = loadCap(drvr_pin, nullptr, drvr_parasitic, drvr_tr, dcalc_ap);
|
||||||
|
|
@ -1151,12 +1127,8 @@ GraphDelayCalc1::netCaps(const Pin *drvr_pin,
|
||||||
void
|
void
|
||||||
GraphDelayCalc1::initSlew(Vertex *vertex)
|
GraphDelayCalc1::initSlew(Vertex *vertex)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
DcalcAnalysisPtIterator ap_iter(this);
|
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
||||||
if (!vertex->slewAnnotated(tr, slew_min_max)) {
|
if (!vertex->slewAnnotated(tr, slew_min_max)) {
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
|
|
@ -1176,17 +1148,13 @@ GraphDelayCalc1::initWireDelays(Vertex *drvr_vertex,
|
||||||
Edge *wire_edge = edge_iter.next();
|
Edge *wire_edge = edge_iter.next();
|
||||||
if (wire_edge->isWire()) {
|
if (wire_edge->isWire()) {
|
||||||
Vertex *load_vertex = wire_edge->to(graph_);
|
Vertex *load_vertex = wire_edge->to(graph_);
|
||||||
DcalcAnalysisPtIterator ap_iter(this);
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
const MinMax *delay_min_max = dcalc_ap->delayMinMax();
|
const MinMax *delay_min_max = dcalc_ap->delayMinMax();
|
||||||
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
const MinMax *slew_min_max = dcalc_ap->slewMinMax();
|
||||||
Delay delay_init_value(delay_min_max->initValue());
|
Delay delay_init_value(delay_min_max->initValue());
|
||||||
Slew slew_init_value(slew_min_max->initValue());
|
Slew slew_init_value(slew_min_max->initValue());
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
if (!graph_->wireDelayAnnotated(wire_edge, tr, ap_index))
|
if (!graph_->wireDelayAnnotated(wire_edge, tr, ap_index))
|
||||||
graph_->setWireArcDelay(wire_edge, tr, ap_index, delay_init_value);
|
graph_->setWireArcDelay(wire_edge, tr, ap_index, delay_init_value);
|
||||||
// Init load vertex slew.
|
// Init load vertex slew.
|
||||||
|
|
@ -1541,9 +1509,7 @@ GraphDelayCalc1::findCheckEdgeDelays(Edge *edge,
|
||||||
const Pin *related_out_pin = 0;
|
const Pin *related_out_pin = 0;
|
||||||
if (related_out_port)
|
if (related_out_port)
|
||||||
related_out_pin = network_->findPin(inst, related_out_port);
|
related_out_pin = network_->findPin(inst, related_out_port);
|
||||||
DcalcAnalysisPtIterator ap_iter(this);
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = ap_iter.next();
|
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
if (!graph_->arcDelayAnnotated(edge, arc, ap_index)) {
|
if (!graph_->arcDelayAnnotated(edge, arc, ap_index)) {
|
||||||
const Pvt *pvt = sdc_->pvt(inst,dcalc_ap->constraintMinMax());
|
const Pvt *pvt = sdc_->pvt(inst,dcalc_ap->constraintMinMax());
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,7 @@ InternalPowerAttrs::~InternalPowerAttrs()
|
||||||
void
|
void
|
||||||
InternalPowerAttrs::deleteContents()
|
InternalPowerAttrs::deleteContents()
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
InternalPowerModel *model = models_[tr_index];
|
InternalPowerModel *model = models_[tr_index];
|
||||||
if (model)
|
if (model)
|
||||||
delete model;
|
delete model;
|
||||||
|
|
@ -80,9 +77,7 @@ InternalPower::InternalPower(LibertyCell *cell,
|
||||||
when_(attrs->when()),
|
when_(attrs->when()),
|
||||||
related_pg_pin_(attrs->relatedPgPin())
|
related_pg_pin_(attrs->relatedPgPin())
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
int tr_index = tr->index();
|
||||||
models_[tr_index] = attrs->model(tr);
|
models_[tr_index] = attrs->model(tr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,10 +94,7 @@ LibertyLibrary::LibertyLibrary(const char *name,
|
||||||
addTableTemplate(scalar_template, type);
|
addTableTemplate(scalar_template, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
wire_slew_degradation_tbls_[tr_index] = nullptr;
|
wire_slew_degradation_tbls_[tr_index] = nullptr;
|
||||||
input_threshold_[tr_index] = input_threshold_default_;
|
input_threshold_[tr_index] = input_threshold_default_;
|
||||||
output_threshold_[tr_index] = output_threshold_default_;
|
output_threshold_[tr_index] = output_threshold_default_;
|
||||||
|
|
@ -114,10 +111,7 @@ LibertyLibrary::~LibertyLibrary()
|
||||||
scale_factors_map_.deleteContents();
|
scale_factors_map_.deleteContents();
|
||||||
delete scale_factors_;
|
delete scale_factors_;
|
||||||
|
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
TableModel *model = wire_slew_degradation_tbls_[tr_index];
|
TableModel *model = wire_slew_degradation_tbls_[tr_index];
|
||||||
delete model;
|
delete model;
|
||||||
}
|
}
|
||||||
|
|
@ -2569,10 +2563,7 @@ ScaleFactors::ScaleFactors(const char *name) :
|
||||||
{
|
{
|
||||||
for (int type = 0; type < scale_factor_type_count; type++) {
|
for (int type = 0; type < scale_factor_type_count; type++) {
|
||||||
for (int pvt = 0; pvt < int(ScaleFactorPvt::count); pvt++) {
|
for (int pvt = 0; pvt < int(ScaleFactorPvt::count); pvt++) {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
scales_[type][pvt][tr_index] = 0.0;
|
scales_[type][pvt][tr_index] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2637,7 +2628,6 @@ ScaleFactors::print()
|
||||||
ScaleFactorType type = (ScaleFactorType) type_index;
|
ScaleFactorType type = (ScaleFactorType) type_index;
|
||||||
printf("%10s ", scaleFactorTypeName(type));
|
printf("%10s ", scaleFactorTypeName(type));
|
||||||
for (int pvt_index = 0; pvt_index < int(ScaleFactorPvt::count); pvt_index++) {
|
for (int pvt_index = 0; pvt_index < int(ScaleFactorPvt::count); pvt_index++) {
|
||||||
TransRiseFallIterator tr_iter;
|
|
||||||
if (scaleFactorTypeRiseFallSuffix(type)
|
if (scaleFactorTypeRiseFallSuffix(type)
|
||||||
|| scaleFactorTypeRiseFallPrefix(type)
|
|| scaleFactorTypeRiseFallPrefix(type)
|
||||||
|| scaleFactorTypeLowHighSuffix(type)) {
|
|| scaleFactorTypeLowHighSuffix(type)) {
|
||||||
|
|
@ -2711,14 +2701,8 @@ TestCell::setScanOutInv(LibertyPort *port)
|
||||||
OcvDerate::OcvDerate(const char *name) :
|
OcvDerate::OcvDerate(const char *name) :
|
||||||
name_(name)
|
name_(name)
|
||||||
{
|
{
|
||||||
EarlyLateIterator el_iter;
|
for (auto el_index : EarlyLate::rangeIndex()) {
|
||||||
while (el_iter.hasNext()) {
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
EarlyLate *early_late = el_iter.next();
|
|
||||||
int el_index = early_late->index();
|
|
||||||
TransRiseFallIterator tr_iter;
|
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
derate_[tr_index][el_index][int(PathType::clk)] = nullptr;
|
derate_[tr_index][el_index][int(PathType::clk)] = nullptr;
|
||||||
derate_[tr_index][el_index][int(PathType::data)] = nullptr;
|
derate_[tr_index][el_index][int(PathType::data)] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
@ -2731,14 +2715,8 @@ OcvDerate::~OcvDerate()
|
||||||
// Derating table models can be shared in multiple places in derate_;
|
// Derating table models can be shared in multiple places in derate_;
|
||||||
// Collect them in a set to avoid duplicate deletes.
|
// Collect them in a set to avoid duplicate deletes.
|
||||||
Set<Table*> models;
|
Set<Table*> models;
|
||||||
EarlyLateIterator el_iter;
|
for (auto el_index : EarlyLate::rangeIndex()) {
|
||||||
while (el_iter.hasNext()) {
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
EarlyLate *early_late = el_iter.next();
|
|
||||||
int el_index = early_late->index();
|
|
||||||
TransRiseFallIterator tr_iter;
|
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
Table *derate;
|
Table *derate;
|
||||||
derate = derate_[tr_index][el_index][int(PathType::clk)];
|
derate = derate_[tr_index][el_index][int(PathType::clk)];
|
||||||
if (derate)
|
if (derate)
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,7 @@ LibertyReader::readLibertyFile(const char *filename,
|
||||||
pg_port_ = nullptr;
|
pg_port_ = nullptr;
|
||||||
have_resistance_unit_ = false;
|
have_resistance_unit_ = false;
|
||||||
|
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
int tr_index = tr_iter.next()->index();
|
|
||||||
have_input_threshold_[tr_index] = false;
|
have_input_threshold_[tr_index] = false;
|
||||||
have_output_threshold_[tr_index] = false;
|
have_output_threshold_[tr_index] = false;
|
||||||
have_slew_lower_threshold_[tr_index] = false;
|
have_slew_lower_threshold_[tr_index] = false;
|
||||||
|
|
@ -459,9 +457,7 @@ LibertyReader::defineScalingFactorVisitors()
|
||||||
ScaleFactorPvt pvt = static_cast<ScaleFactorPvt>(pvt_index);
|
ScaleFactorPvt pvt = static_cast<ScaleFactorPvt>(pvt_index);
|
||||||
const char *pvt_name = scaleFactorPvtName(pvt);
|
const char *pvt_name = scaleFactorPvtName(pvt);
|
||||||
if (scaleFactorTypeRiseFallSuffix(type)) {
|
if (scaleFactorTypeRiseFallSuffix(type)) {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
const char *tr_name = (tr == TransRiseFall::rise()) ? "rise":"fall";
|
const char *tr_name = (tr == TransRiseFall::rise()) ? "rise":"fall";
|
||||||
const char *attr_name = stringPrintTmp("k_%s_%s_%s",
|
const char *attr_name = stringPrintTmp("k_%s_%s_%s",
|
||||||
pvt_name,
|
pvt_name,
|
||||||
|
|
@ -471,9 +467,7 @@ LibertyReader::defineScalingFactorVisitors()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (scaleFactorTypeRiseFallPrefix(type)) {
|
else if (scaleFactorTypeRiseFallPrefix(type)) {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
const char *tr_name = (tr == TransRiseFall::rise()) ? "rise":"fall";
|
const char *tr_name = (tr == TransRiseFall::rise()) ? "rise":"fall";
|
||||||
const char *attr_name = stringPrintTmp("k_%s_%s_%s",
|
const char *attr_name = stringPrintTmp("k_%s_%s_%s",
|
||||||
pvt_name,
|
pvt_name,
|
||||||
|
|
@ -483,9 +477,7 @@ LibertyReader::defineScalingFactorVisitors()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (scaleFactorTypeLowHighSuffix(type)) {
|
else if (scaleFactorTypeLowHighSuffix(type)) {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
const char *tr_name = (tr == TransRiseFall::rise()) ? "high":"low";
|
const char *tr_name = (tr == TransRiseFall::rise()) ? "high":"low";
|
||||||
const char *attr_name = stringPrintTmp("k_%s_%s_%s",
|
const char *attr_name = stringPrintTmp("k_%s_%s_%s",
|
||||||
pvt_name,
|
pvt_name,
|
||||||
|
|
@ -617,9 +609,7 @@ LibertyReader::endLibraryAttrs(LibertyGroup *group)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool missing_threshold = false;
|
bool missing_threshold = false;
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
int tr_index = tr->index();
|
||||||
if (!have_input_threshold_[tr_index]) {
|
if (!have_input_threshold_[tr_index]) {
|
||||||
libWarn(group, "input_threshold_pct_%s not found.\n", tr->name());
|
libWarn(group, "input_threshold_pct_%s not found.\n", tr->name());
|
||||||
|
|
@ -2185,9 +2175,7 @@ TimingGroup::makeTimingModels(LibertyLibrary *library,
|
||||||
void
|
void
|
||||||
TimingGroup::makeLinearModels(LibertyLibrary *library)
|
TimingGroup::makeLinearModels(LibertyLibrary *library)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
int tr_index = tr->index();
|
||||||
float intr = intrinsic_[tr_index];
|
float intr = intrinsic_[tr_index];
|
||||||
bool intr_exists = intrinsic_exists_[tr_index];
|
bool intr_exists = intrinsic_exists_[tr_index];
|
||||||
|
|
@ -2216,9 +2204,7 @@ TimingGroup::makeLinearModels(LibertyLibrary *library)
|
||||||
void
|
void
|
||||||
TimingGroup::makeTableModels(LibertyReader *visitor)
|
TimingGroup::makeTableModels(LibertyReader *visitor)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
int tr_index = tr->index();
|
||||||
TableModel *cell = cell_[tr_index];
|
TableModel *cell = cell_[tr_index];
|
||||||
TableModel *constraint = constraint_[tr_index];
|
TableModel *constraint = constraint_[tr_index];
|
||||||
|
|
@ -2644,12 +2630,8 @@ LibertyReader::endPorts()
|
||||||
void
|
void
|
||||||
LibertyReader::setPortCapDefault(LibertyPort *port)
|
LibertyReader::setPortCapDefault(LibertyPort *port)
|
||||||
{
|
{
|
||||||
MinMaxIterator min_max_iter;
|
for (auto min_max : MinMax::range()) {
|
||||||
while (min_max_iter.hasNext()) {
|
for (auto tr : TransRiseFall::range()) {
|
||||||
MinMax *min_max = min_max_iter.next();
|
|
||||||
TransRiseFallIterator tr_iter;
|
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
float cap;
|
float cap;
|
||||||
bool exists;
|
bool exists;
|
||||||
port->capacitance(tr, min_max, cap, exists);
|
port->capacitance(tr, min_max, cap, exists);
|
||||||
|
|
@ -3462,9 +3444,7 @@ LibertyReader::endTiming(LibertyGroup *)
|
||||||
{
|
{
|
||||||
if (timing_) {
|
if (timing_) {
|
||||||
// Set scale factor type in constraint tables.
|
// Set scale factor type in constraint tables.
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
TableModel *model = timing_->constraint(tr);
|
TableModel *model = timing_->constraint(tr);
|
||||||
if (model) {
|
if (model) {
|
||||||
ScaleFactorType type=timingTypeScaleFactorType(timing_->timingType());
|
ScaleFactorType type=timingTypeScaleFactorType(timing_->timingType());
|
||||||
|
|
@ -4623,12 +4603,8 @@ void
|
||||||
LibertyReader::endOcvDerateFactors(LibertyGroup *)
|
LibertyReader::endOcvDerateFactors(LibertyGroup *)
|
||||||
{
|
{
|
||||||
if (ocv_derate_) {
|
if (ocv_derate_) {
|
||||||
EarlyLateIterator el_iter(derate_type_);
|
for (auto early_late : derate_type_->range()) {
|
||||||
while (el_iter.hasNext()) {
|
for (auto tr : rf_type_->range()) {
|
||||||
EarlyLate *early_late = el_iter.next();
|
|
||||||
TransRiseFallIterator tr_iter(rf_type_);
|
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
if (path_type_ == PathType::clk_and_data) {
|
if (path_type_ == PathType::clk_and_data) {
|
||||||
ocv_derate_->setDerateTable(tr, early_late, PathType::clk, table_);
|
ocv_derate_->setDerateTable(tr, early_late, PathType::clk, table_);
|
||||||
ocv_derate_->setDerateTable(tr, early_late, PathType::data, table_);
|
ocv_derate_->setDerateTable(tr, early_late, PathType::data, table_);
|
||||||
|
|
@ -5011,10 +4987,7 @@ TimingGroup::TimingGroup(int line) :
|
||||||
RelatedPortGroup(line),
|
RelatedPortGroup(line),
|
||||||
related_output_port_name_(nullptr)
|
related_output_port_name_(nullptr)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
cell_[tr_index] = nullptr;
|
cell_[tr_index] = nullptr;
|
||||||
constraint_[tr_index] = nullptr;
|
constraint_[tr_index] = nullptr;
|
||||||
transition_[tr_index] = nullptr;
|
transition_[tr_index] = nullptr;
|
||||||
|
|
@ -5023,10 +4996,7 @@ TimingGroup::TimingGroup(int line) :
|
||||||
resistance_[tr_index] = 0.0F;
|
resistance_[tr_index] = 0.0F;
|
||||||
resistance_exists_[tr_index] = false;
|
resistance_exists_[tr_index] = false;
|
||||||
|
|
||||||
MinMaxIterator el_iter;
|
for (auto el_index : EarlyLate::rangeIndex()) {
|
||||||
while (el_iter.hasNext()) {
|
|
||||||
EarlyLate *early_late = el_iter.next();
|
|
||||||
int el_index = early_late->index();
|
|
||||||
delay_sigma_[tr_index][el_index] = nullptr;
|
delay_sigma_[tr_index][el_index] = nullptr;
|
||||||
slew_sigma_[tr_index][el_index] = nullptr;
|
slew_sigma_[tr_index][el_index] = nullptr;
|
||||||
constraint_sigma_[tr_index][el_index] = nullptr;
|
constraint_sigma_[tr_index][el_index] = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,7 @@ GateTableModel::GateTableModel(TableModel *delay_model,
|
||||||
delay_model_(delay_model),
|
delay_model_(delay_model),
|
||||||
slew_model_(slew_model)
|
slew_model_(slew_model)
|
||||||
{
|
{
|
||||||
MinMaxIterator el_iter;
|
for (auto el_index : EarlyLate::rangeIndex()) {
|
||||||
while (el_iter.hasNext()) {
|
|
||||||
EarlyLate *early_late = el_iter.next();
|
|
||||||
int el_index = early_late->index();
|
|
||||||
slew_sigma_models_[el_index] = slew_sigma_models[el_index];
|
slew_sigma_models_[el_index] = slew_sigma_models[el_index];
|
||||||
delay_sigma_models_[el_index] = delay_sigma_models[el_index];
|
delay_sigma_models_[el_index] = delay_sigma_models[el_index];
|
||||||
}
|
}
|
||||||
|
|
@ -348,13 +345,9 @@ CheckTableModel::CheckTableModel(TableModel *model,
|
||||||
TableModel *sigma_models[EarlyLate::index_count]) :
|
TableModel *sigma_models[EarlyLate::index_count]) :
|
||||||
model_(model)
|
model_(model)
|
||||||
{
|
{
|
||||||
MinMaxIterator el_iter;
|
for (auto el_index : EarlyLate::rangeIndex())
|
||||||
while (el_iter.hasNext()) {
|
|
||||||
EarlyLate *early_late = el_iter.next();
|
|
||||||
int el_index = early_late->index();
|
|
||||||
sigma_models_[el_index] = sigma_models[el_index];
|
sigma_models_[el_index] = sigma_models[el_index];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CheckTableModel::~CheckTableModel()
|
CheckTableModel::~CheckTableModel()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -188,10 +188,7 @@ TimingArcSet::init(LibertyCell *cell)
|
||||||
if (cell)
|
if (cell)
|
||||||
index_ = cell->addTimingArcSet(this);
|
index_ = cell->addTimingArcSet(this);
|
||||||
|
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
from_arc1_[tr_index] = nullptr;
|
from_arc1_[tr_index] = nullptr;
|
||||||
from_arc2_[tr_index] = nullptr;
|
from_arc2_[tr_index] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,24 +21,10 @@ namespace sta {
|
||||||
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
|
||||||
TransRiseFall *TransRiseFall::rise_;
|
TransRiseFall TransRiseFall::rise_("rise", "^", 0);
|
||||||
TransRiseFall *TransRiseFall::fall_;
|
TransRiseFall TransRiseFall::fall_("fall", "v", 1);
|
||||||
|
const std::array<TransRiseFall*, 2> TransRiseFall::range_{&rise_, &fall_};
|
||||||
void
|
const std::array<int, 2> TransRiseFall::range_index_{rise_.index(), fall_.index()};
|
||||||
TransRiseFall::init()
|
|
||||||
{
|
|
||||||
rise_ = new TransRiseFall("rise", "^", 0);
|
|
||||||
fall_ = new TransRiseFall("fall", "v", 1);;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TransRiseFall::destroy()
|
|
||||||
{
|
|
||||||
delete rise_;
|
|
||||||
rise_ = nullptr;
|
|
||||||
delete fall_;
|
|
||||||
fall_ = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
TransRiseFall::TransRiseFall(const char *name,
|
TransRiseFall::TransRiseFall(const char *name,
|
||||||
const char *short_name,
|
const char *short_name,
|
||||||
|
|
@ -64,19 +50,19 @@ TransRiseFall::setShortName(const char *short_name)
|
||||||
TransRiseFall *
|
TransRiseFall *
|
||||||
TransRiseFall::opposite() const
|
TransRiseFall::opposite() const
|
||||||
{
|
{
|
||||||
if (this == rise_)
|
if (this == &rise_)
|
||||||
return fall_;
|
return &fall_;
|
||||||
else
|
else
|
||||||
return rise_;
|
return &rise_;
|
||||||
}
|
}
|
||||||
|
|
||||||
TransRiseFall *
|
TransRiseFall *
|
||||||
TransRiseFall::find(const char *tr_str)
|
TransRiseFall::find(const char *tr_str)
|
||||||
{
|
{
|
||||||
if (stringEq(tr_str, rise_->name()))
|
if (stringEq(tr_str, rise_.name()))
|
||||||
return rise_;
|
return &rise_;
|
||||||
else if (stringEq(tr_str, fall_->name()))
|
else if (stringEq(tr_str, fall_.name()))
|
||||||
return fall_;
|
return &fall_;
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
@ -84,16 +70,16 @@ TransRiseFall::find(const char *tr_str)
|
||||||
TransRiseFall *
|
TransRiseFall *
|
||||||
TransRiseFall::find(int index)
|
TransRiseFall::find(int index)
|
||||||
{
|
{
|
||||||
if (index == rise_->index())
|
if (index == rise_.index())
|
||||||
return rise_;
|
return &rise_;
|
||||||
else
|
else
|
||||||
return fall_;
|
return &fall_;
|
||||||
}
|
}
|
||||||
|
|
||||||
TransRiseFallBoth *
|
TransRiseFallBoth *
|
||||||
TransRiseFall::asRiseFallBoth()
|
TransRiseFall::asRiseFallBoth()
|
||||||
{
|
{
|
||||||
if (this == rise_)
|
if (this == &rise_)
|
||||||
return TransRiseFallBoth::rise();
|
return TransRiseFallBoth::rise();
|
||||||
else
|
else
|
||||||
return TransRiseFallBoth::fall();
|
return TransRiseFallBoth::fall();
|
||||||
|
|
@ -102,7 +88,7 @@ TransRiseFall::asRiseFallBoth()
|
||||||
const TransRiseFallBoth *
|
const TransRiseFallBoth *
|
||||||
TransRiseFall::asRiseFallBoth() const
|
TransRiseFall::asRiseFallBoth() const
|
||||||
{
|
{
|
||||||
if (this == rise_)
|
if (this == &rise_)
|
||||||
return TransRiseFallBoth::rise();
|
return TransRiseFallBoth::rise();
|
||||||
else
|
else
|
||||||
return TransRiseFallBoth::fall();
|
return TransRiseFallBoth::fall();
|
||||||
|
|
@ -111,7 +97,7 @@ TransRiseFall::asRiseFallBoth() const
|
||||||
Transition *
|
Transition *
|
||||||
TransRiseFall::asTransition() const
|
TransRiseFall::asTransition() const
|
||||||
{
|
{
|
||||||
if (this == rise_)
|
if (this == &rise_)
|
||||||
return Transition::rise();
|
return Transition::rise();
|
||||||
else
|
else
|
||||||
return Transition::fall();
|
return Transition::fall();
|
||||||
|
|
@ -119,37 +105,33 @@ TransRiseFall::asTransition() const
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TransRiseFallBoth *TransRiseFallBoth::rise_;
|
TransRiseFallBoth TransRiseFallBoth::rise_("rise", "^", 0,
|
||||||
TransRiseFallBoth *TransRiseFallBoth::fall_;
|
TransRiseFall::rise(),
|
||||||
TransRiseFallBoth *TransRiseFallBoth::rise_fall_;
|
{TransRiseFall::rise()},
|
||||||
|
{TransRiseFall::riseIndex()});
|
||||||
void
|
TransRiseFallBoth TransRiseFallBoth::fall_("fall", "v", 1,
|
||||||
TransRiseFallBoth::init()
|
TransRiseFall::fall(),
|
||||||
{
|
{TransRiseFall::fall()},
|
||||||
rise_ = new TransRiseFallBoth("rise", "^", 0, TransRiseFall::rise());
|
{TransRiseFall::fallIndex()});
|
||||||
fall_ = new TransRiseFallBoth("fall", "v", 1, TransRiseFall::fall());
|
TransRiseFallBoth TransRiseFallBoth::rise_fall_("rise_fall", "rf", 2,
|
||||||
rise_fall_ = new TransRiseFallBoth("rise_fall", "rf", 2, nullptr);
|
nullptr,
|
||||||
}
|
{TransRiseFall::rise(),
|
||||||
|
TransRiseFall::fall()},
|
||||||
void
|
{TransRiseFall::riseIndex(),
|
||||||
TransRiseFallBoth::destroy()
|
TransRiseFall::fallIndex()});
|
||||||
{
|
|
||||||
delete rise_;
|
|
||||||
rise_ = nullptr;
|
|
||||||
delete fall_;
|
|
||||||
fall_ = nullptr;
|
|
||||||
delete rise_fall_;
|
|
||||||
rise_fall_ = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
TransRiseFallBoth::TransRiseFallBoth(const char *name,
|
TransRiseFallBoth::TransRiseFallBoth(const char *name,
|
||||||
const char *short_name,
|
const char *short_name,
|
||||||
int sdf_triple_index,
|
int sdf_triple_index,
|
||||||
TransRiseFall *as_rise_fall) :
|
TransRiseFall *as_rise_fall,
|
||||||
|
std::vector<TransRiseFall*> range,
|
||||||
|
std::vector<int> range_index) :
|
||||||
name_(name),
|
name_(name),
|
||||||
short_name_(stringCopy(short_name)),
|
short_name_(stringCopy(short_name)),
|
||||||
sdf_triple_index_(sdf_triple_index),
|
sdf_triple_index_(sdf_triple_index),
|
||||||
as_rise_fall_(as_rise_fall)
|
as_rise_fall_(as_rise_fall),
|
||||||
|
range_(range),
|
||||||
|
range_index_(range_index)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -161,12 +143,12 @@ TransRiseFallBoth::~TransRiseFallBoth()
|
||||||
TransRiseFallBoth *
|
TransRiseFallBoth *
|
||||||
TransRiseFallBoth::find(const char *tr_str)
|
TransRiseFallBoth::find(const char *tr_str)
|
||||||
{
|
{
|
||||||
if (stringEq(tr_str, rise_->name()))
|
if (stringEq(tr_str, rise_.name()))
|
||||||
return rise_;
|
return &rise_;
|
||||||
else if (stringEq(tr_str, fall_->name()))
|
else if (stringEq(tr_str, fall_.name()))
|
||||||
return fall_;
|
return &fall_;
|
||||||
else if (stringEq(tr_str, rise_fall_->name()))
|
else if (stringEq(tr_str, rise_fall_.name()))
|
||||||
return rise_fall_;
|
return &rise_fall_;
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
@ -174,17 +156,17 @@ TransRiseFallBoth::find(const char *tr_str)
|
||||||
bool
|
bool
|
||||||
TransRiseFallBoth::matches(const TransRiseFall *tr) const
|
TransRiseFallBoth::matches(const TransRiseFall *tr) const
|
||||||
{
|
{
|
||||||
return this == rise_fall_
|
return this == &rise_fall_
|
||||||
|| as_rise_fall_ == tr;
|
|| as_rise_fall_ == tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TransRiseFallBoth::matches(const Transition *tr) const
|
TransRiseFallBoth::matches(const Transition *tr) const
|
||||||
{
|
{
|
||||||
return this == rise_fall_
|
return this == &rise_fall_
|
||||||
|| (this == rise_
|
|| (this == &rise_
|
||||||
&& tr == Transition::rise())
|
&& tr == Transition::rise())
|
||||||
|| (this == fall_
|
|| (this == &fall_
|
||||||
&& tr == Transition::fall());
|
&& tr == Transition::fall());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -197,42 +179,23 @@ TransRiseFallBoth::setShortName(const char *short_name)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TransitionMap *Transition::transition_map_;
|
TransitionMap Transition::transition_map_;
|
||||||
int Transition::max_index_ = 0;
|
int Transition::max_index_ = 0;
|
||||||
|
|
||||||
Transition *Transition::rise_;
|
|
||||||
Transition *Transition::fall_;
|
|
||||||
Transition *Transition::tr_0Z_;
|
|
||||||
Transition *Transition::tr_Z1_;
|
|
||||||
Transition *Transition::tr_1Z_;
|
|
||||||
Transition *Transition::tr_Z0_;
|
|
||||||
Transition *Transition::tr_0X_;
|
|
||||||
Transition *Transition::tr_X1_;
|
|
||||||
Transition *Transition::tr_1X_;
|
|
||||||
Transition *Transition::tr_X0_;
|
|
||||||
Transition *Transition::tr_XZ_;
|
|
||||||
Transition *Transition::tr_ZX_;
|
|
||||||
Transition *Transition::rise_fall_;
|
|
||||||
|
|
||||||
void
|
|
||||||
Transition::init()
|
|
||||||
{
|
|
||||||
transition_map_ = new TransitionMap;
|
|
||||||
// Sdf triple order defined on Sdf 3.0 spec, pg 3-17.
|
// Sdf triple order defined on Sdf 3.0 spec, pg 3-17.
|
||||||
rise_ = new Transition( "^", "01", TransRiseFall::rise(), 0);
|
Transition Transition::rise_{ "^", "01", TransRiseFall::rise(), 0};
|
||||||
fall_ = new Transition( "v", "10", TransRiseFall::fall(), 1);
|
Transition Transition::fall_ { "v", "10", TransRiseFall::fall(), 1};
|
||||||
tr_0Z_ = new Transition("0Z", "0Z", TransRiseFall::rise(), 2);
|
Transition Transition::tr_0Z_{"0Z", "0Z", TransRiseFall::rise(), 2};
|
||||||
tr_Z1_ = new Transition("Z1", "Z1", TransRiseFall::rise(), 3);
|
Transition Transition::tr_Z1_{"Z1", "Z1", TransRiseFall::rise(), 3};
|
||||||
tr_1Z_ = new Transition("1Z", "1Z", TransRiseFall::fall(), 4);
|
Transition Transition::tr_1Z_{"1Z", "1Z", TransRiseFall::fall(), 4};
|
||||||
tr_Z0_ = new Transition("Z0", "Z0", TransRiseFall::fall(), 5);
|
Transition Transition::tr_Z0_{"Z0", "Z0", TransRiseFall::fall(), 5};
|
||||||
tr_0X_ = new Transition("0X", "0X", TransRiseFall::rise(), 6);
|
Transition Transition::tr_0X_{"0X", "0X", TransRiseFall::rise(), 6};
|
||||||
tr_X1_ = new Transition("X1", "X1", TransRiseFall::rise(), 7);
|
Transition Transition::tr_X1_{"X1", "X1", TransRiseFall::rise(), 7};
|
||||||
tr_1X_ = new Transition("1X", "1X", TransRiseFall::fall(), 8);
|
Transition Transition::tr_1X_{"1X", "1X", TransRiseFall::fall(), 8};
|
||||||
tr_X0_ = new Transition("X0", "X0", TransRiseFall::fall(), 9);
|
Transition Transition::tr_X0_{"X0", "X0", TransRiseFall::fall(), 9};
|
||||||
tr_XZ_ = new Transition("XZ", "XZ", nullptr, 10);
|
Transition Transition::tr_XZ_{"XZ", "XZ", nullptr, 10};
|
||||||
tr_ZX_ = new Transition("ZX", "ZX", nullptr, 11);
|
Transition Transition::tr_ZX_{"ZX", "ZX", nullptr, 11};
|
||||||
rise_fall_ = new Transition("*", "**", nullptr, -1);
|
Transition Transition::rise_fall_{"*", "**", nullptr, -1};
|
||||||
}
|
|
||||||
|
|
||||||
Transition::Transition(const char *name,
|
Transition::Transition(const char *name,
|
||||||
const char *init_final,
|
const char *init_final,
|
||||||
|
|
@ -243,8 +206,8 @@ Transition::Transition(const char *name,
|
||||||
as_rise_fall_(as_rise_fall),
|
as_rise_fall_(as_rise_fall),
|
||||||
sdf_triple_index_(sdf_triple_index)
|
sdf_triple_index_(sdf_triple_index)
|
||||||
{
|
{
|
||||||
(*transition_map_)[name_] = this;
|
transition_map_[name_] = this;
|
||||||
(*transition_map_)[init_final_] = this;
|
transition_map_[init_final_] = this;
|
||||||
max_index_ = max(sdf_triple_index, max_index_);
|
max_index_ = max(sdf_triple_index, max_index_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -253,28 +216,6 @@ Transition::~Transition()
|
||||||
stringDelete(name_);
|
stringDelete(name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Transition::destroy()
|
|
||||||
{
|
|
||||||
if (transition_map_) {
|
|
||||||
delete rise_;
|
|
||||||
delete fall_;
|
|
||||||
delete tr_0Z_;
|
|
||||||
delete tr_Z1_;
|
|
||||||
delete tr_1Z_;
|
|
||||||
delete tr_Z0_;
|
|
||||||
delete tr_0X_;
|
|
||||||
delete tr_X1_;
|
|
||||||
delete tr_1X_;
|
|
||||||
delete tr_X0_;
|
|
||||||
delete tr_XZ_;
|
|
||||||
delete tr_ZX_;
|
|
||||||
delete rise_fall_;
|
|
||||||
delete transition_map_;
|
|
||||||
transition_map_ = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Transition::matches(const Transition *tr) const
|
Transition::matches(const Transition *tr) const
|
||||||
{
|
{
|
||||||
|
|
@ -284,7 +225,7 @@ Transition::matches(const Transition *tr) const
|
||||||
Transition *
|
Transition *
|
||||||
Transition::find(const char *tr_str)
|
Transition::find(const char *tr_str)
|
||||||
{
|
{
|
||||||
return transition_map_->findKey(tr_str);
|
return transition_map_.findKey(tr_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
const TransRiseFallBoth *
|
const TransRiseFallBoth *
|
||||||
|
|
@ -334,4 +275,3 @@ TransRiseFallIterator::next()
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
#ifndef STA_TRANSITION_H
|
#ifndef STA_TRANSITION_H
|
||||||
#define STA_TRANSITION_H
|
#define STA_TRANSITION_H
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
#include <vector>
|
||||||
#include "DisallowCopyAssign.hh"
|
#include "DisallowCopyAssign.hh"
|
||||||
#include "Iterator.hh"
|
#include "Iterator.hh"
|
||||||
#include "Map.hh"
|
#include "Map.hh"
|
||||||
|
|
@ -34,13 +36,11 @@ typedef Map<const char*, Transition*, CharPtrLess> TransitionMap;
|
||||||
class TransRiseFall
|
class TransRiseFall
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void init();
|
|
||||||
static void destroy();
|
|
||||||
// Singleton accessors.
|
// Singleton accessors.
|
||||||
static TransRiseFall *rise() { return rise_; }
|
static TransRiseFall *rise() { return &rise_; }
|
||||||
static TransRiseFall *fall() { return fall_; }
|
static TransRiseFall *fall() { return &fall_; }
|
||||||
static int riseIndex() { return rise_->sdf_triple_index_; }
|
static int riseIndex() { return rise_.sdf_triple_index_; }
|
||||||
static int fallIndex() { return fall_->sdf_triple_index_; }
|
static int fallIndex() { return fall_.sdf_triple_index_; }
|
||||||
const char *asString() const { return short_name_; }
|
const char *asString() const { return short_name_; }
|
||||||
const char *name() const { return name_; }
|
const char *name() const { return name_; }
|
||||||
const char *shortName() const { return short_name_; }
|
const char *shortName() const { return short_name_; }
|
||||||
|
|
@ -55,6 +55,11 @@ public:
|
||||||
static TransRiseFall *find(int index);
|
static TransRiseFall *find(int index);
|
||||||
TransRiseFall *opposite() const;
|
TransRiseFall *opposite() const;
|
||||||
|
|
||||||
|
// for range support.
|
||||||
|
// for (auto tr : TransRiseFall::range()) {}
|
||||||
|
static const std::array<TransRiseFall*, 2> &range() { return range_; }
|
||||||
|
// for (auto tr_index : TransRiseFall::rangeIndex()) {}
|
||||||
|
static const std::array<int, 2> &rangeIndex() { return range_index_; }
|
||||||
static const int index_count = 2;
|
static const int index_count = 2;
|
||||||
static const int index_max = (index_count - 1);
|
static const int index_max = (index_count - 1);
|
||||||
static const int index_bit_count = 1;
|
static const int index_bit_count = 1;
|
||||||
|
|
@ -69,8 +74,10 @@ protected:
|
||||||
const char *short_name_;
|
const char *short_name_;
|
||||||
const int sdf_triple_index_;
|
const int sdf_triple_index_;
|
||||||
|
|
||||||
static TransRiseFall *rise_;
|
static TransRiseFall rise_;
|
||||||
static TransRiseFall *fall_;
|
static TransRiseFall fall_;
|
||||||
|
static const std::array<TransRiseFall*, 2> range_;
|
||||||
|
static const std::array<int, 2> range_index_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(TransRiseFall);
|
DISALLOW_COPY_AND_ASSIGN(TransRiseFall);
|
||||||
|
|
@ -80,12 +87,10 @@ private:
|
||||||
class TransRiseFallBoth
|
class TransRiseFallBoth
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void init();
|
|
||||||
static void destroy();
|
|
||||||
// Singleton accessors.
|
// Singleton accessors.
|
||||||
static TransRiseFallBoth *rise() { return rise_; }
|
static TransRiseFallBoth *rise() { return &rise_; }
|
||||||
static TransRiseFallBoth *fall() { return fall_; }
|
static TransRiseFallBoth *fall() { return &fall_; }
|
||||||
static TransRiseFallBoth *riseFall() { return rise_fall_; }
|
static TransRiseFallBoth *riseFall() { return &rise_fall_; }
|
||||||
const char *asString() const { return short_name_; }
|
const char *asString() const { return short_name_; }
|
||||||
const char *name() const { return name_; }
|
const char *name() const { return name_; }
|
||||||
const char *shortName() const { return short_name_; }
|
const char *shortName() const { return short_name_; }
|
||||||
|
|
@ -96,6 +101,10 @@ public:
|
||||||
TransRiseFall *asRiseFall() const { return as_rise_fall_; }
|
TransRiseFall *asRiseFall() const { return as_rise_fall_; }
|
||||||
// Find transition corresponding to string.
|
// Find transition corresponding to string.
|
||||||
static TransRiseFallBoth *find(const char *tr_str);
|
static TransRiseFallBoth *find(const char *tr_str);
|
||||||
|
// for (auto tr : min_max->range()) {}
|
||||||
|
const std::vector<TransRiseFall*> &range() const { return range_; }
|
||||||
|
// for (auto tr_index : min_max->rangeIndex()) {}
|
||||||
|
const std::vector<int> &rangeIndex() const { return range_index_; }
|
||||||
|
|
||||||
static const int index_count = 3;
|
static const int index_count = 3;
|
||||||
static const int index_max = (index_count - 1);
|
static const int index_max = (index_count - 1);
|
||||||
|
|
@ -105,17 +114,21 @@ protected:
|
||||||
TransRiseFallBoth(const char *name,
|
TransRiseFallBoth(const char *name,
|
||||||
const char *short_name,
|
const char *short_name,
|
||||||
int sdf_triple_index,
|
int sdf_triple_index,
|
||||||
TransRiseFall *as_rise_fall);
|
TransRiseFall *as_rise_fall,
|
||||||
|
std::vector<TransRiseFall*> range,
|
||||||
|
std::vector<int> range_index);
|
||||||
~TransRiseFallBoth();
|
~TransRiseFallBoth();
|
||||||
|
|
||||||
const char *name_;
|
const char *name_;
|
||||||
const char *short_name_;
|
const char *short_name_;
|
||||||
const int sdf_triple_index_;
|
const int sdf_triple_index_;
|
||||||
TransRiseFall *as_rise_fall_;
|
TransRiseFall *as_rise_fall_;
|
||||||
|
const std::vector<TransRiseFall*> range_;
|
||||||
|
const std::vector<int> range_index_;
|
||||||
|
|
||||||
static TransRiseFallBoth *rise_;
|
static TransRiseFallBoth rise_;
|
||||||
static TransRiseFallBoth *fall_;
|
static TransRiseFallBoth fall_;
|
||||||
static TransRiseFallBoth *rise_fall_;
|
static TransRiseFallBoth rise_fall_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(TransRiseFallBoth);
|
DISALLOW_COPY_AND_ASSIGN(TransRiseFallBoth);
|
||||||
|
|
@ -125,24 +138,22 @@ private:
|
||||||
class Transition
|
class Transition
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void init();
|
|
||||||
static void destroy();
|
|
||||||
// Singleton accessors.
|
// Singleton accessors.
|
||||||
static Transition *rise() { return rise_; }
|
static Transition *rise() { return &rise_; }
|
||||||
static Transition *fall() { return fall_; }
|
static Transition *fall() { return &fall_; }
|
||||||
static Transition *tr0Z() { return tr_0Z_; }
|
static Transition *tr0Z() { return &tr_0Z_; }
|
||||||
static Transition *trZ1() { return tr_Z1_; }
|
static Transition *trZ1() { return &tr_Z1_; }
|
||||||
static Transition *tr1Z() { return tr_1Z_; }
|
static Transition *tr1Z() { return &tr_1Z_; }
|
||||||
static Transition *trZ0() { return tr_Z0_; }
|
static Transition *trZ0() { return &tr_Z0_; }
|
||||||
static Transition *tr0X() { return tr_0X_; }
|
static Transition *tr0X() { return &tr_0X_; }
|
||||||
static Transition *trX1() { return tr_X1_; }
|
static Transition *trX1() { return &tr_X1_; }
|
||||||
static Transition *tr1X() { return tr_1X_; }
|
static Transition *tr1X() { return &tr_1X_; }
|
||||||
static Transition *trX0() { return tr_X0_; }
|
static Transition *trX0() { return &tr_X0_; }
|
||||||
static Transition *trXZ() { return tr_XZ_; }
|
static Transition *trXZ() { return &tr_XZ_; }
|
||||||
static Transition *trZX() { return tr_ZX_; }
|
static Transition *trZX() { return &tr_ZX_; }
|
||||||
void setName(const char *name);
|
void setName(const char *name);
|
||||||
// Matches rise and fall.
|
// Matches rise and fall.
|
||||||
static Transition *riseFall() { return rise_fall_; }
|
static Transition *riseFall() { return &rise_fall_; }
|
||||||
const char *asString() const { return name_; }
|
const char *asString() const { return name_; }
|
||||||
// As initial/final value pair.
|
// As initial/final value pair.
|
||||||
const char *asInitFinalString() const { return init_final_; }
|
const char *asInitFinalString() const { return init_final_; }
|
||||||
|
|
@ -160,10 +171,6 @@ private:
|
||||||
const char *init_final,
|
const char *init_final,
|
||||||
TransRiseFall *as_rise_fall,
|
TransRiseFall *as_rise_fall,
|
||||||
int sdf_triple_index);
|
int sdf_triple_index);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
~Transition();
|
~Transition();
|
||||||
|
|
||||||
const char *name_;
|
const char *name_;
|
||||||
|
|
@ -171,30 +178,32 @@ private:
|
||||||
TransRiseFall *as_rise_fall_;
|
TransRiseFall *as_rise_fall_;
|
||||||
const int sdf_triple_index_;
|
const int sdf_triple_index_;
|
||||||
|
|
||||||
static Transition *rise_;
|
static Transition rise_;
|
||||||
static Transition *fall_;
|
static Transition fall_;
|
||||||
static Transition *tr_0Z_;
|
static Transition tr_0Z_;
|
||||||
static Transition *tr_Z1_;
|
static Transition tr_Z1_;
|
||||||
static Transition *tr_1Z_;
|
static Transition tr_1Z_;
|
||||||
static Transition *tr_Z0_;
|
static Transition tr_Z0_;
|
||||||
static Transition *tr_0X_;
|
static Transition tr_0X_;
|
||||||
static Transition *tr_X1_;
|
static Transition tr_X1_;
|
||||||
static Transition *tr_1X_;
|
static Transition tr_1X_;
|
||||||
static Transition *tr_X0_;
|
static Transition tr_X0_;
|
||||||
static Transition *tr_XZ_;
|
static Transition tr_XZ_;
|
||||||
static Transition *tr_ZX_;
|
static Transition tr_ZX_;
|
||||||
static Transition *rise_fall_;
|
static Transition rise_fall_;
|
||||||
static const int index_count = 13;
|
static const int index_count = 13;
|
||||||
static const int index_max = (index_count - 1);
|
static const int index_max = (index_count - 1);
|
||||||
static const int index_bit_count = 4;
|
static const int index_bit_count = 4;
|
||||||
|
|
||||||
static TransitionMap *transition_map_;
|
static TransitionMap transition_map_;
|
||||||
static int max_index_;
|
static int max_index_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(Transition);
|
DISALLOW_COPY_AND_ASSIGN(Transition);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Obsolete. Use range iteration instead.
|
||||||
|
// for (auto tr : TransRiseFall::range()) {}
|
||||||
class TransRiseFallIterator : public Iterator<TransRiseFall*>
|
class TransRiseFallIterator : public Iterator<TransRiseFall*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -912,9 +912,7 @@ ConcreteParasitics::deleteParasitics(const Pin *drvr_pin,
|
||||||
{
|
{
|
||||||
ConcreteParasitic **parasitics = drvr_parasitic_map_[drvr_pin];
|
ConcreteParasitic **parasitics = drvr_parasitic_map_[drvr_pin];
|
||||||
if (parasitics) {
|
if (parasitics) {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int ap_tr_index = parasiticAnalysisPtIndex(ap, tr);
|
int ap_tr_index = parasiticAnalysisPtIndex(ap, tr);
|
||||||
delete parasitics[ap_tr_index];
|
delete parasitics[ap_tr_index];
|
||||||
parasitics[ap_tr_index] = nullptr;
|
parasitics[ap_tr_index] = nullptr;
|
||||||
|
|
|
||||||
16
sdc/Clock.cc
16
sdc/Clock.cc
|
|
@ -124,9 +124,7 @@ void
|
||||||
Clock::makeClkEdges()
|
Clock::makeClkEdges()
|
||||||
{
|
{
|
||||||
clk_edges_ = new ClockEdge*[TransRiseFall::index_count];
|
clk_edges_ = new ClockEdge*[TransRiseFall::index_count];
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
clk_edges_[tr->index()] = new ClockEdge(this, tr);
|
clk_edges_[tr->index()] = new ClockEdge(this, tr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -667,26 +665,18 @@ InterClockUncertainty::setUncertainty(const TransRiseFallBoth *src_tr,
|
||||||
const SetupHoldAll *setup_hold,
|
const SetupHoldAll *setup_hold,
|
||||||
float uncertainty)
|
float uncertainty)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator src_tr_iter(src_tr);
|
for (auto src_tr_index : src_tr->rangeIndex())
|
||||||
while (src_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *src_tr = src_tr_iter.next();
|
|
||||||
int src_tr_index = src_tr->index();
|
|
||||||
uncertainties_[src_tr_index].setValue(tgt_tr, setup_hold, uncertainty);
|
uncertainties_[src_tr_index].setValue(tgt_tr, setup_hold, uncertainty);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
InterClockUncertainty::removeUncertainty(const TransRiseFallBoth *src_tr,
|
InterClockUncertainty::removeUncertainty(const TransRiseFallBoth *src_tr,
|
||||||
const TransRiseFallBoth *tgt_tr,
|
const TransRiseFallBoth *tgt_tr,
|
||||||
const SetupHoldAll *setup_hold)
|
const SetupHoldAll *setup_hold)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator src_tr_iter(src_tr);
|
for (auto src_tr_index : src_tr->rangeIndex())
|
||||||
while (src_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *src_tr = src_tr_iter.next();
|
|
||||||
int src_tr_index = src_tr->index();
|
|
||||||
uncertainties_[src_tr_index].removeValue(tgt_tr, setup_hold);
|
uncertainties_[src_tr_index].removeValue(tgt_tr, setup_hold);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const RiseFallMinMax *
|
const RiseFallMinMax *
|
||||||
InterClockUncertainty::uncertainties(TransRiseFall *src_tr) const
|
InterClockUncertainty::uncertainties(TransRiseFall *src_tr) const
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@
|
||||||
|
|
||||||
namespace sta {
|
namespace sta {
|
||||||
|
|
||||||
ClockInsertion::ClockInsertion(const Clock *clk, const Pin *pin) :
|
ClockInsertion::ClockInsertion(const Clock *clk,
|
||||||
|
const Pin *pin) :
|
||||||
clk_(clk),
|
clk_(clk),
|
||||||
pin_(pin)
|
pin_(pin)
|
||||||
{
|
{
|
||||||
|
|
@ -28,17 +29,16 @@ ClockInsertion::ClockInsertion(const Clock *clk, const Pin *pin) :
|
||||||
void
|
void
|
||||||
ClockInsertion::setDelay(const TransRiseFallBoth *tr,
|
ClockInsertion::setDelay(const TransRiseFallBoth *tr,
|
||||||
const MinMaxAll *min_max,
|
const MinMaxAll *min_max,
|
||||||
const EarlyLateAll *early_late, float delay)
|
const EarlyLateAll *early_late,
|
||||||
|
float delay)
|
||||||
{
|
{
|
||||||
EarlyLateIterator el_iter(early_late);
|
for (auto el_index : early_late->rangeIndex())
|
||||||
while (el_iter.hasNext()) {
|
delays_[el_index].setValue(tr, min_max, delay);
|
||||||
EarlyLate *el = el_iter.next();
|
|
||||||
delays_[el->index()].setValue(tr, min_max, delay);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
ClockInsertion::delay(const TransRiseFall *tr, const MinMax *min_max,
|
ClockInsertion::delay(const TransRiseFall *tr,
|
||||||
|
const MinMax *min_max,
|
||||||
const EarlyLate *early_late)
|
const EarlyLate *early_late)
|
||||||
{
|
{
|
||||||
float insertion;
|
float insertion;
|
||||||
|
|
@ -51,10 +51,12 @@ ClockInsertion::delay(const TransRiseFall *tr, const MinMax *min_max,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClockInsertion::delay(const TransRiseFall *tr, const MinMax *min_max,
|
ClockInsertion::delay(const TransRiseFall *tr,
|
||||||
|
const MinMax *min_max,
|
||||||
const EarlyLate *early_late,
|
const EarlyLate *early_late,
|
||||||
// Return values.
|
// Return values.
|
||||||
float &insertion, bool &exists)
|
float &insertion,
|
||||||
|
bool &exists)
|
||||||
|
|
||||||
{
|
{
|
||||||
delays_[early_late->index()].value(tr, min_max, insertion, exists);
|
delays_[early_late->index()].value(tr, min_max, insertion, exists);
|
||||||
|
|
@ -65,7 +67,8 @@ ClockInsertion::delay(const TransRiseFall *tr, const MinMax *min_max,
|
||||||
void
|
void
|
||||||
ClockInsertion::setDelay(const TransRiseFall *tr,
|
ClockInsertion::setDelay(const TransRiseFall *tr,
|
||||||
const MinMax *min_max,
|
const MinMax *min_max,
|
||||||
const EarlyLate *early_late, float delay)
|
const EarlyLate *early_late,
|
||||||
|
float delay)
|
||||||
{
|
{
|
||||||
delays_[early_late->index()].setValue(tr, min_max, delay);
|
delays_[early_late->index()].setValue(tr, min_max, delay);
|
||||||
}
|
}
|
||||||
|
|
@ -73,11 +76,8 @@ ClockInsertion::setDelay(const TransRiseFall *tr,
|
||||||
void
|
void
|
||||||
ClockInsertion::setDelays(RiseFallMinMax *delays)
|
ClockInsertion::setDelays(RiseFallMinMax *delays)
|
||||||
{
|
{
|
||||||
EarlyLateIterator el_iter;
|
for (auto el_index : EarlyLate::rangeIndex())
|
||||||
while (el_iter.hasNext()) {
|
delays_[el_index].setValues(delays);
|
||||||
EarlyLate *el = el_iter.next();
|
|
||||||
delays_[el->index()].setValues(delays);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RiseFallMinMax *
|
RiseFallMinMax *
|
||||||
|
|
|
||||||
|
|
@ -47,35 +47,24 @@ DataCheck::setMargin(const TransRiseFallBoth *from_tr,
|
||||||
const SetupHoldAll *setup_hold,
|
const SetupHoldAll *setup_hold,
|
||||||
float margin)
|
float margin)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator from_tr_iter(from_tr);
|
for (auto from_tr_index : from_tr->rangeIndex())
|
||||||
while (from_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *from_tr1 = from_tr_iter.next();
|
|
||||||
int from_tr_index = from_tr1->index();
|
|
||||||
margins_[from_tr_index].setValue(to_tr, setup_hold, margin);
|
margins_[from_tr_index].setValue(to_tr, setup_hold, margin);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DataCheck::removeMargin(const TransRiseFallBoth *from_tr,
|
DataCheck::removeMargin(const TransRiseFallBoth *from_tr,
|
||||||
const TransRiseFallBoth *to_tr,
|
const TransRiseFallBoth *to_tr,
|
||||||
const SetupHoldAll *setup_hold)
|
const SetupHoldAll *setup_hold)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator from_tr_iter(from_tr);
|
for (auto from_tr_index : from_tr->rangeIndex())
|
||||||
while (from_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *from_tr1 = from_tr_iter.next();
|
|
||||||
int from_tr_index = from_tr1->index();
|
|
||||||
margins_[from_tr_index].removeValue(to_tr, setup_hold);
|
margins_[from_tr_index].removeValue(to_tr, setup_hold);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DataCheck::empty() const
|
DataCheck::empty() const
|
||||||
{
|
{
|
||||||
TransRiseFallIterator from_tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (from_tr_iter.hasNext()) {
|
if (!margins_[tr_index].empty())
|
||||||
TransRiseFall *from_tr1 = from_tr_iter.next();
|
|
||||||
int from_tr_index = from_tr1->index();
|
|
||||||
if (!margins_[from_tr_index].empty())
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,9 @@ DeratingFactors::setFactor(PathClkOrData clk_data,
|
||||||
const EarlyLate *early_late,
|
const EarlyLate *early_late,
|
||||||
float factor)
|
float factor)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range())
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr1 = tr_iter.next();
|
|
||||||
factors_[int(clk_data)].setValue(tr1, early_late, factor);
|
factors_[int(clk_data)].setValue(tr1, early_late, factor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DeratingFactors::factor(PathClkOrData clk_data,
|
DeratingFactors::factor(PathClkOrData clk_data,
|
||||||
|
|
|
||||||
|
|
@ -21,26 +21,17 @@ namespace sta {
|
||||||
|
|
||||||
InputDrive::InputDrive()
|
InputDrive::InputDrive()
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto mm_index : MinMax::rangeIndex())
|
||||||
TransRiseFall *tr = tr_iter.next();
|
drive_cells_[tr_index][mm_index] = nullptr;
|
||||||
MinMaxIterator mm_iter;
|
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
drive_cells_[tr->index()][mm->index()] = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InputDrive::~InputDrive()
|
InputDrive::~InputDrive()
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto mm_index : MinMax::rangeIndex()) {
|
||||||
TransRiseFall *tr = tr_iter.next();
|
InputDriveCell *drive_cell = drive_cells_[tr_index][mm_index];
|
||||||
MinMaxIterator mm_iter;
|
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
InputDriveCell *drive_cell = drive_cells_[tr->index()][mm->index()];
|
|
||||||
delete drive_cell;
|
delete drive_cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -96,14 +87,8 @@ InputDrive::setDriveCell(LibertyLibrary *library,
|
||||||
const TransRiseFallBoth *tr,
|
const TransRiseFallBoth *tr,
|
||||||
const MinMaxAll *min_max)
|
const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr_index : tr->rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto mm_index : min_max->rangeIndex()) {
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
MinMaxIterator mm_iter(min_max);
|
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
int mm_index = mm->index();
|
|
||||||
InputDriveCell *drive = drive_cells_[tr_index][mm_index];
|
InputDriveCell *drive = drive_cells_[tr_index][mm_index];
|
||||||
if (drive) {
|
if (drive) {
|
||||||
drive->setLibrary(library);
|
drive->setLibrary(library);
|
||||||
|
|
@ -221,12 +206,8 @@ InputDriveCell::setToPort(LibertyPort *to_port)
|
||||||
void
|
void
|
||||||
InputDriveCell::setFromSlews(float *from_slews)
|
InputDriveCell::setFromSlews(float *from_slews)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator from_tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex())
|
||||||
while (from_tr_iter.hasNext()) {
|
from_slews_[tr_index] = from_slews[tr_index];
|
||||||
TransRiseFall *from_tr = from_tr_iter.next();
|
|
||||||
int from_index = from_tr->index();
|
|
||||||
from_slews_[from_index] = from_slews[from_index];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,7 @@ public:
|
||||||
void
|
void
|
||||||
setValue(TYPE value)
|
setValue(TYPE value)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto mm_index : MinMax::rangeIndex()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
int mm_index = mm->index();
|
|
||||||
values_[mm_index] = value;
|
values_[mm_index] = value;
|
||||||
exists_[mm_index] = true;
|
exists_[mm_index] = true;
|
||||||
}
|
}
|
||||||
|
|
@ -80,10 +77,7 @@ public:
|
||||||
setValue(const MinMaxAll *min_max,
|
setValue(const MinMaxAll *min_max,
|
||||||
TYPE value)
|
TYPE value)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm_index : min_max->rangeIndex()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
int mm_index = mm->index();
|
|
||||||
values_[mm_index] = value;
|
values_[mm_index] = value;
|
||||||
exists_[mm_index] = true;
|
exists_[mm_index] = true;
|
||||||
}
|
}
|
||||||
|
|
@ -142,13 +136,9 @@ public:
|
||||||
void
|
void
|
||||||
removeValue(const MinMaxAll *min_max)
|
removeValue(const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm_index : min_max->rangeIndex())
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
int mm_index = mm->index();
|
|
||||||
exists_[mm_index] = false;
|
exists_[mm_index] = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static bool equal(MinMaxValues *values1,
|
static bool equal(MinMaxValues *values1,
|
||||||
MinMaxValues *values2)
|
MinMaxValues *values2)
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,8 @@ RiseFallMinMax::setValue(const TransRiseFallBoth *tr,
|
||||||
const MinMaxAll *min_max,
|
const MinMaxAll *min_max,
|
||||||
float value)
|
float value)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr_index : tr->rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto mm_index : min_max->rangeIndex()) {
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
MinMaxIterator mm_iter(min_max);
|
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
int mm_index = mm->index();
|
|
||||||
values_[tr_index][mm_index] = value;
|
values_[tr_index][mm_index] = value;
|
||||||
exists_[tr_index][mm_index] = true;
|
exists_[tr_index][mm_index] = true;
|
||||||
}
|
}
|
||||||
|
|
@ -84,37 +78,25 @@ RiseFallMinMax::removeValue(const TransRiseFallBoth *tr,
|
||||||
const MinMax *min_max)
|
const MinMax *min_max)
|
||||||
{
|
{
|
||||||
int mm_index = min_max->index();
|
int mm_index = min_max->index();
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr_index : tr->rangeIndex())
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
exists_[tr_index][mm_index] = false;
|
exists_[tr_index][mm_index] = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RiseFallMinMax::removeValue(const TransRiseFallBoth *tr,
|
RiseFallMinMax::removeValue(const TransRiseFallBoth *tr,
|
||||||
const MinMaxAll *min_max)
|
const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm : min_max->range())
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
removeValue(tr, mm);
|
removeValue(tr, mm);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RiseFallMinMax::mergeValue(const TransRiseFallBoth *tr,
|
RiseFallMinMax::mergeValue(const TransRiseFallBoth *tr,
|
||||||
const MinMaxAll *min_max,
|
const MinMaxAll *min_max,
|
||||||
float value)
|
float value)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr_index : tr->rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto mm : min_max->range()) {
|
||||||
TransRiseFall *tr1 = tr_iter.next();
|
|
||||||
int tr_index = tr1->index();
|
|
||||||
MinMaxIterator mm_iter(min_max);
|
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
int mm_index = mm->index();
|
int mm_index = mm->index();
|
||||||
if (!exists_[tr_index][mm_index]
|
if (!exists_[tr_index][mm_index]
|
||||||
|| mm->compare(value, values_[tr_index][mm_index])) {
|
|| mm->compare(value, values_[tr_index][mm_index])) {
|
||||||
|
|
@ -131,10 +113,7 @@ RiseFallMinMax::setValue(const TransRiseFallBoth *tr,
|
||||||
float value)
|
float value)
|
||||||
{
|
{
|
||||||
int mm_index = min_max->index();
|
int mm_index = min_max->index();
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr_index : tr->rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
values_[tr_index][mm_index] = value;
|
values_[tr_index][mm_index] = value;
|
||||||
exists_[tr_index][mm_index] = true;
|
exists_[tr_index][mm_index] = true;
|
||||||
}
|
}
|
||||||
|
|
@ -206,11 +185,9 @@ RiseFallMinMax::hasValue(const TransRiseFall *tr, const MinMax *min_max) const
|
||||||
void
|
void
|
||||||
RiseFallMinMax::mergeWith(RiseFallMinMax *rfmm)
|
RiseFallMinMax::mergeWith(RiseFallMinMax *rfmm)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto min_max : MinMax::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *min_max = mm_iter.next();
|
|
||||||
int mm_index = min_max->index();
|
int mm_index = min_max->index();
|
||||||
for (int tr_index=0;tr_index<TransRiseFall::index_count;tr_index++) {
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
bool exists1 = exists_[tr_index][mm_index];
|
bool exists1 = exists_[tr_index][mm_index];
|
||||||
bool exists2 = rfmm->exists_[tr_index][mm_index];
|
bool exists2 = rfmm->exists_[tr_index][mm_index];
|
||||||
if (exists1 && exists2) {
|
if (exists1 && exists2) {
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,13 @@ RiseFallValues::RiseFallValues()
|
||||||
void
|
void
|
||||||
RiseFallValues::clear()
|
RiseFallValues::clear()
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex())
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
exists_[tr_index] = false;
|
exists_[tr_index] = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RiseFallValues::RiseFallValues(float init_value)
|
RiseFallValues::RiseFallValues(float init_value)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
values_[tr_index] = init_value;
|
values_[tr_index] = init_value;
|
||||||
exists_[tr_index] = true;
|
exists_[tr_index] = true;
|
||||||
}
|
}
|
||||||
|
|
@ -53,19 +46,18 @@ RiseFallValues::setValue(float value)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RiseFallValues::setValue(const TransRiseFallBoth *tr, float value)
|
RiseFallValues::setValue(const TransRiseFallBoth *tr,
|
||||||
|
float value)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr_index : tr->rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
values_[tr_index] = value;
|
values_[tr_index] = value;
|
||||||
exists_[tr_index] = true;
|
exists_[tr_index] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RiseFallValues::setValue(const TransRiseFall *tr, float value)
|
RiseFallValues::setValue(const TransRiseFall *tr,
|
||||||
|
float value)
|
||||||
{
|
{
|
||||||
int tr_index = tr->index();
|
int tr_index = tr->index();
|
||||||
values_[tr_index] = value;
|
values_[tr_index] = value;
|
||||||
|
|
@ -75,10 +67,7 @@ RiseFallValues::setValue(const TransRiseFall *tr, float value)
|
||||||
void
|
void
|
||||||
RiseFallValues::setValues(RiseFallValues *values)
|
RiseFallValues::setValues(RiseFallValues *values)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr_index : TransRiseFall::rangeIndex()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
int tr_index = tr->index();
|
|
||||||
values_[tr_index] = values->values_[tr_index];
|
values_[tr_index] = values->values_[tr_index];
|
||||||
exists_[tr_index] = values->exists_[tr_index];
|
exists_[tr_index] = values->exists_[tr_index];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
65
sdc/Sdc.cc
65
sdc/Sdc.cc
|
|
@ -328,10 +328,8 @@ Sdc::deleteInstancePvts()
|
||||||
// Multiple instances can share a pvt, so put them in a set
|
// Multiple instances can share a pvt, so put them in a set
|
||||||
// so they are only deleted once.
|
// so they are only deleted once.
|
||||||
PvtSet pvts;
|
PvtSet pvts;
|
||||||
MinMaxIterator mm_iter;
|
for (auto mm_index : MinMax::rangeIndex()) {
|
||||||
while (mm_iter.hasNext()) {
|
InstancePvtMap *pvt_map = instance_pvt_maps_[mm_index];
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
InstancePvtMap *pvt_map = instance_pvt_maps_[mm->index()];
|
|
||||||
InstancePvtMap::Iterator pvt_iter(pvt_map);
|
InstancePvtMap::Iterator pvt_iter(pvt_map);
|
||||||
while (pvt_iter.hasNext()) {
|
while (pvt_iter.hasNext()) {
|
||||||
Pvt *pvt = pvt_iter.next();
|
Pvt *pvt = pvt_iter.next();
|
||||||
|
|
@ -416,11 +414,8 @@ Sdc::removeLibertyAnnotations()
|
||||||
void
|
void
|
||||||
Sdc::initInstancePvtMaps()
|
Sdc::initInstancePvtMaps()
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto mm_index : MinMax::rangeIndex())
|
||||||
while (mm_iter.hasNext()) {
|
instance_pvt_maps_[mm_index] = nullptr;
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
instance_pvt_maps_[mm->index()] = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
@ -516,13 +511,9 @@ void
|
||||||
Sdc::setOperatingConditions(OperatingConditions *op_cond,
|
Sdc::setOperatingConditions(OperatingConditions *op_cond,
|
||||||
const MinMaxAll *min_max)
|
const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm_index : min_max->rangeIndex())
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
int mm_index = mm->index();
|
|
||||||
operating_conditions_[mm_index] = op_cond;
|
operating_conditions_[mm_index] = op_cond;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Sdc::setOperatingConditions(OperatingConditions *op_cond,
|
Sdc::setOperatingConditions(OperatingConditions *op_cond,
|
||||||
|
|
@ -555,9 +546,7 @@ Sdc::setPvt(Instance *inst, const
|
||||||
MinMaxAll *min_max,
|
MinMaxAll *min_max,
|
||||||
Pvt *pvt)
|
Pvt *pvt)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm_index : min_max->rangeIndex()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
int mm_index = mm_iter.next()->index();
|
|
||||||
InstancePvtMap *pvt_map = instance_pvt_maps_[mm_index];
|
InstancePvtMap *pvt_map = instance_pvt_maps_[mm_index];
|
||||||
if (pvt_map == nullptr) {
|
if (pvt_map == nullptr) {
|
||||||
pvt_map = new InstancePvtMap;
|
pvt_map = new InstancePvtMap;
|
||||||
|
|
@ -2691,11 +2680,8 @@ void
|
||||||
Sdc::setMinPulseWidth(const TransRiseFallBoth *tr,
|
Sdc::setMinPulseWidth(const TransRiseFallBoth *tr,
|
||||||
float min_width)
|
float min_width)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range())
|
||||||
while (tr_iter.hasNext()) {
|
min_pulse_width_.setValue(tr1, min_width);
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
min_pulse_width_.setValue(tr, min_width);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2708,11 +2694,8 @@ Sdc::setMinPulseWidth(const Pin *pin,
|
||||||
widths = new RiseFallValues;
|
widths = new RiseFallValues;
|
||||||
pin_min_pulse_width_map_[pin] = widths;
|
pin_min_pulse_width_map_[pin] = widths;
|
||||||
}
|
}
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range())
|
||||||
while (tr_iter.hasNext()) {
|
widths->setValue(tr1, min_width);
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
widths->setValue(tr, min_width);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2725,11 +2708,8 @@ Sdc::setMinPulseWidth(const Instance *inst,
|
||||||
widths = new RiseFallValues;
|
widths = new RiseFallValues;
|
||||||
inst_min_pulse_width_map_[inst] = widths;
|
inst_min_pulse_width_map_[inst] = widths;
|
||||||
}
|
}
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range())
|
||||||
while (tr_iter.hasNext()) {
|
widths->setValue(tr1, min_width);
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
widths->setValue(tr, min_width);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2742,11 +2722,8 @@ Sdc::setMinPulseWidth(const Clock *clk,
|
||||||
widths = new RiseFallValues;
|
widths = new RiseFallValues;
|
||||||
clk_min_pulse_width_map_[clk] = widths;
|
clk_min_pulse_width_map_[clk] = widths;
|
||||||
}
|
}
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range())
|
||||||
while (tr_iter.hasNext()) {
|
widths->setValue(tr1, min_width);
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
widths->setValue(tr, min_width);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -5905,11 +5882,8 @@ void
|
||||||
Sdc::setWireload(Wireload *wireload,
|
Sdc::setWireload(Wireload *wireload,
|
||||||
const MinMaxAll *min_max)
|
const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm_index : min_max->rangeIndex())
|
||||||
while (mm_iter.hasNext()) {
|
wireload_[mm_index] = wireload;
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
wireload_[mm->index()] = wireload;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -5946,11 +5920,8 @@ void
|
||||||
Sdc::setWireloadSelection(WireloadSelection *selection,
|
Sdc::setWireloadSelection(WireloadSelection *selection,
|
||||||
const MinMaxAll *min_max)
|
const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm_index : min_max->rangeIndex())
|
||||||
while (mm_iter.hasNext()) {
|
wireload_selection_[mm_index] = selection;
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
wireload_selection_[mm->index()] = selection;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
|
||||||
|
|
@ -687,15 +687,9 @@ writeInterClockUncertainty(InterClockUncertainty *uncertainty) const
|
||||||
fprintf(stream_, "\n");
|
fprintf(stream_, "\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TransRiseFallIterator src_tr_iter;
|
for (auto src_tr : TransRiseFall::range()) {
|
||||||
while (src_tr_iter.hasNext()) {
|
for (auto tgt_tr : TransRiseFall::range()) {
|
||||||
const TransRiseFall *src_tr = src_tr_iter.next();
|
for (auto setup_hold : SetupHold::range()) {
|
||||||
TransRiseFallIterator tgt_tr_iter;
|
|
||||||
while (tgt_tr_iter.hasNext()) {
|
|
||||||
const TransRiseFall *tgt_tr = tgt_tr_iter.next();
|
|
||||||
MinMaxIterator sh_iter;
|
|
||||||
while (sh_iter.hasNext()) {
|
|
||||||
const SetupHold *setup_hold = sh_iter.next();
|
|
||||||
float value;
|
float value;
|
||||||
bool exists;
|
bool exists;
|
||||||
sdc_->clockUncertainty(src_clk, src_tr, tgt_clk, tgt_tr,
|
sdc_->clockUncertainty(src_clk, src_tr, tgt_clk, tgt_tr,
|
||||||
|
|
@ -1500,9 +1494,7 @@ WriteSdc::writeDataChecks() const
|
||||||
void
|
void
|
||||||
WriteSdc::writeDataCheck(DataCheck *check) const
|
WriteSdc::writeDataCheck(DataCheck *check) const
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto setup_hold : SetupHold::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
SetupHold *setup_hold = mm_iter.next();
|
|
||||||
float margin;
|
float margin;
|
||||||
bool one_value;
|
bool one_value;
|
||||||
check->marginIsOneValue(setup_hold, margin, one_value);
|
check->marginIsOneValue(setup_hold, margin, one_value);
|
||||||
|
|
@ -1510,12 +1502,8 @@ WriteSdc::writeDataCheck(DataCheck *check) const
|
||||||
writeDataCheck(check, TransRiseFallBoth::riseFall(),
|
writeDataCheck(check, TransRiseFallBoth::riseFall(),
|
||||||
TransRiseFallBoth::riseFall(), setup_hold, margin);
|
TransRiseFallBoth::riseFall(), setup_hold, margin);
|
||||||
else {
|
else {
|
||||||
TransRiseFallIterator from_tr_iter;
|
for (auto from_tr : TransRiseFall::range()) {
|
||||||
while (from_tr_iter.hasNext()) {
|
for (auto to_tr : TransRiseFall::range()) {
|
||||||
TransRiseFall *from_tr = from_tr_iter.next();
|
|
||||||
TransRiseFallIterator to_tr_iter;
|
|
||||||
while (to_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *to_tr = to_tr_iter.next();
|
|
||||||
float margin;
|
float margin;
|
||||||
bool margin_exists;
|
bool margin_exists;
|
||||||
check->margin(from_tr, to_tr, setup_hold, margin, margin_exists);
|
check->margin(from_tr, to_tr, setup_hold, margin, margin_exists);
|
||||||
|
|
@ -1627,9 +1615,7 @@ WriteSdc::writeDriveResistances() const
|
||||||
Port *port = port_iter->next();
|
Port *port = port_iter->next();
|
||||||
InputDrive *drive = sdc_->findInputDrive(port);
|
InputDrive *drive = sdc_->findInputDrive(port);
|
||||||
if (drive) {
|
if (drive) {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
const TransRiseFall *tr = tr_iter.next();
|
|
||||||
if (drive->driveResistanceMinMaxEqual(tr)) {
|
if (drive->driveResistanceMinMaxEqual(tr)) {
|
||||||
float res;
|
float res;
|
||||||
bool exists;
|
bool exists;
|
||||||
|
|
@ -1642,16 +1628,14 @@ WriteSdc::writeDriveResistances() const
|
||||||
fprintf(stream_, "\n");
|
fprintf(stream_, "\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MinMaxIterator mm_iter;
|
for (auto min_max : MinMax::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
const MinMax *mm = mm_iter.next();
|
|
||||||
float res;
|
float res;
|
||||||
bool exists;
|
bool exists;
|
||||||
drive->driveResistance(tr, mm, res, exists);
|
drive->driveResistance(tr, min_max, res, exists);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
fprintf(stream_, "set_drive %s %s ",
|
fprintf(stream_, "set_drive %s %s ",
|
||||||
transRiseFallFlag(tr),
|
transRiseFallFlag(tr),
|
||||||
minMaxFlag(mm));
|
minMaxFlag(min_max));
|
||||||
writeResistance(res);
|
writeResistance(res);
|
||||||
fprintf(stream_, " ");
|
fprintf(stream_, " ");
|
||||||
writeGetPort(port);
|
writeGetPort(port);
|
||||||
|
|
@ -1929,9 +1913,7 @@ WriteSdc::writeDeratings() const
|
||||||
DeratingFactorsNet *factors;
|
DeratingFactorsNet *factors;
|
||||||
net_iter.next(net, factors);
|
net_iter.next(net, factors);
|
||||||
WriteGetNet write_net(net, this);
|
WriteGetNet write_net(net, this);
|
||||||
MinMaxIterator mm_iter;
|
for (auto early_late : EarlyLate::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
const MinMax *early_late = mm_iter.next();
|
|
||||||
writeDerating(factors, TimingDerateType::net_delay, early_late,
|
writeDerating(factors, TimingDerateType::net_delay, early_late,
|
||||||
&write_net);
|
&write_net);
|
||||||
}
|
}
|
||||||
|
|
@ -1959,10 +1941,7 @@ WriteSdc::writeDeratings() const
|
||||||
void
|
void
|
||||||
WriteSdc::writeDerating(DeratingFactorsGlobal *factors) const
|
WriteSdc::writeDerating(DeratingFactorsGlobal *factors) const
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto early_late : EarlyLate::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
const MinMax *early_late = mm_iter.next();
|
|
||||||
|
|
||||||
bool delay_is_one_value, check_is_one_value, net_is_one_value;
|
bool delay_is_one_value, check_is_one_value, net_is_one_value;
|
||||||
float delay_value, check_value, net_value;
|
float delay_value, check_value, net_value;
|
||||||
factors->factors(TimingDerateType::cell_delay)->isOneValue(early_late,
|
factors->factors(TimingDerateType::cell_delay)->isOneValue(early_late,
|
||||||
|
|
@ -2001,9 +1980,7 @@ void
|
||||||
WriteSdc::writeDerating(DeratingFactorsCell *factors,
|
WriteSdc::writeDerating(DeratingFactorsCell *factors,
|
||||||
WriteSdcObject *write_obj) const
|
WriteSdcObject *write_obj) const
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto early_late : EarlyLate::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
const MinMax *early_late = mm_iter.next();
|
|
||||||
DeratingFactors *delay_factors=factors->factors(TimingDerateType::cell_delay);
|
DeratingFactors *delay_factors=factors->factors(TimingDerateType::cell_delay);
|
||||||
writeDerating(delay_factors, TimingDerateType::cell_delay, early_late, write_obj);
|
writeDerating(delay_factors, TimingDerateType::cell_delay, early_late, write_obj);
|
||||||
DeratingFactors *check_factors=factors->factors(TimingDerateType::cell_check);
|
DeratingFactors *check_factors=factors->factors(TimingDerateType::cell_check);
|
||||||
|
|
@ -2057,10 +2034,7 @@ WriteSdc::writeDerating(DeratingFactors *factors,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
MinMaxIterator mm_iter;
|
|
||||||
float factor;
|
float factor;
|
||||||
bool exists;
|
bool exists;
|
||||||
factors->factor(clk_data, tr, early_late, factor, exists);
|
factors->factor(clk_data, tr, early_late, factor, exists);
|
||||||
|
|
|
||||||
|
|
@ -403,9 +403,7 @@ ReportAnnotated::findWidthPeriodCount(Pin *pin)
|
||||||
|
|
||||||
int width_index = TimingRole::width()->index();
|
int width_index = TimingRole::width()->index();
|
||||||
if (report_role_[width_index]) {
|
if (report_role_[width_index]) {
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto hi_low : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *hi_low = tr_iter.next();
|
|
||||||
port->minPulseWidth(hi_low, value, exists);
|
port->minPulseWidth(hi_low, value, exists);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
edge_count_[width_index]++;
|
edge_count_[width_index]++;
|
||||||
|
|
@ -559,9 +557,7 @@ ReportAnnotated::reportWidthPeriodArcs(Pin *pin,
|
||||||
if (report_role_[width_index]
|
if (report_role_[width_index]
|
||||||
&& (max_lines_ == 0 || i < max_lines_)) {
|
&& (max_lines_ == 0 || i < max_lines_)) {
|
||||||
bool report = false;
|
bool report = false;
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto hi_low : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *hi_low = tr_iter.next();
|
|
||||||
port->minPulseWidth(hi_low, value, exists);
|
port->minPulseWidth(hi_low, value, exists);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
edge_count_[width_index]++;
|
edge_count_[width_index]++;
|
||||||
|
|
|
||||||
|
|
@ -503,9 +503,7 @@ SdfWriter::writeTimingChecks(const Instance *inst,
|
||||||
writeCheck(edge, sdf_check);
|
writeCheck(edge, sdf_check);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto hi_low : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *hi_low = tr_iter.next();
|
|
||||||
float min_width, max_width;
|
float min_width, max_width;
|
||||||
bool exists;
|
bool exists;
|
||||||
graph_delay_calc_->minPulseWidth(pin, hi_low, arc_delay_min_index_,
|
graph_delay_calc_->minPulseWidth(pin, hi_low, arc_delay_min_index_,
|
||||||
|
|
|
||||||
|
|
@ -116,10 +116,8 @@ CheckSlewLimits::checkSlews(const Pin *pin,
|
||||||
checkSlews1(pin, corner, min_max,
|
checkSlews1(pin, corner, min_max,
|
||||||
corner1, tr, slew, limit, slack);
|
corner1, tr, slew, limit, slack);
|
||||||
else {
|
else {
|
||||||
CornerIterator corner_iter(sta_);
|
for (auto corner : *sta_->corners()) {
|
||||||
while (corner_iter.hasNext()) {
|
checkSlews1(pin, corner, min_max,
|
||||||
const Corner *corner2 = corner_iter.next();
|
|
||||||
checkSlews1(pin, corner2, min_max,
|
|
||||||
corner1, tr, slew, limit, slack);
|
corner1, tr, slew, limit, slack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,9 +154,7 @@ CheckSlewLimits::checkSlews1(Vertex *vertex,
|
||||||
float &limit,
|
float &limit,
|
||||||
float &slack) const
|
float &slack) const
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr1 : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr1 = tr_iter.next();
|
|
||||||
float limit1;
|
float limit1;
|
||||||
bool limit1_exists;
|
bool limit1_exists;
|
||||||
findLimit(vertex->pin(), vertex, tr1, min_max, limit1, limit1_exists);
|
findLimit(vertex->pin(), vertex, tr1, min_max, limit1, limit1_exists);
|
||||||
|
|
|
||||||
|
|
@ -124,14 +124,12 @@ Corners::makeParasiticAnalysisPtsMinMax()
|
||||||
parasitics_->deleteParasitics();
|
parasitics_->deleteParasitics();
|
||||||
parasitic_analysis_pts_.deleteContentsClear();
|
parasitic_analysis_pts_.deleteContentsClear();
|
||||||
parasitic_analysis_pts_.resize(MinMax::index_count);
|
parasitic_analysis_pts_.resize(MinMax::index_count);
|
||||||
MinMaxIterator mm_iter;
|
for (auto min_max : MinMax::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
int mm_index = min_max->index();
|
||||||
MinMax *min_max = mm_iter.next();
|
|
||||||
int index = min_max->index();
|
|
||||||
ParasiticAnalysisPt *ap = new ParasiticAnalysisPt(min_max->asString(),
|
ParasiticAnalysisPt *ap = new ParasiticAnalysisPt(min_max->asString(),
|
||||||
index,
|
mm_index,
|
||||||
min_max);
|
min_max);
|
||||||
parasitic_analysis_pts_[index] = ap;
|
parasitic_analysis_pts_[mm_index] = ap;
|
||||||
}
|
}
|
||||||
updateCornerParasiticAnalysisPts();
|
updateCornerParasiticAnalysisPts();
|
||||||
}
|
}
|
||||||
|
|
@ -461,25 +459,6 @@ CornerIterator::next()
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ParasiticAnalysisPtIterator::ParasiticAnalysisPtIterator(const StaState *sta) :
|
|
||||||
ap_iter_(sta->corners()->parasiticAnalysisPts())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ParasiticAnalysisPtIterator::hasNext()
|
|
||||||
{
|
|
||||||
return ap_iter_.hasNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
ParasiticAnalysisPt *
|
|
||||||
ParasiticAnalysisPtIterator::next()
|
|
||||||
{
|
|
||||||
return ap_iter_.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
DcalcAnalysisPtIterator::DcalcAnalysisPtIterator(const StaState *sta) :
|
DcalcAnalysisPtIterator::DcalcAnalysisPtIterator(const StaState *sta) :
|
||||||
ap_iter_(sta->corners()->dcalcAnalysisPts())
|
ap_iter_(sta->corners()->dcalcAnalysisPts())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,11 @@ public:
|
||||||
PathAnalysisPt *findPathAnalysisPt(PathAPIndex path_index) const;
|
PathAnalysisPt *findPathAnalysisPt(PathAPIndex path_index) const;
|
||||||
PathAnalysisPtSeq &pathAnalysisPts();
|
PathAnalysisPtSeq &pathAnalysisPts();
|
||||||
const PathAnalysisPtSeq &pathAnalysisPts() const;
|
const PathAnalysisPtSeq &pathAnalysisPts() const;
|
||||||
|
CornerSeq &corners() { return corners_; }
|
||||||
|
// Iterators for range iteration.
|
||||||
|
// for (auto corner : *sta->corners()) {}
|
||||||
|
CornerSeq::iterator begin() { return corners_.begin(); }
|
||||||
|
CornerSeq::iterator end() { return corners_.end(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void makeAnalysisPts();
|
void makeAnalysisPts();
|
||||||
|
|
@ -81,7 +86,6 @@ protected:
|
||||||
bool swap_clk_min_max,
|
bool swap_clk_min_max,
|
||||||
DcalcAnalysisPt *dcalc_ap_min,
|
DcalcAnalysisPt *dcalc_ap_min,
|
||||||
DcalcAnalysisPt *dcalc_ap_max);
|
DcalcAnalysisPt *dcalc_ap_max);
|
||||||
CornerSeq &corners() { return corners_; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CornerMap corner_map_;
|
CornerMap corner_map_;
|
||||||
|
|
@ -90,7 +94,6 @@ private:
|
||||||
DcalcAnalysisPtSeq dcalc_analysis_pts_;
|
DcalcAnalysisPtSeq dcalc_analysis_pts_;
|
||||||
PathAnalysisPtSeq path_analysis_pts_;
|
PathAnalysisPtSeq path_analysis_pts_;
|
||||||
|
|
||||||
friend class CornerIterator;
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Corners);
|
DISALLOW_COPY_AND_ASSIGN(Corners);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -130,6 +133,8 @@ private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(Corner);
|
DISALLOW_COPY_AND_ASSIGN(Corner);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Obsolete. Use range iterator.
|
||||||
|
// for (auto corner : *sta->corners()) {}
|
||||||
class CornerIterator : public Iterator<Corner*>
|
class CornerIterator : public Iterator<Corner*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -145,21 +150,8 @@ private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(CornerIterator);
|
DISALLOW_COPY_AND_ASSIGN(CornerIterator);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ParasiticAnalysisPtIterator : public Iterator<ParasiticAnalysisPt*>
|
// Obsolete. Use range iterator.
|
||||||
{
|
// for (auto dcalc_ap : sta->corners()->dcalcAnalysisPts()) {}
|
||||||
public:
|
|
||||||
explicit ParasiticAnalysisPtIterator(const StaState *sta);
|
|
||||||
virtual ~ParasiticAnalysisPtIterator() {}
|
|
||||||
virtual bool hasNext();
|
|
||||||
virtual ParasiticAnalysisPt *next();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
ParasiticAnalysisPtSeq::ConstIterator ap_iter_;
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ParasiticAnalysisPtIterator);
|
|
||||||
};
|
|
||||||
|
|
||||||
class DcalcAnalysisPtIterator : public Iterator<DcalcAnalysisPt*>
|
class DcalcAnalysisPtIterator : public Iterator<DcalcAnalysisPt*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -175,6 +167,8 @@ private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(DcalcAnalysisPtIterator);
|
DISALLOW_COPY_AND_ASSIGN(DcalcAnalysisPtIterator);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Obsolete. Use range iterator.
|
||||||
|
// for (auto path_ap : sta->corners()->pathAnalysisPts()) {}
|
||||||
class PathAnalysisPtIterator : public Iterator<PathAnalysisPt*>
|
class PathAnalysisPtIterator : public Iterator<PathAnalysisPt*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -727,14 +727,10 @@ Genclks::seedSrcPins(Clock *gclk,
|
||||||
TagGroupBldr tag_bldr(true, this);
|
TagGroupBldr tag_bldr(true, this);
|
||||||
tag_bldr.init(vertex);
|
tag_bldr.init(vertex);
|
||||||
copyGenClkSrcPaths(vertex, &tag_bldr);
|
copyGenClkSrcPaths(vertex, &tag_bldr);
|
||||||
PathAnalysisPtIterator path_ap_iter(this);
|
for (auto path_ap : corners_->pathAnalysisPts()) {
|
||||||
while (path_ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = path_ap_iter.next();
|
|
||||||
const MinMax *min_max = path_ap->pathMinMax();
|
const MinMax *min_max = path_ap->pathMinMax();
|
||||||
const EarlyLate *early_late = min_max;
|
const EarlyLate *early_late = min_max;
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
Tag *tag = makeTag(gclk, master_clk, master_pin, tr, src_filter,
|
Tag *tag = makeTag(gclk, master_clk, master_pin, tr, src_filter,
|
||||||
path_ap);
|
path_ap);
|
||||||
Arrival insert = search_->clockInsertion(master_clk, master_pin, tr,
|
Arrival insert = search_->clockInsertion(master_clk, master_pin, tr,
|
||||||
|
|
@ -1147,12 +1143,8 @@ Genclks::seedPllPin(const Clock *gclk,
|
||||||
TagGroupBldr tag_bldr(true, this);
|
TagGroupBldr tag_bldr(true, this);
|
||||||
tag_bldr.init(vertex);
|
tag_bldr.init(vertex);
|
||||||
copyGenClkSrcPaths(vertex, &tag_bldr);
|
copyGenClkSrcPaths(vertex, &tag_bldr);
|
||||||
PathAnalysisPtIterator path_ap_iter(this);
|
for (auto path_ap : corners_->pathAnalysisPts()) {
|
||||||
while (path_ap_iter.hasNext()) {
|
for (auto tr : TransRiseFall::range()) {
|
||||||
PathAnalysisPt *path_ap = path_ap_iter.next();
|
|
||||||
TransRiseFallIterator tr_iter;
|
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
Tag *tag = makeTag(gclk, gclk, pll_out_pin, tr, pll_filter, path_ap);
|
Tag *tag = makeTag(gclk, gclk, pll_out_pin, tr, pll_filter, path_ap);
|
||||||
tag_bldr.setArrival(tag, 0.0, nullptr);
|
tag_bldr.setArrival(tag, 0.0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -325,10 +325,7 @@ PathGroups::makeGroups(int group_count,
|
||||||
|
|
||||||
PathGroups::~PathGroups()
|
PathGroups::~PathGroups()
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto mm_index : MinMax::rangeIndex()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *min_max = mm_iter.next();
|
|
||||||
int mm_index = min_max->index();
|
|
||||||
named_map_[mm_index].deleteContents();
|
named_map_[mm_index].deleteContents();
|
||||||
clk_map_[mm_index].deleteContents();
|
clk_map_[mm_index].deleteContents();
|
||||||
delete path_delay_[mm_index];
|
delete path_delay_[mm_index];
|
||||||
|
|
@ -425,9 +422,7 @@ PathGroups::groupPathTo(const PathEnd *path_end) const
|
||||||
void
|
void
|
||||||
PathGroups::pushGroupPathEnds(PathEndSeq *path_ends)
|
PathGroups::pushGroupPathEnds(PathEndSeq *path_ends)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter;
|
for (auto min_max : MinMax::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *min_max = mm_iter.next();
|
|
||||||
int mm_index = min_max->index();
|
int mm_index = min_max->index();
|
||||||
GroupPathIterator group_path_iter(sdc_);
|
GroupPathIterator group_path_iter(sdc_);
|
||||||
while (group_path_iter.hasNext()) {
|
while (group_path_iter.hasNext()) {
|
||||||
|
|
@ -465,9 +460,7 @@ PathGroups::pushUnconstrainedPathEnds(PathEndSeq *path_ends,
|
||||||
const MinMaxAll *min_max)
|
const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
Set<PathGroup *> groups;
|
Set<PathGroup *> groups;
|
||||||
PathAnalysisPtIterator path_ap_iter(this);
|
for (auto path_ap : corners_->pathAnalysisPts()) {
|
||||||
while (path_ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = path_ap_iter.next();
|
|
||||||
const MinMax *path_min_max = path_ap->pathMinMax();
|
const MinMax *path_min_max = path_ap->pathMinMax();
|
||||||
if (min_max->matches(path_min_max)) {
|
if (min_max->matches(path_min_max)) {
|
||||||
int mm_index = path_min_max->index();
|
int mm_index = path_min_max->index();
|
||||||
|
|
@ -744,9 +737,7 @@ PathGroups::makeGroupPathEnds(ExceptionTo *to,
|
||||||
MakePathEndsAll make_path_ends(endpoint_count, this);
|
MakePathEndsAll make_path_ends(endpoint_count, this);
|
||||||
makeGroupPathEnds(to, corner, min_max, &make_path_ends);
|
makeGroupPathEnds(to, corner, min_max, &make_path_ends);
|
||||||
|
|
||||||
MinMaxIterator mm_iter;
|
for (auto path_min_max : MinMax::range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
const MinMax *path_min_max = mm_iter.next();
|
|
||||||
int mm_index = path_min_max->index();
|
int mm_index = path_min_max->index();
|
||||||
GroupPathIterator group_path_iter(sdc_);
|
GroupPathIterator group_path_iter(sdc_);
|
||||||
while (group_path_iter.hasNext()) {
|
while (group_path_iter.hasNext()) {
|
||||||
|
|
|
||||||
|
|
@ -590,9 +590,7 @@ Power::findInternalPower(const Pin *to_pin,
|
||||||
else
|
else
|
||||||
duty = 0.5;
|
duty = 0.5;
|
||||||
float port_energy = 0.0;
|
float port_energy = 0.0;
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto to_tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *to_tr = tr_iter.next();
|
|
||||||
// Should use unateness to find from_tr.
|
// Should use unateness to find from_tr.
|
||||||
TransRiseFall *from_tr = to_tr;
|
TransRiseFall *from_tr = to_tr;
|
||||||
float slew = delayAsFloat(graph_->slew(from_vertex,
|
float slew = delayAsFloat(graph_->slew(from_vertex,
|
||||||
|
|
|
||||||
|
|
@ -863,9 +863,7 @@ edgeDelayProperty(Edge *edge,
|
||||||
TimingArc *arc = arc_iter.next();
|
TimingArc *arc = arc_iter.next();
|
||||||
TransRiseFall *to_tr = arc->toTrans()->asRiseFall();
|
TransRiseFall *to_tr = arc->toTrans()->asRiseFall();
|
||||||
if (to_tr == tr) {
|
if (to_tr == tr) {
|
||||||
CornerIterator corner_iter(sta);
|
for (auto corner : *sta->corners()) {
|
||||||
while (corner_iter.hasNext()) {
|
|
||||||
Corner *corner = corner_iter.next();
|
|
||||||
DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(min_max);
|
DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(min_max);
|
||||||
ArcDelay arc_delay = sta->arcDelay(edge, arc, dcalc_ap);
|
ArcDelay arc_delay = sta->arcDelay(edge, arc, dcalc_ap);
|
||||||
if (!delay_exists
|
if (!delay_exists
|
||||||
|
|
|
||||||
|
|
@ -1483,13 +1483,9 @@ Search::seedClkArrivals(const Pin *pin,
|
||||||
for (auto clk : *sdc_->findVertexPinClocks(pin)) {
|
for (auto clk : *sdc_->findVertexPinClocks(pin)) {
|
||||||
debugPrint2(debug_, "search", 2, "arrival seed clk %s pin %s\n",
|
debugPrint2(debug_, "search", 2, "arrival seed clk %s pin %s\n",
|
||||||
clk->name(), network_->pathName(pin));
|
clk->name(), network_->pathName(pin));
|
||||||
PathAnalysisPtIterator path_ap_iter(this);
|
for (auto path_ap : corners_->pathAnalysisPts()) {
|
||||||
while (path_ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = path_ap_iter.next();
|
|
||||||
const MinMax *min_max = path_ap->pathMinMax();
|
const MinMax *min_max = path_ap->pathMinMax();
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
ClockEdge *clk_edge = clk->edge(tr);
|
ClockEdge *clk_edge = clk->edge(tr);
|
||||||
const EarlyLate *early_late = min_max;
|
const EarlyLate *early_late = min_max;
|
||||||
if (clk->isGenerated()
|
if (clk->isGenerated()
|
||||||
|
|
@ -1606,13 +1602,9 @@ Search::makeUnclkedPaths(Vertex *vertex,
|
||||||
{
|
{
|
||||||
bool search_from = false;
|
bool search_from = false;
|
||||||
const Pin *pin = vertex->pin();
|
const Pin *pin = vertex->pin();
|
||||||
PathAnalysisPtIterator path_ap_iter(this);
|
for (auto path_ap : corners_->pathAnalysisPts()) {
|
||||||
while (path_ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = path_ap_iter.next();
|
|
||||||
const MinMax *min_max = path_ap->pathMinMax();
|
const MinMax *min_max = path_ap->pathMinMax();
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
Tag *tag = fromUnclkedInputTag(pin, tr, min_max, path_ap,
|
Tag *tag = fromUnclkedInputTag(pin, tr, min_max, path_ap,
|
||||||
is_segment_start);
|
is_segment_start);
|
||||||
if (tag) {
|
if (tag) {
|
||||||
|
|
@ -1781,9 +1773,7 @@ Search::seedInputDelayArrival(const Pin *pin,
|
||||||
clk_edge = sdc_->defaultArrivalClockEdge();
|
clk_edge = sdc_->defaultArrivalClockEdge();
|
||||||
if (ref_pin) {
|
if (ref_pin) {
|
||||||
Vertex *ref_vertex = graph_->pinLoadVertex(ref_pin);
|
Vertex *ref_vertex = graph_->pinLoadVertex(ref_pin);
|
||||||
PathAnalysisPtIterator path_ap_iter(this);
|
for (auto path_ap : corners_->pathAnalysisPts()) {
|
||||||
while (path_ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = path_ap_iter.next();
|
|
||||||
const MinMax *min_max = path_ap->pathMinMax();
|
const MinMax *min_max = path_ap->pathMinMax();
|
||||||
TransRiseFall *ref_tr = input_delay->refTransition();
|
TransRiseFall *ref_tr = input_delay->refTransition();
|
||||||
const Clock *clk = input_delay->clock();
|
const Clock *clk = input_delay->clock();
|
||||||
|
|
@ -1804,9 +1794,7 @@ Search::seedInputDelayArrival(const Pin *pin,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PathAnalysisPtIterator path_ap_iter(this);
|
for (auto path_ap : corners_->pathAnalysisPts()) {
|
||||||
while (path_ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = path_ap_iter.next();
|
|
||||||
const MinMax *min_max = path_ap->pathMinMax();
|
const MinMax *min_max = path_ap->pathMinMax();
|
||||||
float clk_arrival, clk_insertion, clk_latency;
|
float clk_arrival, clk_insertion, clk_latency;
|
||||||
inputDelayClkArrival(input_delay, clk_edge, min_max, path_ap,
|
inputDelayClkArrival(input_delay, clk_edge, min_max, path_ap,
|
||||||
|
|
@ -1859,9 +1847,7 @@ Search::seedInputDelayArrival(const Pin *pin,
|
||||||
PathAnalysisPt *path_ap,
|
PathAnalysisPt *path_ap,
|
||||||
TagGroupBldr *tag_bldr)
|
TagGroupBldr *tag_bldr)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
if (input_delay) {
|
if (input_delay) {
|
||||||
float delay;
|
float delay;
|
||||||
bool exists;
|
bool exists;
|
||||||
|
|
@ -3671,9 +3657,7 @@ Search::totalNegativeSlack(const MinMax *min_max)
|
||||||
{
|
{
|
||||||
tnsPreamble();
|
tnsPreamble();
|
||||||
Slack tns = 0.0;
|
Slack tns = 0.0;
|
||||||
CornerIterator corner_iter(this);
|
for (auto corner : *corners_) {
|
||||||
while (corner_iter.hasNext()) {
|
|
||||||
Corner *corner = corner_iter.next();
|
|
||||||
PathAPIndex path_ap_index = corner->findPathAnalysisPt(min_max)->index();
|
PathAPIndex path_ap_index = corner->findPathAnalysisPt(min_max)->index();
|
||||||
Slack tns1 = tns_[path_ap_index];
|
Slack tns1 = tns_[path_ap_index];
|
||||||
if (tns1 < tns)
|
if (tns1 < tns)
|
||||||
|
|
|
||||||
|
|
@ -224,11 +224,6 @@ void
|
||||||
initSta()
|
initSta()
|
||||||
{
|
{
|
||||||
initElapsedTime();
|
initElapsedTime();
|
||||||
MinMax::init();
|
|
||||||
MinMaxAll::init();
|
|
||||||
TransRiseFall::init();
|
|
||||||
TransRiseFallBoth::init();
|
|
||||||
Transition::init();
|
|
||||||
TimingRole::init();
|
TimingRole::init();
|
||||||
PortDirection::init();
|
PortDirection::init();
|
||||||
initTmpStrings();
|
initTmpStrings();
|
||||||
|
|
@ -251,11 +246,6 @@ deleteAllMemory()
|
||||||
}
|
}
|
||||||
deleteDelayCalcs();
|
deleteDelayCalcs();
|
||||||
deleteTmpStrings();
|
deleteTmpStrings();
|
||||||
MinMax::destroy();
|
|
||||||
MinMaxAll::destroy();
|
|
||||||
TransRiseFall::destroy();
|
|
||||||
TransRiseFallBoth::destroy();
|
|
||||||
Transition::destroy();
|
|
||||||
TimingRole::destroy();
|
TimingRole::destroy();
|
||||||
PortDirection::destroy();
|
PortDirection::destroy();
|
||||||
deleteLiberty();
|
deleteLiberty();
|
||||||
|
|
@ -3060,9 +3050,7 @@ Sta::vertexSlew(Vertex *vertex,
|
||||||
{
|
{
|
||||||
findDelays(vertex);
|
findDelays(vertex);
|
||||||
Slew mm_slew = min_max->initValue();
|
Slew mm_slew = min_max->initValue();
|
||||||
DcalcAnalysisPtIterator dcalc_ap_iter(this);
|
for (auto dcalc_ap : corners_->dcalcAnalysisPts()) {
|
||||||
while (dcalc_ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = dcalc_ap_iter.next();
|
|
||||||
Slew slew = graph_->slew(vertex, tr, dcalc_ap->index());
|
Slew slew = graph_->slew(vertex, tr, dcalc_ap->index());
|
||||||
if (fuzzyGreater(slew, mm_slew, min_max))
|
if (fuzzyGreater(slew, mm_slew, min_max))
|
||||||
mm_slew = slew;
|
mm_slew = slew;
|
||||||
|
|
@ -3214,9 +3202,7 @@ Sta::setArcDelay(Edge *edge,
|
||||||
const MinMaxAll *min_max,
|
const MinMaxAll *min_max,
|
||||||
ArcDelay delay)
|
ArcDelay delay)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm : min_max->range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(mm);
|
const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(mm);
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
graph_->setArcDelay(edge, arc, ap_index, delay);
|
graph_->setArcDelay(edge, arc, ap_index, delay);
|
||||||
|
|
@ -3238,14 +3224,10 @@ Sta::setAnnotatedSlew(Vertex *vertex,
|
||||||
const TransRiseFallBoth *tr,
|
const TransRiseFallBoth *tr,
|
||||||
float slew)
|
float slew)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm : min_max->range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(mm);
|
const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(mm);
|
||||||
DcalcAPIndex ap_index = dcalc_ap->index();
|
DcalcAPIndex ap_index = dcalc_ap->index();
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range()) {
|
||||||
while (tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *tr1 = tr_iter.next();
|
|
||||||
graph_->setSlew(vertex, tr1, ap_index, slew);
|
graph_->setSlew(vertex, tr1, ap_index, slew);
|
||||||
// Don't let delay calculation clobber the value.
|
// Don't let delay calculation clobber the value.
|
||||||
vertex->setSlewAnnotated(true, tr1, ap_index);
|
vertex->setSlewAnnotated(true, tr1, ap_index);
|
||||||
|
|
@ -3307,12 +3289,8 @@ Sta::setPortExtPinCap(Port *port,
|
||||||
const MinMaxAll *min_max,
|
const MinMaxAll *min_max,
|
||||||
float cap)
|
float cap)
|
||||||
{
|
{
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto mm : min_max->range()) {
|
||||||
TransRiseFall *tr1 = tr_iter.next();
|
|
||||||
MinMaxIterator mm_iter(min_max);
|
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
sdc_->setPortExtPinCap(port, tr1, mm, cap);
|
sdc_->setPortExtPinCap(port, tr1, mm, cap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3345,12 +3323,8 @@ Sta::setPortExtWireCap(Port *port,
|
||||||
float cap)
|
float cap)
|
||||||
{
|
{
|
||||||
Corner *corner = cmd_corner_;
|
Corner *corner = cmd_corner_;
|
||||||
TransRiseFallIterator tr_iter(tr);
|
for (auto tr1 : tr->range()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto mm : min_max->range()) {
|
||||||
TransRiseFall *tr1 = tr_iter.next();
|
|
||||||
MinMaxIterator mm_iter(min_max);
|
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
sdc_->setPortExtWireCap(port, subtract_pin_cap, tr1, corner, mm, cap);
|
sdc_->setPortExtWireCap(port, subtract_pin_cap, tr1, corner, mm, cap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3376,11 +3350,8 @@ Sta::setPortExtFanout(Port *port,
|
||||||
int fanout,
|
int fanout,
|
||||||
const MinMaxAll *min_max)
|
const MinMaxAll *min_max)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm : min_max->range())
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
sdc_->setPortExtFanout(port, mm, fanout);
|
sdc_->setPortExtFanout(port, mm, fanout);
|
||||||
}
|
|
||||||
delaysInvalidFromFanin(port);
|
delaysInvalidFromFanin(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3391,11 +3362,8 @@ Sta::setNetWireCap(Net *net,
|
||||||
const MinMaxAll *min_max,
|
const MinMaxAll *min_max,
|
||||||
float cap)
|
float cap)
|
||||||
{
|
{
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm : min_max->range())
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
sdc_->setNetWireCap(net, subtract_pin_cap, corner, mm, cap);
|
sdc_->setNetWireCap(net, subtract_pin_cap, corner, mm, cap);
|
||||||
}
|
|
||||||
delaysInvalidFromFanin(net);
|
delaysInvalidFromFanin(net);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3540,9 +3508,7 @@ Sta::makePiElmore(Pin *drvr_pin,
|
||||||
float c1)
|
float c1)
|
||||||
{
|
{
|
||||||
Corner *corner = cmd_corner_;
|
Corner *corner = cmd_corner_;
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm : min_max->range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
ParasiticAnalysisPt *ap = corner->findParasiticAnalysisPt(mm);
|
ParasiticAnalysisPt *ap = corner->findParasiticAnalysisPt(mm);
|
||||||
parasitics_->makePiElmore(drvr_pin, tr, ap, c2, rpi, c1);
|
parasitics_->makePiElmore(drvr_pin, tr, ap, c2, rpi, c1);
|
||||||
}
|
}
|
||||||
|
|
@ -3576,9 +3542,7 @@ Sta::setElmore(Pin *drvr_pin,
|
||||||
float elmore)
|
float elmore)
|
||||||
{
|
{
|
||||||
Corner *corner = cmd_corner_;
|
Corner *corner = cmd_corner_;
|
||||||
MinMaxIterator mm_iter(min_max);
|
for (auto mm : min_max->range()) {
|
||||||
while (mm_iter.hasNext()) {
|
|
||||||
MinMax *mm = mm_iter.next();
|
|
||||||
const ParasiticAnalysisPt *ap = corner->findParasiticAnalysisPt(mm);
|
const ParasiticAnalysisPt *ap = corner->findParasiticAnalysisPt(mm);
|
||||||
Parasitic *pi_elmore = parasitics_->findPiElmore(drvr_pin, tr, ap);
|
Parasitic *pi_elmore = parasitics_->findPiElmore(drvr_pin, tr, ap);
|
||||||
if (pi_elmore)
|
if (pi_elmore)
|
||||||
|
|
@ -4724,12 +4688,8 @@ InstanceMaxSlewGreater::instMaxSlew(const Instance *inst) const
|
||||||
Pin *pin = pin_iter->next();
|
Pin *pin = pin_iter->next();
|
||||||
if (network->isDriver(pin)) {
|
if (network->isDriver(pin)) {
|
||||||
Vertex *vertex = graph->pinDrvrVertex(pin);
|
Vertex *vertex = graph->pinDrvrVertex(pin);
|
||||||
TransRiseFallIterator tr_iter;
|
for (auto tr : TransRiseFall::range()) {
|
||||||
while (tr_iter.hasNext()) {
|
for (auto dcalc_ap : sta_->corners()->dcalcAnalysisPts()) {
|
||||||
TransRiseFall *tr = tr_iter.next();
|
|
||||||
DcalcAnalysisPtIterator dcalc_ap_iter(sta_);
|
|
||||||
while (dcalc_ap_iter.hasNext()) {
|
|
||||||
DcalcAnalysisPt *dcalc_ap = dcalc_ap_iter.next();
|
|
||||||
Slew slew = graph->slew(vertex, tr, dcalc_ap->index());
|
Slew slew = graph->slew(vertex, tr, dcalc_ap->index());
|
||||||
if (slew > max_slew)
|
if (slew > max_slew)
|
||||||
max_slew = slew;
|
max_slew = slew;
|
||||||
|
|
|
||||||
|
|
@ -505,9 +505,7 @@ VisitPathEnds::visitDataCheckEnd(const Pin *pin,
|
||||||
DataCheck *check = check_iter.next();
|
DataCheck *check = check_iter.next();
|
||||||
const Pin *from_pin = check->from();
|
const Pin *from_pin = check->from();
|
||||||
Vertex *from_vertex = graph_->pinLoadVertex(from_pin);
|
Vertex *from_vertex = graph_->pinLoadVertex(from_pin);
|
||||||
TransRiseFallIterator from_tr_iter;
|
for (auto from_tr : TransRiseFall::range()) {
|
||||||
while (from_tr_iter.hasNext()) {
|
|
||||||
TransRiseFall *from_tr = from_tr_iter.next();
|
|
||||||
float margin;
|
float margin;
|
||||||
bool margin_exists;
|
bool margin_exists;
|
||||||
check->margin(from_tr, end_tr, min_max, margin, margin_exists);
|
check->margin(from_tr, end_tr, min_max, margin, margin_exists);
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,7 @@ WorstSlacks::worstSlack(const MinMax *min_max,
|
||||||
{
|
{
|
||||||
worst_slack = MinMax::min()->initValue();
|
worst_slack = MinMax::min()->initValue();
|
||||||
worst_vertex = nullptr;
|
worst_vertex = nullptr;
|
||||||
CornerIterator corner_iter(sta_);
|
for (auto corner : *sta_->corners()) {
|
||||||
while (corner_iter.hasNext()) {
|
|
||||||
Corner *corner = corner_iter.next();
|
|
||||||
PathAPIndex path_ap_index = corner->findPathAnalysisPt(min_max)->index();
|
PathAPIndex path_ap_index = corner->findPathAnalysisPt(min_max)->index();
|
||||||
Slack worst_slack1;
|
Slack worst_slack1;
|
||||||
Vertex *worst_vertex1;
|
Vertex *worst_vertex1;
|
||||||
|
|
|
||||||
28
tcl/StaTcl.i
28
tcl/StaTcl.i
|
|
@ -5718,9 +5718,7 @@ arrivals_clk(const TransRiseFall *tr,
|
||||||
const ClockEdge *clk_edge = nullptr;
|
const ClockEdge *clk_edge = nullptr;
|
||||||
if (clk)
|
if (clk)
|
||||||
clk_edge = clk->edge(clk_tr);
|
clk_edge = clk->edge(clk_tr);
|
||||||
PathAnalysisPtIterator ap_iter(sta);
|
for (auto path_ap : sta->corners()->pathAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = ap_iter.next();
|
|
||||||
floats->push_back(delayAsFloat(sta->vertexArrival(self, tr, clk_edge,
|
floats->push_back(delayAsFloat(sta->vertexArrival(self, tr, clk_edge,
|
||||||
path_ap)));
|
path_ap)));
|
||||||
}
|
}
|
||||||
|
|
@ -5738,9 +5736,7 @@ arrivals_clk_delays(const TransRiseFall *tr,
|
||||||
const ClockEdge *clk_edge = nullptr;
|
const ClockEdge *clk_edge = nullptr;
|
||||||
if (clk)
|
if (clk)
|
||||||
clk_edge = clk->edge(clk_tr);
|
clk_edge = clk->edge(clk_tr);
|
||||||
PathAnalysisPtIterator ap_iter(sta);
|
for (auto path_ap : sta->corners()->pathAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = ap_iter.next();
|
|
||||||
arrivals->push_back(delayAsString(sta->vertexArrival(self, tr, clk_edge,
|
arrivals->push_back(delayAsString(sta->vertexArrival(self, tr, clk_edge,
|
||||||
path_ap),
|
path_ap),
|
||||||
sta, digits));
|
sta, digits));
|
||||||
|
|
@ -5758,9 +5754,7 @@ requireds_clk(const TransRiseFall *tr,
|
||||||
const ClockEdge *clk_edge = nullptr;
|
const ClockEdge *clk_edge = nullptr;
|
||||||
if (clk)
|
if (clk)
|
||||||
clk_edge = clk->edge(clk_tr);
|
clk_edge = clk->edge(clk_tr);
|
||||||
PathAnalysisPtIterator ap_iter(sta);
|
for (auto path_ap : sta->corners()->pathAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = ap_iter.next();
|
|
||||||
floats->push_back(delayAsFloat(sta->vertexRequired(self, tr, clk_edge,
|
floats->push_back(delayAsFloat(sta->vertexRequired(self, tr, clk_edge,
|
||||||
path_ap)));
|
path_ap)));
|
||||||
}
|
}
|
||||||
|
|
@ -5778,9 +5772,7 @@ requireds_clk_delays(const TransRiseFall *tr,
|
||||||
const ClockEdge *clk_edge = nullptr;
|
const ClockEdge *clk_edge = nullptr;
|
||||||
if (clk)
|
if (clk)
|
||||||
clk_edge = clk->edge(clk_tr);
|
clk_edge = clk->edge(clk_tr);
|
||||||
PathAnalysisPtIterator ap_iter(sta);
|
for (auto path_ap : sta->corners()->pathAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = ap_iter.next();
|
|
||||||
requireds->push_back(delayAsString(sta->vertexRequired(self, tr, clk_edge,
|
requireds->push_back(delayAsString(sta->vertexRequired(self, tr, clk_edge,
|
||||||
path_ap),
|
path_ap),
|
||||||
sta, digits));
|
sta, digits));
|
||||||
|
|
@ -5793,9 +5785,7 @@ slacks(TransRiseFall *tr)
|
||||||
{
|
{
|
||||||
Sta *sta = Sta::sta();
|
Sta *sta = Sta::sta();
|
||||||
TmpFloatSeq *floats = new FloatSeq;
|
TmpFloatSeq *floats = new FloatSeq;
|
||||||
PathAnalysisPtIterator ap_iter(sta);
|
for (auto path_ap : sta->corners()->pathAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = ap_iter.next();
|
|
||||||
floats->push_back(delayAsFloat(sta->vertexSlack(self, tr, path_ap)));
|
floats->push_back(delayAsFloat(sta->vertexSlack(self, tr, path_ap)));
|
||||||
}
|
}
|
||||||
return floats;
|
return floats;
|
||||||
|
|
@ -5812,9 +5802,7 @@ slacks_clk(const TransRiseFall *tr,
|
||||||
const ClockEdge *clk_edge = nullptr;
|
const ClockEdge *clk_edge = nullptr;
|
||||||
if (clk)
|
if (clk)
|
||||||
clk_edge = clk->edge(clk_tr);
|
clk_edge = clk->edge(clk_tr);
|
||||||
PathAnalysisPtIterator ap_iter(sta);
|
for (auto path_ap : sta->corners()->pathAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = ap_iter.next();
|
|
||||||
floats->push_back(delayAsFloat(sta->vertexSlack(self, tr, clk_edge,
|
floats->push_back(delayAsFloat(sta->vertexSlack(self, tr, clk_edge,
|
||||||
path_ap)));
|
path_ap)));
|
||||||
}
|
}
|
||||||
|
|
@ -5832,9 +5820,7 @@ slacks_clk_delays(const TransRiseFall *tr,
|
||||||
const ClockEdge *clk_edge = nullptr;
|
const ClockEdge *clk_edge = nullptr;
|
||||||
if (clk)
|
if (clk)
|
||||||
clk_edge = clk->edge(clk_tr);
|
clk_edge = clk->edge(clk_tr);
|
||||||
PathAnalysisPtIterator ap_iter(sta);
|
for (auto path_ap : sta->corners()->pathAnalysisPts()) {
|
||||||
while (ap_iter.hasNext()) {
|
|
||||||
PathAnalysisPt *path_ap = ap_iter.next();
|
|
||||||
slacks->push_back(delayAsString(sta->vertexSlack(self, tr, clk_edge,
|
slacks->push_back(delayAsString(sta->vertexSlack(self, tr, clk_edge,
|
||||||
path_ap),
|
path_ap),
|
||||||
sta, digits));
|
sta, digits));
|
||||||
|
|
|
||||||
|
|
@ -39,24 +39,10 @@ compareMax(float value1,
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
MinMax *MinMax::min_;
|
MinMax MinMax::min_("min", 0, INF, compareMin);
|
||||||
MinMax *MinMax::max_;
|
MinMax MinMax::max_("max", 1, -INF, compareMax);
|
||||||
|
const std::array<MinMax*, 2> MinMax::range_{&min_, &max_};
|
||||||
void
|
const std::array<int, 2> MinMax::range_index_{min_.index(), max_.index()};
|
||||||
MinMax::init()
|
|
||||||
{
|
|
||||||
min_ = new MinMax("min", 0, INF, compareMin);
|
|
||||||
max_ = new MinMax("max", 1, -INF, compareMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
MinMax::destroy()
|
|
||||||
{
|
|
||||||
delete min_;
|
|
||||||
min_ = nullptr;
|
|
||||||
delete max_;
|
|
||||||
max_ = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
MinMax::MinMax(const char *name,
|
MinMax::MinMax(const char *name,
|
||||||
int index,
|
int index,
|
||||||
|
|
@ -72,7 +58,7 @@ MinMax::MinMax(const char *name,
|
||||||
MinMaxAll *
|
MinMaxAll *
|
||||||
MinMax::asMinMaxAll() const
|
MinMax::asMinMaxAll() const
|
||||||
{
|
{
|
||||||
if (this == min_)
|
if (this == &min_)
|
||||||
return MinMaxAll::min();
|
return MinMaxAll::min();
|
||||||
else
|
else
|
||||||
return MinMaxAll::max();
|
return MinMaxAll::max();
|
||||||
|
|
@ -81,10 +67,10 @@ MinMax::asMinMaxAll() const
|
||||||
MinMax *
|
MinMax *
|
||||||
MinMax::opposite() const
|
MinMax::opposite() const
|
||||||
{
|
{
|
||||||
if (this == max_)
|
if (this == &max_)
|
||||||
return min_;
|
return &min_;
|
||||||
else
|
else
|
||||||
return max_;
|
return &max_;
|
||||||
}
|
}
|
||||||
|
|
||||||
MinMax *
|
MinMax *
|
||||||
|
|
@ -92,10 +78,10 @@ MinMax::find(const char *min_max)
|
||||||
{
|
{
|
||||||
if (stringEq(min_max, "min")
|
if (stringEq(min_max, "min")
|
||||||
|| stringEq(min_max, "early"))
|
|| stringEq(min_max, "early"))
|
||||||
return min();
|
return &min_;
|
||||||
else if (stringEq(min_max, "max")
|
else if (stringEq(min_max, "max")
|
||||||
|| stringEq(min_max, "late"))
|
|| stringEq(min_max, "late"))
|
||||||
return max();
|
return &max_;
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
@ -103,10 +89,10 @@ MinMax::find(const char *min_max)
|
||||||
MinMax *
|
MinMax *
|
||||||
MinMax::find(int index)
|
MinMax::find(int index)
|
||||||
{
|
{
|
||||||
if (index == min_->index())
|
if (index == min_.index())
|
||||||
return min();
|
return &min_;
|
||||||
else if (index == max_->index())
|
else if (index == max_.index())
|
||||||
return max();
|
return &max_;
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
@ -120,40 +106,26 @@ MinMax::compare(float value1,
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
MinMaxAll *MinMaxAll::min_;
|
MinMaxAll MinMaxAll::min_("min", 0, {MinMax::min()}, {MinMax::min()->index()});
|
||||||
MinMaxAll *MinMaxAll::max_;
|
MinMaxAll MinMaxAll::max_("max", 1, {MinMax::max()}, {MinMax::max()->index()});
|
||||||
MinMaxAll *MinMaxAll::all_;
|
MinMaxAll MinMaxAll::all_("all", 2, {MinMax::min(), MinMax::max()},
|
||||||
|
{MinMax::min()->index(), MinMax::max()->index()});
|
||||||
void
|
|
||||||
MinMaxAll::init()
|
|
||||||
{
|
|
||||||
min_ = new MinMaxAll("min", 0);
|
|
||||||
max_ = new MinMaxAll("max", 1);
|
|
||||||
all_ = new MinMaxAll("all", 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
MinMaxAll::destroy()
|
|
||||||
{
|
|
||||||
delete min_;
|
|
||||||
min_ = nullptr;
|
|
||||||
delete max_;
|
|
||||||
max_ = nullptr;
|
|
||||||
delete all_;
|
|
||||||
all_ = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
MinMaxAll::MinMaxAll(const char *name,
|
MinMaxAll::MinMaxAll(const char *name,
|
||||||
int index) :
|
int index,
|
||||||
|
std::vector<MinMax*> range,
|
||||||
|
std::vector<int> range_index) :
|
||||||
name_(name),
|
name_(name),
|
||||||
index_(index)
|
index_(index),
|
||||||
|
range_(range),
|
||||||
|
range_index_(range_index)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MinMax *
|
MinMax *
|
||||||
MinMaxAll::asMinMax() const
|
MinMaxAll::asMinMax() const
|
||||||
{
|
{
|
||||||
if (this == min_)
|
if (this == &min_)
|
||||||
return MinMax::min();
|
return MinMax::min();
|
||||||
else
|
else
|
||||||
return MinMax::max();
|
return MinMax::max();
|
||||||
|
|
@ -162,13 +134,13 @@ MinMaxAll::asMinMax() const
|
||||||
bool
|
bool
|
||||||
MinMaxAll::matches(const MinMax *min_max) const
|
MinMaxAll::matches(const MinMax *min_max) const
|
||||||
{
|
{
|
||||||
return this == all_ || asMinMax() == min_max;
|
return this == &all_ || asMinMax() == min_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
MinMaxAll::matches(const MinMaxAll *min_max) const
|
MinMaxAll::matches(const MinMaxAll *min_max) const
|
||||||
{
|
{
|
||||||
return this == all_ || this == min_max;
|
return this == &all_ || this == min_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
MinMaxAll *
|
MinMaxAll *
|
||||||
|
|
@ -176,14 +148,14 @@ MinMaxAll::find(const char *min_max)
|
||||||
{
|
{
|
||||||
if (stringEq(min_max, "min")
|
if (stringEq(min_max, "min")
|
||||||
|| stringEq(min_max, "early"))
|
|| stringEq(min_max, "early"))
|
||||||
return min();
|
return &min_;
|
||||||
else if (stringEq(min_max, "max")
|
else if (stringEq(min_max, "max")
|
||||||
|| stringEq(min_max, "late"))
|
|| stringEq(min_max, "late"))
|
||||||
return max();
|
return &max_;
|
||||||
else if (stringEq(min_max, "all")
|
else if (stringEq(min_max, "all")
|
||||||
|| stringEq(min_max, "min_max")
|
|| stringEq(min_max, "min_max")
|
||||||
|| stringEq(min_max, "minmax"))
|
|| stringEq(min_max, "minmax"))
|
||||||
return all_;
|
return &all_;
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
104
util/MinMax.hh
104
util/MinMax.hh
|
|
@ -17,6 +17,8 @@
|
||||||
#ifndef STA_MIN_MAX_H
|
#ifndef STA_MIN_MAX_H
|
||||||
#define STA_MIN_MAX_H
|
#define STA_MIN_MAX_H
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
#include <vector>
|
||||||
#include "DisallowCopyAssign.hh"
|
#include "DisallowCopyAssign.hh"
|
||||||
#include "Iterator.hh"
|
#include "Iterator.hh"
|
||||||
|
|
||||||
|
|
@ -24,12 +26,10 @@ namespace sta {
|
||||||
|
|
||||||
class MinMax;
|
class MinMax;
|
||||||
class MinMaxAll;
|
class MinMaxAll;
|
||||||
class MinMaxIterator;
|
|
||||||
|
|
||||||
// Use typedefs to make early/late functional equivalents to min/max.
|
// Use typedefs to make early/late functional equivalents to min/max.
|
||||||
typedef MinMax EarlyLate;
|
typedef MinMax EarlyLate;
|
||||||
typedef MinMaxAll EarlyLateAll;
|
typedef MinMaxAll EarlyLateAll;
|
||||||
typedef MinMaxIterator EarlyLateIterator;
|
|
||||||
|
|
||||||
// Large value used for min/max initial values.
|
// Large value used for min/max initial values.
|
||||||
extern const float INF;
|
extern const float INF;
|
||||||
|
|
@ -40,14 +40,14 @@ public:
|
||||||
static void init();
|
static void init();
|
||||||
static void destroy();
|
static void destroy();
|
||||||
// Singleton accessors.
|
// Singleton accessors.
|
||||||
static MinMax *min() { return min_; }
|
static MinMax *min() { return &min_; }
|
||||||
static MinMax *max() { return max_; }
|
static MinMax *max() { return &max_; }
|
||||||
static EarlyLate *early() { return min_; }
|
static EarlyLate *early() { return &min_; }
|
||||||
static EarlyLate *late() { return max_; }
|
static EarlyLate *late() { return &max_; }
|
||||||
static int minIndex() { return min_->index_; }
|
static int minIndex() { return min_.index_; }
|
||||||
static int earlyIndex() { return min_->index_; }
|
static int earlyIndex() { return min_.index_; }
|
||||||
static int maxIndex() { return max_->index_; }
|
static int maxIndex() { return max_.index_; }
|
||||||
static int lateIndex() { return max_->index_; }
|
static int lateIndex() { return max_.index_; }
|
||||||
const char *asString() const { return name_; }
|
const char *asString() const { return name_; }
|
||||||
int index() const { return index_; }
|
int index() const { return index_; }
|
||||||
float initValue() const { return init_value_; }
|
float initValue() const { return init_value_; }
|
||||||
|
|
@ -56,6 +56,11 @@ public:
|
||||||
float value2) const;
|
float value2) const;
|
||||||
MinMaxAll *asMinMaxAll() const;
|
MinMaxAll *asMinMaxAll() const;
|
||||||
MinMax *opposite() const;
|
MinMax *opposite() const;
|
||||||
|
// for range support.
|
||||||
|
// for (auto min_max : MinMax::range()) {}
|
||||||
|
static const std::array<MinMax*, 2> &range() { return range_; }
|
||||||
|
// for (auto mm_index : MinMax::rangeIndex()) {}
|
||||||
|
static const std::array<int, 2> &rangeIndex() { return range_index_; }
|
||||||
static MinMax *find(const char *min_max);
|
static MinMax *find(const char *min_max);
|
||||||
// Find transition from index.
|
// Find transition from index.
|
||||||
static MinMax *find(int index);
|
static MinMax *find(int index);
|
||||||
|
|
@ -77,10 +82,53 @@ private:
|
||||||
bool (*compare_)(float value1,
|
bool (*compare_)(float value1,
|
||||||
float value2);
|
float value2);
|
||||||
|
|
||||||
static MinMax *min_;
|
static MinMax min_;
|
||||||
static MinMax *max_;
|
static MinMax max_;
|
||||||
|
static const std::array<MinMax*, 2> range_;
|
||||||
|
static const std::array<int, 2> range_index_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Min/Max/All, where "All" means use both min and max.
|
||||||
|
class MinMaxAll
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Singleton accessors.
|
||||||
|
static MinMaxAll *min() { return &min_; }
|
||||||
|
static MinMaxAll *early() { return &min_; }
|
||||||
|
static MinMaxAll *max() { return &max_; }
|
||||||
|
static MinMaxAll *late() { return &max_; }
|
||||||
|
static MinMaxAll *all() { return &all_; }
|
||||||
|
const char *asString() const { return name_; }
|
||||||
|
int index() const { return index_; }
|
||||||
|
MinMax *asMinMax() const;
|
||||||
|
bool matches(const MinMax *min_max) const;
|
||||||
|
bool matches(const MinMaxAll *min_max) const;
|
||||||
|
static MinMaxAll *find(const char *min_max);
|
||||||
|
// for (auto min_max : min_max->range()) {}
|
||||||
|
const std::vector<MinMax*> &range() const { return range_; }
|
||||||
|
// for (auto mm_index : min_max->rangeIndex()) {}
|
||||||
|
const std::vector<int> &rangeIndex() const { return range_index_; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(MinMaxAll);
|
||||||
|
MinMaxAll(const char *name,
|
||||||
|
int index,
|
||||||
|
std::vector<MinMax*> range,
|
||||||
|
std::vector<int> range_index);
|
||||||
|
|
||||||
|
const char *name_;
|
||||||
|
int index_;
|
||||||
|
const std::vector<MinMax*> range_;
|
||||||
|
const std::vector<int> range_index_;
|
||||||
|
|
||||||
|
static MinMaxAll min_;
|
||||||
|
static MinMaxAll max_;
|
||||||
|
static MinMaxAll all_;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Obsolete. Use range iteration.
|
||||||
class MinMaxIterator : public Iterator<MinMax*>
|
class MinMaxIterator : public Iterator<MinMax*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -97,37 +145,7 @@ private:
|
||||||
int index_max_;
|
int index_max_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Min/Max/All, where "All" means use both min and max.
|
typedef MinMaxIterator EarlyLateIterator;
|
||||||
class MinMaxAll
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void init();
|
|
||||||
static void destroy();
|
|
||||||
// Singleton accessors.
|
|
||||||
static MinMaxAll *min() { return min_; }
|
|
||||||
static MinMaxAll *early() { return min_; }
|
|
||||||
static MinMaxAll *max() { return max_; }
|
|
||||||
static MinMaxAll *late() { return max_; }
|
|
||||||
static MinMaxAll *all() { return all_; }
|
|
||||||
const char *asString() const { return name_; }
|
|
||||||
int index() const { return index_; }
|
|
||||||
MinMax *asMinMax() const;
|
|
||||||
bool matches(const MinMax *min_max) const;
|
|
||||||
bool matches(const MinMaxAll *min_max) const;
|
|
||||||
static MinMaxAll *find(const char *min_max);
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinMaxAll);
|
|
||||||
MinMaxAll(const char *name,
|
|
||||||
int index);
|
|
||||||
|
|
||||||
const char *name_;
|
|
||||||
int index_;
|
|
||||||
|
|
||||||
static MinMaxAll *min_;
|
|
||||||
static MinMaxAll *max_;
|
|
||||||
static MinMaxAll *all_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue