diff --git a/include/sta/TableModel.hh b/include/sta/TableModel.hh index 31d4d165..b52a4805 100644 --- a/include/sta/TableModel.hh +++ b/include/sta/TableModel.hh @@ -497,7 +497,7 @@ public: const TableAxis *capAxis() const { return cap_axis_.get(); } // Make voltage wavefroms from liberty time/current values. // Required before voltageTime, timeVoltage, voltageCurrent. - void makeVoltageWaveforms(float vdd); + void ensureVoltageWaveforms(float vdd); float timeCurrent(float slew, float cap, float time); diff --git a/liberty/Liberty.cc b/liberty/Liberty.cc index 48e9b345..2b5f04e6 100644 --- a/liberty/Liberty.cc +++ b/liberty/Liberty.cc @@ -1948,7 +1948,7 @@ LibertyCell::ensureVoltageWaveforms(const DcalcAnalysisPtSeq &dcalc_aps) if (model) { OutputWaveforms *output_waveforms = model->outputWaveforms(); if (output_waveforms) - output_waveforms->makeVoltageWaveforms(vdd); + output_waveforms->ensureVoltageWaveforms(vdd); } } } diff --git a/liberty/TableModel.cc b/liberty/TableModel.cc index 21786e63..fe430ef0 100644 --- a/liberty/TableModel.cc +++ b/liberty/TableModel.cc @@ -1664,17 +1664,19 @@ OutputWaveforms::checkAxes(const TableTemplate *tbl_template) } void -OutputWaveforms::makeVoltageWaveforms(float vdd) +OutputWaveforms::ensureVoltageWaveforms(float vdd) { - vdd_ = vdd; - size_t size = current_waveforms_.size(); - voltage_waveforms_.resize(size); - voltage_currents_.resize(size); - size_t cap_count = cap_axis_->size(); - for (size_t slew_index = 0; slew_index < slew_axis_->size(); slew_index++) { - for (size_t cap_index = 0; cap_index < cap_count; cap_index++) { - size_t wave_index = slew_index * cap_count + cap_index; - findVoltages(wave_index, cap_axis_->axisValue(cap_index)); + if (voltage_waveforms_.empty()) { + vdd_ = vdd; + size_t size = current_waveforms_.size(); + voltage_waveforms_.resize(size); + voltage_currents_.resize(size); + size_t cap_count = cap_axis_->size(); + for (size_t slew_index = 0; slew_index < slew_axis_->size(); slew_index++) { + for (size_t cap_index = 0; cap_index < cap_count; cap_index++) { + size_t wave_index = slew_index * cap_count + cap_index; + findVoltages(wave_index, cap_axis_->axisValue(cap_index)); + } } } }