2024-02-27 18:00:48 +01:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2025-01-22 02:54:33 +01:00
|
|
|
// Copyright (c) 2025, Parallax Software, Inc.
|
2024-02-27 18:00:48 +01:00
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2025-01-22 02:54:33 +01:00
|
|
|
//
|
|
|
|
|
// The origin of this software must not be misrepresented; you must not
|
|
|
|
|
// claim that you wrote the original software.
|
|
|
|
|
//
|
|
|
|
|
// Altered source versions must be plainly marked as such, and must not be
|
|
|
|
|
// misrepresented as being the original software.
|
|
|
|
|
//
|
|
|
|
|
// This notice may not be removed or altered from any source distribution.
|
2024-02-27 18:00:48 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "LumpedCapDelayCalc.hh"
|
|
|
|
|
#include "ArcDcalcWaveforms.hh"
|
|
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
2025-04-12 01:59:48 +02:00
|
|
|
typedef std::map<const Pin*, FloatSeq, PinIdLess> WatchPinValuesMap;
|
2024-06-27 22:57:58 +02:00
|
|
|
|
2024-02-27 18:00:48 +01:00
|
|
|
ArcDelayCalc *
|
|
|
|
|
makeCcsCeffDelayCalc(StaState *sta);
|
|
|
|
|
|
2024-06-27 22:57:58 +02:00
|
|
|
class CcsCeffDelayCalc : public LumpedCapDelayCalc,
|
|
|
|
|
public ArcDcalcWaveforms
|
2024-02-27 18:00:48 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CcsCeffDelayCalc(StaState *sta);
|
|
|
|
|
virtual ~CcsCeffDelayCalc();
|
|
|
|
|
ArcDelayCalc *copy() override;
|
2024-06-27 22:57:58 +02:00
|
|
|
const char *name() const override { return "ccs_ceff"; }
|
2024-06-28 19:04:45 +02:00
|
|
|
bool reduceSupported() const override { return true; }
|
2024-02-27 18:00:48 +01:00
|
|
|
ArcDcalcResult gateDelay(const Pin *drvr_pin,
|
|
|
|
|
const TimingArc *arc,
|
|
|
|
|
const Slew &in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
const Parasitic *parasitic,
|
|
|
|
|
const LoadPinIndexMap &load_pin_index_map,
|
|
|
|
|
const DcalcAnalysisPt *dcalc_ap) override;
|
2025-05-22 18:25:56 +02:00
|
|
|
std::string reportGateDelay(const Pin *drvr_pin,
|
|
|
|
|
const TimingArc *arc,
|
|
|
|
|
const Slew &in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
const Parasitic *parasitic,
|
|
|
|
|
const LoadPinIndexMap &load_pin_index_map,
|
|
|
|
|
const DcalcAnalysisPt *dcalc_ap,
|
|
|
|
|
int digits) override;
|
2024-02-27 18:00:48 +01:00
|
|
|
|
2024-06-27 22:57:58 +02:00
|
|
|
// Record waveform for drvr/load pin.
|
|
|
|
|
void watchPin(const Pin *pin) override;
|
|
|
|
|
void clearWatchPins() override;
|
|
|
|
|
PinSeq watchPins() const override;
|
|
|
|
|
Waveform watchWaveform(const Pin *pin) override;
|
2024-02-27 18:00:48 +01:00
|
|
|
|
|
|
|
|
protected:
|
2025-04-12 01:59:48 +02:00
|
|
|
typedef std::vector<double> Region;
|
2024-02-27 18:00:48 +01:00
|
|
|
|
|
|
|
|
void gateDelaySlew(const LibertyLibrary *drvr_library,
|
|
|
|
|
const RiseFall *rf,
|
|
|
|
|
// Return values.
|
|
|
|
|
ArcDelay &gate_delay,
|
|
|
|
|
Slew &drvr_slew);
|
|
|
|
|
void initRegions(const LibertyLibrary *drvr_library,
|
|
|
|
|
const RiseFall *rf);
|
|
|
|
|
void findCsmWaveform();
|
|
|
|
|
ArcDcalcResult makeResult(const LibertyLibrary *drvr_library,
|
|
|
|
|
const RiseFall *rf,
|
|
|
|
|
ArcDelay &gate_delay,
|
|
|
|
|
Slew &drvr_slew,
|
|
|
|
|
const LoadPinIndexMap &load_pin_index_map);
|
|
|
|
|
void loadDelaySlew(const Pin *load_pin,
|
|
|
|
|
const LibertyLibrary *drvr_library,
|
|
|
|
|
const RiseFall *rf,
|
|
|
|
|
Slew &drvr_slew,
|
|
|
|
|
// Return values.
|
|
|
|
|
ArcDelay &wire_delay,
|
|
|
|
|
Slew &load_slew);
|
|
|
|
|
void loadDelaySlew(const Pin *load_pin,
|
|
|
|
|
Slew &drvr_slew,
|
|
|
|
|
float elmore,
|
|
|
|
|
// Return values.
|
|
|
|
|
ArcDelay &delay,
|
|
|
|
|
Slew &slew);
|
2024-06-27 22:57:58 +02:00
|
|
|
double findVlTime(double v,
|
|
|
|
|
double elmore);
|
2024-02-27 18:00:48 +01:00
|
|
|
bool makeWaveformPreamble(const Pin *in_pin,
|
|
|
|
|
const RiseFall *in_rf,
|
|
|
|
|
const Pin *drvr_pin,
|
|
|
|
|
const RiseFall *drvr_rf,
|
|
|
|
|
const Corner *corner,
|
|
|
|
|
const MinMax *min_max);
|
2024-06-27 22:57:58 +02:00
|
|
|
Waveform drvrWaveform();
|
|
|
|
|
Waveform loadWaveform(const Pin *load_pin);
|
|
|
|
|
Waveform drvrRampWaveform(const Pin *in_pin,
|
|
|
|
|
const RiseFall *in_rf,
|
|
|
|
|
const Pin *drvr_pin,
|
|
|
|
|
const RiseFall *drvr_rf,
|
|
|
|
|
const Pin *load_pin,
|
|
|
|
|
const Corner *corner,
|
|
|
|
|
const MinMax *min_max);
|
2024-02-27 18:00:48 +01:00
|
|
|
void vl(double t,
|
|
|
|
|
double elmore,
|
|
|
|
|
// Return values.
|
|
|
|
|
double &vl,
|
|
|
|
|
double &dvl_dt);
|
|
|
|
|
double vl(double t,
|
|
|
|
|
double elmore);
|
|
|
|
|
void fail(const char *reason);
|
|
|
|
|
|
|
|
|
|
const Pin *drvr_pin_;
|
2024-06-27 22:57:58 +02:00
|
|
|
const RiseFall *drvr_rf_;
|
2024-02-27 18:00:48 +01:00
|
|
|
double in_slew_;
|
|
|
|
|
double load_cap_;
|
|
|
|
|
const Parasitic *parasitic_;
|
|
|
|
|
|
|
|
|
|
OutputWaveforms *output_waveforms_;
|
|
|
|
|
double ref_time_;
|
|
|
|
|
float vdd_;
|
|
|
|
|
float vth_;
|
|
|
|
|
float vl_;
|
|
|
|
|
float vh_;
|
|
|
|
|
|
|
|
|
|
float c2_;
|
|
|
|
|
float rpi_;
|
|
|
|
|
float c1_;
|
|
|
|
|
|
|
|
|
|
size_t region_count_;
|
|
|
|
|
size_t region_vl_idx_;
|
|
|
|
|
size_t region_vth_idx_;
|
|
|
|
|
size_t region_vh_idx_;
|
|
|
|
|
|
|
|
|
|
Region region_volts_;
|
|
|
|
|
Region region_ceff_;
|
|
|
|
|
Region region_times_;
|
|
|
|
|
Region region_begin_times_;
|
|
|
|
|
Region region_end_times_;
|
|
|
|
|
Region region_time_offsets_;
|
|
|
|
|
Region region_ramp_times_;
|
|
|
|
|
Region region_ramp_slopes_;
|
|
|
|
|
bool vl_fail_;
|
2024-06-27 22:57:58 +02:00
|
|
|
// Waveform recording.
|
|
|
|
|
WatchPinValuesMap watch_pin_values_;
|
2024-02-27 18:00:48 +01:00
|
|
|
|
|
|
|
|
const Unit *capacitance_unit_;
|
|
|
|
|
// Delay calculator to use when ccs waveforms are missing from liberty.
|
|
|
|
|
ArcDelayCalc *table_dcalc_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|