write_timing_model leak
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
1b5c4e2745
commit
8ae487c602
|
|
@ -239,8 +239,8 @@ public:
|
|||
const RiseFall *rf,
|
||||
const EarlyLate *early_late) const;
|
||||
void unsetTimingDerate();
|
||||
static void moveDeratingFactors(Sdc *from,
|
||||
Sdc *to);
|
||||
static void swapDeratingFactors(Sdc *sdc1,
|
||||
Sdc *sdc2);
|
||||
|
||||
void setInputSlew(const Port *port,
|
||||
const RiseFallBoth *rf,
|
||||
|
|
@ -445,8 +445,8 @@ public:
|
|||
float delay);
|
||||
void removeClockInsertion(const Clock *clk,
|
||||
const Pin *pin);
|
||||
static void moveClockInsertions(Sdc *from,
|
||||
Sdc *to);
|
||||
static void swapClockInsertions(Sdc *sdc1,
|
||||
Sdc *sdc2);
|
||||
bool hasClockInsertion(const Pin *pin) const;
|
||||
float clockInsertion(const Clock *clk,
|
||||
const RiseFall *rf,
|
||||
|
|
@ -569,8 +569,8 @@ public:
|
|||
const Clock *clk,
|
||||
const RiseFall *clk_rf,
|
||||
const MinMaxAll *min_max);
|
||||
static void movePortDelays(Sdc *from,
|
||||
Sdc *to);
|
||||
static void swapPortDelays(Sdc *sdc1,
|
||||
Sdc *sdc2);
|
||||
|
||||
// Set port external pin load (set_load -pin_load port).
|
||||
void setPortExtPinCap(const Port *port,
|
||||
|
|
@ -585,8 +585,8 @@ public:
|
|||
const Corner *corner,
|
||||
const MinMax *min_max,
|
||||
float cap);
|
||||
static void movePortExtCaps(Sdc *from,
|
||||
Sdc *to);
|
||||
static void swapPortExtCaps(Sdc *sdc1,
|
||||
Sdc *sdc2);
|
||||
// Remove all "set_load net" annotations.
|
||||
void removeNetLoadCaps();
|
||||
void setNetWireCap(const Net *net,
|
||||
|
|
|
|||
62
sdc/Sdc.cc
62
sdc/Sdc.cc
|
|
@ -51,6 +51,8 @@
|
|||
|
||||
namespace sta {
|
||||
|
||||
using std::swap;
|
||||
|
||||
bool
|
||||
ClockPairLess::operator()(const ClockPair &pair1,
|
||||
const ClockPair &pair2) const
|
||||
|
|
@ -660,17 +662,13 @@ Sdc::unsetTimingDerate()
|
|||
}
|
||||
|
||||
void
|
||||
Sdc::moveDeratingFactors(Sdc *from,
|
||||
Sdc *to)
|
||||
Sdc::swapDeratingFactors(Sdc *sdc1,
|
||||
Sdc *sdc2)
|
||||
{
|
||||
if (from->derating_factors_) {
|
||||
to->derating_factors_ = from->derating_factors_;
|
||||
from->derating_factors_ = nullptr;
|
||||
}
|
||||
|
||||
to->net_derating_factors_ = std::move(from->net_derating_factors_);
|
||||
to->inst_derating_factors_ = std::move(from->inst_derating_factors_);
|
||||
to->cell_derating_factors_ = std::move(from->cell_derating_factors_);
|
||||
swap(sdc1->derating_factors_, sdc2->derating_factors_);
|
||||
swap(sdc1->net_derating_factors_, sdc2->net_derating_factors_);
|
||||
swap(sdc1->inst_derating_factors_, sdc2->inst_derating_factors_);
|
||||
swap(sdc1->cell_derating_factors_, sdc2->cell_derating_factors_);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1733,10 +1731,10 @@ Sdc::removeClockInsertion(const Clock *clk,
|
|||
}
|
||||
|
||||
void
|
||||
Sdc::moveClockInsertions(Sdc *from,
|
||||
Sdc *to)
|
||||
Sdc::swapClockInsertions(Sdc *sdc1,
|
||||
Sdc *sdc2)
|
||||
{
|
||||
to->clk_insertions_ = std::move(from->clk_insertions_);
|
||||
swap(sdc1->clk_insertions_, sdc2->clk_insertions_);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2742,21 +2740,20 @@ Sdc::deleteInputDelay(InputDelay *input_delay)
|
|||
}
|
||||
|
||||
void
|
||||
Sdc::movePortDelays(Sdc *from,
|
||||
Sdc *to)
|
||||
Sdc::swapPortDelays(Sdc *sdc1,
|
||||
Sdc *sdc2)
|
||||
{
|
||||
to->input_delays_ = std::move(from->input_delays_);
|
||||
to->input_delay_pin_map_ = std::move(from->input_delay_pin_map_);
|
||||
to->input_delay_ref_pin_map_ = std::move(from->input_delay_ref_pin_map_);
|
||||
to->input_delay_leaf_pin_map_ = std::move(from->input_delay_leaf_pin_map_);
|
||||
to->input_delay_internal_pin_map_ = std::move(from->input_delay_internal_pin_map_);
|
||||
to->input_delay_index_ = from->input_delay_index_;
|
||||
from->input_delay_index_ = 0;
|
||||
swap(sdc1->input_delays_, sdc2->input_delays_);
|
||||
swap(sdc1->input_delay_pin_map_, sdc2->input_delay_pin_map_);
|
||||
swap(sdc1->input_delay_ref_pin_map_, sdc2->input_delay_ref_pin_map_);
|
||||
swap(sdc1->input_delay_leaf_pin_map_, sdc2->input_delay_leaf_pin_map_);
|
||||
swap(sdc1->input_delay_internal_pin_map_, sdc2->input_delay_internal_pin_map_);
|
||||
swap(sdc1->input_delay_index_, sdc2->input_delay_index_);
|
||||
|
||||
to->output_delays_ = std::move(from->output_delays_);
|
||||
to->output_delay_pin_map_ = std::move(from->output_delay_pin_map_);
|
||||
to->output_delay_ref_pin_map_ = std::move(from->output_delay_ref_pin_map_);
|
||||
to->output_delay_leaf_pin_map_ = std::move(from->output_delay_leaf_pin_map_);
|
||||
swap(sdc1->output_delays_, sdc2->output_delays_);
|
||||
swap(sdc1->output_delay_pin_map_, sdc2->output_delay_pin_map_);
|
||||
swap(sdc1->output_delay_ref_pin_map_, sdc2->output_delay_ref_pin_map_);
|
||||
swap(sdc1->output_delay_leaf_pin_map_, sdc2->output_delay_leaf_pin_map_);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
|
@ -3322,15 +3319,12 @@ Sdc::ensurePortExtPinCap(const Port *port,
|
|||
}
|
||||
|
||||
void
|
||||
Sdc::movePortExtCaps(Sdc *from,
|
||||
Sdc *to)
|
||||
Sdc::swapPortExtCaps(Sdc *sdc1,
|
||||
Sdc *sdc2)
|
||||
{
|
||||
for (int corner_index = 0; corner_index < from->corners()->count(); corner_index++) {
|
||||
to->port_ext_cap_maps_[corner_index] =
|
||||
std::move(from->port_ext_cap_maps_[corner_index]);
|
||||
|
||||
to->net_wire_cap_maps_[corner_index] =
|
||||
std::move(from->net_wire_cap_maps_[corner_index]);
|
||||
for (int corner_index = 0; corner_index < sdc1->corners()->count(); corner_index++) {
|
||||
swap(sdc1->port_ext_cap_maps_[corner_index], sdc2->port_ext_cap_maps_[corner_index]);
|
||||
swap(sdc1->net_wire_cap_maps_[corner_index], sdc2->net_wire_cap_maps_[corner_index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,24 +111,27 @@ void
|
|||
MakeTimingModel::saveSdc()
|
||||
{
|
||||
sdc_backup_ = new Sdc(this);
|
||||
Sdc::movePortDelays(sdc_, sdc_backup_);
|
||||
Sdc::movePortExtCaps(sdc_, sdc_backup_);
|
||||
Sdc::moveDeratingFactors(sdc_, sdc_backup_);
|
||||
Sdc::moveClockInsertions(sdc_, sdc_backup_);
|
||||
swapSdcWithBackup();
|
||||
sta_->delaysInvalid();
|
||||
}
|
||||
|
||||
void
|
||||
MakeTimingModel::restoreSdc()
|
||||
{
|
||||
Sdc::movePortDelays(sdc_backup_, sdc_);
|
||||
Sdc::movePortExtCaps(sdc_backup_, sdc_);
|
||||
Sdc::moveDeratingFactors(sdc_backup_, sdc_);
|
||||
Sdc::moveClockInsertions(sdc_backup_, sdc_);
|
||||
swapSdcWithBackup();
|
||||
delete sdc_backup_;
|
||||
sta_->delaysInvalid();
|
||||
}
|
||||
|
||||
void
|
||||
MakeTimingModel::swapSdcWithBackup()
|
||||
{
|
||||
Sdc::swapPortDelays(sdc_, sdc_backup_);
|
||||
Sdc::swapPortExtCaps(sdc_, sdc_backup_);
|
||||
Sdc::swapDeratingFactors(sdc_, sdc_backup_);
|
||||
Sdc::swapClockInsertions(sdc_, sdc_backup_);
|
||||
}
|
||||
|
||||
void
|
||||
MakeTimingModel::makeLibrary()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ private:
|
|||
|
||||
void saveSdc();
|
||||
void restoreSdc();
|
||||
void swapSdcWithBackup();
|
||||
|
||||
const char *lib_name_;
|
||||
const char *cell_name_;
|
||||
|
|
|
|||
Loading…
Reference in New Issue