2018-09-28 17:54:21 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2023-02-19 01:55:40 +01:00
|
|
|
// Copyright (c) 2023, Parallax Software, Inc.
|
2018-09-28 17:54:21 +02: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
|
2022-01-04 18:17:08 +01:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2018-09-28 17:54:21 +02:00
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
2022-01-04 18:17:08 +01:00
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2020-02-16 01:13:16 +01:00
|
|
|
#pragma once
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
#include <string>
|
2022-06-26 01:31:18 +02:00
|
|
|
#include <memory>
|
|
|
|
|
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "MinMax.hh"
|
|
|
|
|
#include "Vector.hh"
|
|
|
|
|
#include "Transition.hh"
|
|
|
|
|
#include "LibertyClass.hh"
|
|
|
|
|
#include "TimingModel.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
|
|
class Unit;
|
|
|
|
|
class Units;
|
|
|
|
|
class Report;
|
|
|
|
|
class Table;
|
2023-03-22 17:57:54 +01:00
|
|
|
class OutputWaveforms;
|
|
|
|
|
class OutputWaveform;
|
2023-02-08 17:23:24 +01:00
|
|
|
|
|
|
|
|
typedef Vector<float> FloatSeq;
|
|
|
|
|
typedef Vector<FloatSeq*> FloatTable;
|
2023-03-22 17:57:54 +01:00
|
|
|
typedef Vector<OutputWaveform*> OutputWaveformSeq;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
TableAxisVariable
|
|
|
|
|
stringTableAxisVariable(const char *variable);
|
|
|
|
|
const char *
|
|
|
|
|
tableVariableString(TableAxisVariable variable);
|
|
|
|
|
const Unit *
|
|
|
|
|
tableVariableUnit(TableAxisVariable variable,
|
|
|
|
|
const Units *units);
|
|
|
|
|
|
|
|
|
|
class GateTableModel : public GateTimingModel
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
GateTableModel(TableModel *delay_model,
|
2018-11-26 18:15:52 +01:00
|
|
|
TableModel *delay_sigma_models[EarlyLate::index_count],
|
|
|
|
|
TableModel *slew_model,
|
2023-02-08 17:23:24 +01:00
|
|
|
TableModel *slew_sigma_models[EarlyLate::index_count],
|
|
|
|
|
ReceiverModelPtr receiver_model,
|
2023-03-22 17:57:54 +01:00
|
|
|
OutputWaveforms *output_waveforms);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual ~GateTableModel();
|
|
|
|
|
virtual void gateDelay(const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
float related_out_cap,
|
2019-01-27 08:03:01 +01:00
|
|
|
bool pocv_enabled,
|
2018-11-26 18:15:52 +01:00
|
|
|
// Return values.
|
|
|
|
|
ArcDelay &gate_delay,
|
|
|
|
|
Slew &drvr_slew) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual void reportGateDelay(const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
float related_out_cap,
|
2019-01-27 08:03:01 +01:00
|
|
|
bool pocv_enabled,
|
2018-09-28 17:54:21 +02:00
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
virtual float driveResistance(const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt) const;
|
|
|
|
|
|
|
|
|
|
const TableModel *delayModel() const { return delay_model_; }
|
|
|
|
|
const TableModel *slewModel() const { return slew_model_; }
|
2023-03-22 17:57:54 +01:00
|
|
|
ReceiverModelPtr receiverModel() const { return receiver_model_; }
|
|
|
|
|
OutputWaveforms *outputWaveforms() const { return output_waveforms_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
// Check the axes before making the model.
|
|
|
|
|
// Return true if the model axes are supported.
|
2023-01-18 18:23:03 +01:00
|
|
|
static bool checkAxes(const TablePtr table);
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void maxCapSlew(const LibertyCell *cell,
|
|
|
|
|
float in_slew,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float &slew,
|
|
|
|
|
float &cap) const;
|
|
|
|
|
virtual void setIsScaled(bool is_scaled);
|
2022-06-26 01:31:18 +02:00
|
|
|
float axisValue(TableAxisPtr axis,
|
2018-09-28 17:54:21 +02:00
|
|
|
float load_cap,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float related_out_cap) const;
|
|
|
|
|
float findValue(const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
const TableModel *model,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
float related_out_cap) const;
|
|
|
|
|
void reportTableLookup(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
const TableModel *model,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
float related_out_cap,
|
|
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
void findAxisValues(const TableModel *model,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
float related_out_cap,
|
|
|
|
|
// Return values.
|
|
|
|
|
float &axis_value1,
|
|
|
|
|
float &axis_value2,
|
|
|
|
|
float &axis_value3) const;
|
2022-06-26 01:31:18 +02:00
|
|
|
static bool checkAxis(TableAxisPtr axis);
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
TableModel *delay_model_;
|
2018-11-26 18:15:52 +01:00
|
|
|
TableModel *delay_sigma_models_[EarlyLate::index_count];
|
2018-09-28 17:54:21 +02:00
|
|
|
TableModel *slew_model_;
|
2018-11-26 18:15:52 +01:00
|
|
|
TableModel *slew_sigma_models_[EarlyLate::index_count];
|
2023-02-08 17:23:24 +01:00
|
|
|
ReceiverModelPtr receiver_model_;
|
2023-03-22 17:57:54 +01:00
|
|
|
OutputWaveforms *output_waveforms_;
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CheckTableModel : public CheckTimingModel
|
|
|
|
|
{
|
|
|
|
|
public:
|
2019-06-04 17:12:22 +02:00
|
|
|
explicit CheckTableModel(TableModel *model,
|
|
|
|
|
TableModel *sigma_models[EarlyLate::index_count]);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual ~CheckTableModel();
|
2018-11-26 18:15:52 +01:00
|
|
|
virtual void checkDelay(const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float from_slew,
|
|
|
|
|
float to_slew,
|
|
|
|
|
float related_out_cap,
|
2019-01-27 08:03:01 +01:00
|
|
|
bool pocv_enabled,
|
2018-11-26 18:15:52 +01:00
|
|
|
// Return values.
|
|
|
|
|
ArcDelay &margin) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual void reportCheckDelay(const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float from_slew,
|
|
|
|
|
const char *from_slew_annotation,
|
|
|
|
|
float to_slew,
|
|
|
|
|
float related_out_cap,
|
2019-01-27 08:03:01 +01:00
|
|
|
bool pocv_enabled,
|
2018-09-28 17:54:21 +02:00
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
2022-06-07 05:57:09 +02:00
|
|
|
const TableModel *model() const { return model_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
// Check the axes before making the model.
|
|
|
|
|
// Return true if the model axes are supported.
|
2023-01-18 18:23:03 +01:00
|
|
|
static bool checkAxes(const TablePtr table);
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void setIsScaled(bool is_scaled);
|
2019-01-27 08:03:01 +01:00
|
|
|
float findValue(const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
const TableModel *model,
|
|
|
|
|
float from_slew,
|
|
|
|
|
float to_slew,
|
|
|
|
|
float related_out_cap) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
void findAxisValues(float from_slew,
|
|
|
|
|
float to_slew,
|
|
|
|
|
float related_out_cap,
|
|
|
|
|
// Return values.
|
|
|
|
|
float &axis_value1,
|
|
|
|
|
float &axis_value2,
|
|
|
|
|
float &axis_value3) const;
|
2022-06-26 01:31:18 +02:00
|
|
|
float axisValue(TableAxisPtr axis,
|
2018-09-28 17:54:21 +02:00
|
|
|
float load_cap,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float related_out_cap) const;
|
2019-01-27 08:03:01 +01:00
|
|
|
void reportTableDelay(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
const TableModel *model,
|
|
|
|
|
float from_slew,
|
|
|
|
|
const char *from_slew_annotation,
|
|
|
|
|
float to_slew,
|
|
|
|
|
float related_out_cap,
|
|
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
2022-06-26 01:31:18 +02:00
|
|
|
static bool checkAxis(TableAxisPtr axis);
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
TableModel *model_;
|
2019-01-27 08:03:01 +01:00
|
|
|
TableModel *sigma_models_[EarlyLate::index_count];
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Wrapper class for Table to apply scale factors.
|
|
|
|
|
class TableModel
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-01-18 18:23:03 +01:00
|
|
|
TableModel(TablePtr table,
|
2022-06-07 05:57:09 +02:00
|
|
|
TableTemplate *tbl_template,
|
2018-09-28 17:54:21 +02:00
|
|
|
ScaleFactorType scale_factor_type,
|
2019-11-11 23:30:19 +01:00
|
|
|
RiseFall *rf);
|
2018-09-28 17:54:21 +02:00
|
|
|
void setScaleFactorType(ScaleFactorType type);
|
|
|
|
|
int order() const;
|
2022-06-07 05:57:09 +02:00
|
|
|
TableTemplate *tblTemplate() const { return tbl_template_; }
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis1() const;
|
|
|
|
|
TableAxisPtr axis2() const;
|
|
|
|
|
TableAxisPtr axis3() const;
|
2018-09-28 17:54:21 +02:00
|
|
|
void setIsScaled(bool is_scaled);
|
2022-06-07 05:57:09 +02:00
|
|
|
float value(size_t index1,
|
|
|
|
|
size_t index2,
|
|
|
|
|
size_t index3) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
// Table interpolated lookup.
|
|
|
|
|
float findValue(float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const;
|
|
|
|
|
// Table interpolated lookup with scale factor.
|
|
|
|
|
float findValue(const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const;
|
|
|
|
|
void reportValue(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
const char *comment1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3,
|
2023-02-08 17:23:24 +01:00
|
|
|
const Unit *table_unit,
|
|
|
|
|
int digits,
|
2018-09-28 17:54:21 +02:00
|
|
|
string *result) const;
|
|
|
|
|
void report(const Units *units,
|
|
|
|
|
Report *report) const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
float scaleFactor(const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt) const;
|
|
|
|
|
void reportPvtScaleFactor(const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
|
2023-01-18 18:23:03 +01:00
|
|
|
TablePtr table_;
|
2022-06-07 05:57:09 +02:00
|
|
|
TableTemplate *tbl_template_;
|
2019-03-13 01:25:53 +01:00
|
|
|
// ScaleFactorType gcc barfs if this is dcl'd.
|
|
|
|
|
unsigned scale_factor_type_:scale_factor_bits;
|
2023-03-08 01:03:26 +01:00
|
|
|
unsigned rf_index_:RiseFall::index_bit_count;
|
2018-09-28 17:54:21 +02:00
|
|
|
bool is_scaled_:1;
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-08 17:23:24 +01:00
|
|
|
// Abstract base class for 0, 1, 2, or 3 dimesnion float tables.
|
2018-09-28 17:54:21 +02:00
|
|
|
class Table
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Table() {}
|
|
|
|
|
virtual ~Table() {}
|
|
|
|
|
void setScaleFactorType(ScaleFactorType type);
|
|
|
|
|
virtual int order() const = 0;
|
2022-06-26 01:31:18 +02:00
|
|
|
virtual TableAxisPtr axis1() const { return nullptr; }
|
|
|
|
|
virtual TableAxisPtr axis2() const { return nullptr; }
|
|
|
|
|
virtual TableAxisPtr axis3() const { return nullptr; }
|
2018-09-28 17:54:21 +02:00
|
|
|
void setIsScaled(bool is_scaled);
|
2022-06-07 05:57:09 +02:00
|
|
|
virtual float value(size_t axis_idx1,
|
|
|
|
|
size_t axis_idx2,
|
|
|
|
|
size_t axis_idx3) const = 0;
|
2018-09-28 17:54:21 +02:00
|
|
|
// Table interpolated lookup.
|
|
|
|
|
virtual float findValue(float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const = 0;
|
|
|
|
|
// Table interpolated lookup with scale factor.
|
|
|
|
|
float findValue(const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const;
|
|
|
|
|
virtual void reportValue(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
const char *comment1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3,
|
2023-02-08 17:23:24 +01:00
|
|
|
const Unit *table_unit,
|
2018-09-28 17:54:21 +02:00
|
|
|
int digits,
|
|
|
|
|
string *result) const = 0;
|
|
|
|
|
virtual void report(const Units *units,
|
|
|
|
|
Report *report) const = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Zero dimension (scalar) table.
|
|
|
|
|
class Table0 : public Table
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Table0(float value);
|
|
|
|
|
virtual int order() const { return 0; }
|
2022-06-07 05:57:09 +02:00
|
|
|
virtual float value(size_t index1,
|
|
|
|
|
size_t index2,
|
|
|
|
|
size_t index3) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual float findValue(float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const;
|
|
|
|
|
virtual void reportValue(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
const char *comment1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3,
|
2023-02-08 17:23:24 +01:00
|
|
|
const Unit *table_unit,
|
2018-09-28 17:54:21 +02:00
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
virtual void report(const Units *units,
|
|
|
|
|
Report *report) const;
|
|
|
|
|
using Table::findValue;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
float value_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// One dimensional table.
|
|
|
|
|
class Table1 : public Table
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-03-22 17:57:54 +01:00
|
|
|
Table1();
|
2018-09-28 17:54:21 +02:00
|
|
|
Table1(FloatSeq *values,
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis1);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual ~Table1();
|
2023-03-22 17:57:54 +01:00
|
|
|
Table1(Table1 &&table);
|
|
|
|
|
Table1 &operator= (Table1 &&table);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual int order() const { return 1; }
|
2022-06-26 01:31:18 +02:00
|
|
|
virtual TableAxisPtr axis1() const { return axis1_; }
|
2022-06-07 05:57:09 +02:00
|
|
|
virtual float value(size_t index1,
|
|
|
|
|
size_t index2,
|
|
|
|
|
size_t index3) const;
|
|
|
|
|
float value(size_t index1) const;
|
2023-03-22 17:57:54 +01:00
|
|
|
float findValue(float value1) const;
|
|
|
|
|
float findValue(float value1,
|
|
|
|
|
bool extrapolate) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual float findValue(float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const;
|
|
|
|
|
virtual void reportValue(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
const char *comment1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3,
|
2023-02-08 17:23:24 +01:00
|
|
|
const Unit *table_unit,
|
2018-09-28 17:54:21 +02:00
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
virtual void report(const Units *units,
|
|
|
|
|
Report *report) const;
|
2023-03-22 17:57:54 +01:00
|
|
|
FloatSeq *values() const { return values_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
using Table::findValue;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
FloatSeq *values_;
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis1_;
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Two dimensional table.
|
|
|
|
|
class Table2 : public Table
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Table2(FloatTable *values,
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis1,
|
|
|
|
|
TableAxisPtr axis2);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual ~Table2();
|
|
|
|
|
virtual int order() const { return 2; }
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis1() const { return axis1_; }
|
|
|
|
|
TableAxisPtr axis2() const { return axis2_; }
|
2022-06-07 05:57:09 +02:00
|
|
|
virtual float value(size_t index1,
|
|
|
|
|
size_t index2,
|
|
|
|
|
size_t index3) const;
|
|
|
|
|
float value(size_t index1,
|
|
|
|
|
size_t index2) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual float findValue(float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const;
|
2023-02-08 17:23:24 +01:00
|
|
|
FloatTable *values3() { return values_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual void reportValue(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
const char *comment1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3,
|
2023-02-08 17:23:24 +01:00
|
|
|
const Unit *table_unit,
|
2018-09-28 17:54:21 +02:00
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
virtual void report(const Units *units,
|
|
|
|
|
Report *report) const;
|
|
|
|
|
using Table::findValue;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FloatTable *values_;
|
|
|
|
|
// Row.
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis1_;
|
2018-09-28 17:54:21 +02:00
|
|
|
// Column.
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis2_;
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Three dimensional table.
|
|
|
|
|
class Table3 : public Table2
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Table3(FloatTable *values,
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis1,
|
|
|
|
|
TableAxisPtr axis2,
|
|
|
|
|
TableAxisPtr axis3);
|
|
|
|
|
virtual ~Table3() {}
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual int order() const { return 3; }
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis3() const { return axis3_; }
|
2022-06-07 05:57:09 +02:00
|
|
|
virtual float value(size_t index1,
|
|
|
|
|
size_t index2,
|
|
|
|
|
size_t index3) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual float findValue(float value1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3) const;
|
|
|
|
|
virtual void reportValue(const char *result_name,
|
|
|
|
|
const LibertyLibrary *library,
|
|
|
|
|
const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float value1,
|
|
|
|
|
const char *comment1,
|
|
|
|
|
float value2,
|
|
|
|
|
float value3,
|
2023-02-08 17:23:24 +01:00
|
|
|
const Unit *table_unit,
|
2018-09-28 17:54:21 +02:00
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
virtual void report(const Units *units,
|
|
|
|
|
Report *report) const;
|
|
|
|
|
using Table::findValue;
|
|
|
|
|
|
|
|
|
|
private:
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr axis3_;
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TableAxis
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TableAxis(TableAxisVariable variable,
|
|
|
|
|
FloatSeq *values);
|
|
|
|
|
~TableAxis();
|
|
|
|
|
TableAxisVariable variable() const { return variable_; }
|
2023-02-08 17:23:24 +01:00
|
|
|
const char *variableString() const;
|
|
|
|
|
const Unit *unit(const Units *units);
|
2018-09-28 17:54:21 +02:00
|
|
|
size_t size() const { return values_->size(); }
|
|
|
|
|
float axisValue(size_t index) const { return (*values_)[index]; }
|
|
|
|
|
// Find the index for value such that axis[index] <= value < axis[index+1].
|
|
|
|
|
size_t findAxisIndex(float value) const;
|
2023-02-08 17:23:24 +01:00
|
|
|
void findAxisIndex(float value,
|
|
|
|
|
// Return values.
|
|
|
|
|
size_t &index,
|
|
|
|
|
bool &exists) const;
|
2022-06-12 01:28:13 +02:00
|
|
|
FloatSeq *values() const { return values_; }
|
2023-03-22 17:57:54 +01:00
|
|
|
float min() const { return (*values_)[0]; }
|
|
|
|
|
float max() const { return (*values_)[values_->size() - 1]; }
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TableAxisVariable variable_;
|
|
|
|
|
FloatSeq *values_;
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-08 17:23:24 +01:00
|
|
|
////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class ReceiverModel
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ReceiverModel();
|
|
|
|
|
~ReceiverModel();
|
|
|
|
|
void setCapacitanceModel(TableModel *table_model,
|
|
|
|
|
int index,
|
|
|
|
|
RiseFall *rf);
|
|
|
|
|
static bool checkAxes(TablePtr table);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TableModel *capacitance_models_[2][RiseFall::index_count];
|
|
|
|
|
};
|
|
|
|
|
|
2023-03-22 17:57:54 +01:00
|
|
|
class OutputWaveform
|
2023-02-08 17:23:24 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2023-03-22 17:57:54 +01:00
|
|
|
OutputWaveform(float axis_value1,
|
|
|
|
|
float axis_value2,
|
|
|
|
|
Table1 *currents,
|
|
|
|
|
float reference_time);
|
|
|
|
|
OutputWaveform(float slew,
|
|
|
|
|
float cap,
|
|
|
|
|
Table1 *currents,
|
|
|
|
|
Table1 *voltages,
|
|
|
|
|
float reference_time);
|
|
|
|
|
~OutputWaveform();
|
|
|
|
|
float slew() const { return slew_; }
|
|
|
|
|
float cap() const { return cap_; }
|
|
|
|
|
TableAxisPtr timeAxis() const { return currents_->axis1(); }
|
2023-02-08 17:23:24 +01:00
|
|
|
Table1 *currents() const { return currents_; }
|
2023-03-22 17:57:54 +01:00
|
|
|
Table1 *voltages();
|
2023-02-08 17:23:24 +01:00
|
|
|
float referenceTime() const { return reference_time_; }
|
|
|
|
|
static bool checkAxes(TableTemplate *tbl_template);
|
2023-03-22 17:57:54 +01:00
|
|
|
string reportCurrentWaveform(const Units *units,
|
|
|
|
|
int digits) const;
|
|
|
|
|
string reportVoltageWaveform(const Units *units,
|
|
|
|
|
int digits) const;
|
|
|
|
|
string reportWaveform(const Table1 *waveform,
|
|
|
|
|
const Unit *time_unit,
|
|
|
|
|
const Unit *waveform_unit,
|
|
|
|
|
int digits) const;
|
2023-02-08 17:23:24 +01:00
|
|
|
|
|
|
|
|
private:
|
2023-03-22 17:57:54 +01:00
|
|
|
float slew_;
|
|
|
|
|
float cap_;
|
2023-02-08 17:23:24 +01:00
|
|
|
Table1 *currents_;
|
2023-03-22 17:57:54 +01:00
|
|
|
Table1 *voltages_;
|
2023-02-08 17:23:24 +01:00
|
|
|
float reference_time_;
|
|
|
|
|
};
|
|
|
|
|
|
2023-03-22 17:57:54 +01:00
|
|
|
// Two dimensional (slew/cap) table of one dimensional time/current tables.
|
|
|
|
|
class OutputWaveforms
|
2023-02-08 17:23:24 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2023-03-22 17:57:54 +01:00
|
|
|
OutputWaveforms(TableAxisPtr slew_axis,
|
|
|
|
|
TableAxisPtr cap_axis,
|
|
|
|
|
Vector<OutputWaveform*> &waveforms);
|
|
|
|
|
~OutputWaveforms();
|
|
|
|
|
OutputWaveform voltageWaveform(float in_slew,
|
|
|
|
|
float load_cap);
|
2023-02-08 17:23:24 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// Row.
|
2023-03-22 17:57:54 +01:00
|
|
|
TableAxisPtr slew_axis_;
|
2023-02-08 17:23:24 +01:00
|
|
|
// Column.
|
2023-03-22 17:57:54 +01:00
|
|
|
TableAxisPtr cap_axis_;
|
|
|
|
|
OutputWaveformSeq waveforms_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class DriverWaveform
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
DriverWaveform(const char *name,
|
|
|
|
|
TablePtr waveforms);
|
|
|
|
|
~DriverWaveform();
|
|
|
|
|
const char *name() const { return name_; }
|
|
|
|
|
Table1 waveform(float slew);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
const char *name_;
|
|
|
|
|
TablePtr waveforms_;
|
2023-02-08 17:23:24 +01:00
|
|
|
};
|
|
|
|
|
|
2018-09-28 17:54:21 +02:00
|
|
|
} // namespace
|