Files
OpenSTA/include/sta/TableModel.hh
James Cherry f6253af8a9 ccs ceff delay calc
commit 87130be63ddbf1a7fb65986b02839eb4c0b13168
Author: James Cherry <cherry@parallaxsw.com>
Date:   Tue Feb 27 09:49:02 2024 -0700

    ccs ceff delay calc

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit de0dd38dabda2f7ef51b49c196c2787a0d3c5784
Author: James Cherry <cherry@parallaxsw.com>
Date:   Tue Feb 27 07:40:11 2024 -0700

    dcalc public funcs

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit dd7fcb12f929b9b0a391653cad42e617f9cbdd3b
Author: James Cherry <cherry@parallaxsw.com>
Date:   Mon Feb 26 09:08:37 2024 -0700

    mv CircuitSim.hh to include

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 9663e46d28ece544ee1453f229990c9db9e0efec
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 25 17:58:57 2024 -0700

    ArcDcalcArg

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 76b0588034faaefd2302c865c441975f76386d3f
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 25 15:36:46 2024 -0700

    ensureVoltageWaveforms

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit f88e67b861c56752e5b36efe2b552ba0077a7180
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 25 15:00:02 2024 -0700

    const

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 8f32cc571dcadee0185b08f951a1f79d46e7984d
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 25 14:57:51 2024 -0700

    Graph::gateEdgeArc

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit ac3cb35cb6732d7ecbf0532d7351a3ff2a917fc9
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 25 14:31:30 2024 -0700

    ConcreteParasiticSubNodeMap, ConcreteParasiticPinNodeMap use id cmp

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit cbfe4eac463036c26a64701239d7651d91a09778
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 25 14:08:41 2024 -0700

    WriteSpice

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 8b5d30f1a8b1ccb8c9cbd9d7ba93418907c41b2a
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sat Feb 24 09:45:46 2024 -0700

    emplace_push

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 5335a2eaaf737ed7c7a8cff30654a68c4ac4c8e4
Author: James Cherry <cherry@parallaxsw.com>
Date:   Fri Feb 23 16:19:30 2024 -0700

    Parasitics::findParasiticNode

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit ce92f3caf28afb0e0384799f08166cfb0aecfea0
Author: James Cherry <cherry@parallaxsw.com>
Date:   Fri Feb 23 15:53:28 2024 -0700

    Parasitics::findParasiticNode

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 0c591430c725a3ebd50d2892673dca76e023dc32
Author: James Cherry <cherry@parallaxsw.com>
Date:   Fri Feb 23 09:03:18 2024 -0700

    Parsitics::name(node) const

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 499c297e64d1487388f549843ff9ea05e8555cfc
Author: James Cherry <cherry@parallaxsw.com>
Date:   Fri Feb 23 09:03:07 2024 -0700

    write_spice umr

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 6984c398dbce9e6266fab8377a844bc518481d9d
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 22 18:42:34 2024 -0700

    gcc warning

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit edec16519806013623194d8201e804dec81a51dd
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 22 17:54:11 2024 -0700

    no cuddification

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 4a0e1070c179b2f8615b604c362359ce4b3a0e2e
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 22 17:29:46 2024 -0700

    sim const

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 2e941fafa631f6b9bc0f82784b9146de2449e9c5
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 22 17:29:39 2024 -0700

    sdc comment

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 1c12f56aee7115fcb06807b5b6c626d1a419ccdc
Author: James Cherry <cherry@parallaxsw.com>
Date:   Wed Feb 21 13:13:29 2024 -0700

    Sim use Bdd class

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit b70c41d5caec56c3001b834141b6dab89bb933ed
Author: James Cherry <cherry@parallaxsw.com>
Date:   Tue Feb 20 12:18:27 2024 -0700

    write_spice coupling caps

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 614d2cd41a1a9cf850dbe480954a5f58ee0dc21e
Author: James Cherry <cherry@parallaxsw.com>
Date:   Mon Feb 19 14:37:30 2024 -0700

    write_spice time offset

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit f0ba1fca0dfca384e6fb0be302bba9ced71ee41c
Author: James Cherry <cherry@parallaxsw.com>
Date:   Mon Feb 19 10:59:18 2024 -0700

    class Bdd for cudd

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 24c94756334fce5e70e97ce0ee31375ae4e59b84
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 18 08:58:30 2024 -0700

    WriteSpice

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 47a4505d88bdfe4a85056895f8b7d842e07dce8d
Author: James Cherry <cherry@parallaxsw.com>
Date:   Fri Feb 16 21:34:23 2024 -0700

    default sim ngspice

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 06e279555a076e218f0a9c308e8937a6fc8fdea4
Author: James Cherry <cherry@parallaxsw.com>
Date:   Fri Feb 16 21:34:01 2024 -0700

    WriteSpice refactor

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 06e3f0734edbbbd69ad063e97d1d8cca92a83aea
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 15 15:18:35 2024 -0700

    mv report_dcalc to DelayCalc.tcl

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 922056471a6d380699bbd0623f95637401d23eff
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 15 14:27:31 2024 -0700

    WriteSpice::cell_spice_port_names_

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 732922ead68097e3f7da268ecc5ae2ca2daa4492
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 15 13:35:13 2024 -0700

    WritePathSpice.hh

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 8cd6e2ffc6ad66e831630273b5eacd192259191e
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 15 10:11:39 2024 -0700

    small

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit f7f6bfb49f43ddc3e45c294f89c8814d60df5220
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu Feb 15 09:48:09 2024 -0700

    refactor WritePathSpice

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit f74db730c3e8c67a24d531266510e4376db463d3
Author: James Cherry <cherry@parallaxsw.com>
Date:   Wed Feb 14 09:22:01 2024 -0700

    Sta.hh

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 051532deef203cae97e32e8af7a2348bfd8912cc
Author: James Cherry <cherry@parallaxsw.com>
Date:   Wed Feb 14 08:14:44 2024 -0700

    PowerClass.hh

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit bfb8357d1093e5d3da14e708acd21fc21ba3b0dd
Author: James Cherry <cherry@parallaxsw.com>
Date:   Wed Feb 14 08:08:56 2024 -0700

    doc

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 8fe28ec91b234d9d8210019aa46a2e8107aa497a
Author: James Cherry <cherry@parallaxsw.com>
Date:   Wed Feb 14 07:32:34 2024 -0700

    ClkSkew use seq instead of set

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit c4e3a3a0315ab4f6160a707e838423bb734f5363
Author: James Cherry <cherry@parallaxsw.com>
Date:   Tue Feb 13 19:26:45 2024 -0700

    report_clock_latency

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 51fb6657d9706c7443e1c269cfe63cf080b05d50
Author: James Cherry <cherry@parallaxsw.com>
Date:   Tue Feb 13 11:10:11 2024 -0700

    report_clock_latency

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit e639ee129d13e1c11b34bca0762b8136b18563f3
Author: James Cherry <cherry@parallaxsw.com>
Date:   Mon Feb 12 11:19:06 2024 -0700

    ClkSkew use map

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit e91d3ea8142a73b7b607dfdf53b3fce8e2f16984
Author: James Cherry <cherry@parallaxsw.com>
Date:   Mon Feb 12 10:18:27 2024 -0700

    report_clock_skew report format

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit c650b7ec63b83382ba9cec7d187ffee8a031c2ce
Author: James Cherry <cherry@parallaxsw.com>
Date:   Mon Feb 12 09:22:29 2024 -0700

    report_clock_skew include macro clock_tree_path_delay

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit cf14b230a9944b95ba43ef7c09e553d9014990eb
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 11 11:03:29 2024 -0700

    clk skew range iter

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit e7e0342e063ac876d00d03fd1ff0eab1715cfde4
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sun Feb 11 08:11:29 2024 -0700

    write_spice sensitize and3

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

commit 743ceb676c763ac5bcbf05e630a4da1b507c537d
Author: James Cherry <cherry@parallaxsw.com>
Date:   Sat Feb 10 18:07:04 2024 -0700

    write spice

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

Signed-off-by: James Cherry <cherry@parallaxsw.com>
2024-02-27 10:00:48 -07:00

561 lines
18 KiB
C++

// OpenSTA, Static Timing Analyzer
// Copyright (c) 2024, Parallax Software, Inc.
//
// 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/>.
#pragma once
#include <string>
#include <memory>
#include "MinMax.hh"
#include "Vector.hh"
#include "Transition.hh"
#include "LibertyClass.hh"
#include "TimingModel.hh"
namespace sta {
using std::string;
class Unit;
class Units;
class Report;
class Table;
class OutputWaveforms;
class Table1;
typedef Vector<float> FloatSeq;
typedef Vector<FloatSeq*> FloatTable;
typedef Vector<Table1*> Table1Seq;
TableAxisVariable
stringTableAxisVariable(const char *variable);
const char *
tableVariableString(TableAxisVariable variable);
const Unit *
tableVariableUnit(TableAxisVariable variable,
const Units *units);
class GateTableModel : public GateTimingModel
{
public:
GateTableModel(LibertyCell *cell,
TableModel *delay_model,
TableModel *delay_sigma_models[EarlyLate::index_count],
TableModel *slew_model,
TableModel *slew_sigma_models[EarlyLate::index_count],
ReceiverModelPtr receiver_model,
OutputWaveforms *output_waveforms);
virtual ~GateTableModel();
void gateDelay(const Pvt *pvt,
float in_slew,
float load_cap,
bool pocv_enabled,
// Return values.
ArcDelay &gate_delay,
Slew &drvr_slew) const override;
// related_out_cap arg removed.
void gateDelay(const Pvt *pvt,
float in_slew,
float load_cap,
float related_out_cap,
bool pocv_enabled,
ArcDelay &gate_delay,
Slew &drvr_slew) const __attribute__ ((deprecated));
string reportGateDelay(const Pvt *pvt,
float in_slew,
float load_cap,
bool pocv_enabled,
int digits) const override;
float driveResistance(const Pvt *pvt) const override;
const TableModel *delayModel() const { return delay_model_; }
const TableModel *slewModel() const { return slew_model_; }
const ReceiverModel *receiverModel() const { return receiver_model_.get(); }
OutputWaveforms *outputWaveforms() const { return output_waveforms_; }
// Check the axes before making the model.
// Return true if the model axes are supported.
static bool checkAxes(const TablePtr &table);
protected:
void maxCapSlew(float in_slew,
const Pvt *pvt,
float &slew,
float &cap) const;
void setIsScaled(bool is_scaled) override;
float axisValue(const TableAxis *axis,
float load_cap,
float in_slew,
float related_out_cap) const;
float findValue(const Pvt *pvt,
const TableModel *model,
float in_slew,
float load_cap,
float related_out_cap) const;
string reportTableLookup(const char *result_name,
const Pvt *pvt,
const TableModel *model,
float in_slew,
float load_cap,
float related_out_cap,
int digits) 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;
static bool checkAxis(const TableAxis *axis);
TableModel *delay_model_;
TableModel *delay_sigma_models_[EarlyLate::index_count];
TableModel *slew_model_;
TableModel *slew_sigma_models_[EarlyLate::index_count];
ReceiverModelPtr receiver_model_;
OutputWaveforms *output_waveforms_;
};
class CheckTableModel : public CheckTimingModel
{
public:
explicit CheckTableModel(LibertyCell *cell,
TableModel *model,
TableModel *sigma_models[EarlyLate::index_count]);
virtual ~CheckTableModel();
ArcDelay checkDelay(const Pvt *pvt,
float from_slew,
float to_slew,
float related_out_cap,
bool pocv_enabled) const override;
string reportCheckDelay(const Pvt *pvt,
float from_slew,
const char *from_slew_annotation,
float to_slew,
float related_out_cap,
bool pocv_enabled,
int digits) const override;
const TableModel *model() const { return model_; }
// Check the axes before making the model.
// Return true if the model axes are supported.
static bool checkAxes(const TablePtr table);
protected:
void setIsScaled(bool is_scaled) override;
float findValue(const Pvt *pvt,
const TableModel *model,
float from_slew,
float to_slew,
float related_out_cap) const;
void findAxisValues(float from_slew,
float to_slew,
float related_out_cap,
// Return values.
float &axis_value1,
float &axis_value2,
float &axis_value3) const;
float axisValue(const TableAxis *axis,
float load_cap,
float in_slew,
float related_out_cap) const;
string reportTableDelay(const char *result_name,
const Pvt *pvt,
const TableModel *model,
float from_slew,
const char *from_slew_annotation,
float to_slew,
float related_out_cap,
int digits) const;
static bool checkAxis(const TableAxis *axis);
TableModel *model_;
TableModel *sigma_models_[EarlyLate::index_count];
};
// Wrapper class for Table to apply scale factors.
class TableModel
{
public:
TableModel(TablePtr table,
TableTemplate *tbl_template,
ScaleFactorType scale_factor_type,
const RiseFall *rf);
void setScaleFactorType(ScaleFactorType type);
int order() const;
TableTemplate *tblTemplate() const { return tbl_template_; }
const TableAxis *axis1() const;
const TableAxis *axis2() const;
const TableAxis *axis3() const;
void setIsScaled(bool is_scaled);
float value(size_t index1,
size_t index2,
size_t index3) const;
// Table interpolated lookup.
float findValue(float value1,
float value2,
float value3) const;
// Table interpolated lookup with scale factor.
float findValue(const LibertyCell *cell,
const Pvt *pvt,
float value1,
float value2,
float value3) const;
string reportValue(const char *result_name,
const LibertyCell *cell,
const Pvt *pvt,
float value1,
const char *comment1,
float value2,
float value3,
const Unit *table_unit,
int digits) const;
string report(const Units *units,
Report *report) const;
protected:
float scaleFactor(const LibertyCell *cell,
const Pvt *pvt) const;
string reportPvtScaleFactor(const LibertyCell *cell,
const Pvt *pvt,
int digits) const;
TablePtr table_;
TableTemplate *tbl_template_;
// ScaleFactorType gcc barfs if this is dcl'd.
unsigned scale_factor_type_:scale_factor_bits;
unsigned rf_index_:RiseFall::index_bit_count;
bool is_scaled_:1;
};
// Abstract base class for 0, 1, 2, or 3 dimesnion float tables.
class Table
{
public:
Table() {}
virtual ~Table() {}
void setScaleFactorType(ScaleFactorType type);
virtual int order() const = 0;
virtual const TableAxis *axis1() const { return nullptr; }
virtual const TableAxis *axis2() const { return nullptr; }
virtual const TableAxis *axis3() const { return nullptr; }
void setIsScaled(bool is_scaled);
virtual float value(size_t axis_idx1,
size_t axis_idx2,
size_t axis_idx3) const = 0;
// Table interpolated lookup.
virtual float findValue(float axis_value1,
float axis_value2,
float axis_value3) const = 0;
// Table interpolated lookup with scale factor.
float findValue(const LibertyLibrary *library,
const LibertyCell *cell,
const Pvt *pvt,
float axis_value1,
float axis_value2,
float axis_value3) const;
virtual string reportValue(const char *result_name,
const LibertyCell *cell,
const Pvt *pvt,
float value1,
const char *comment1,
float value2,
float value3,
const Unit *table_unit,
int digits) const = 0;
virtual void report(const Units *units,
Report *report) const = 0;
};
// Zero dimension (scalar) table.
class Table0 : public Table
{
public:
Table0(float value);
int order() const override { return 0; }
float value(size_t axis_index1,
size_t axis_index2,
size_t axis_index3) const override;
float findValue(float axis_value1,
float axis_value2,
float axis_value3) const override;
string reportValue(const char *result_name,
const LibertyCell *cell,
const Pvt *pvt,
float value1,
const char *comment1,
float value2,
float value3,
const Unit *table_unit,
int digits) const override;
void report(const Units *units,
Report *report) const override;
using Table::findValue;
private:
float value_;
};
// One dimensional table.
class Table1 : public Table
{
public:
Table1();
Table1(FloatSeq *values,
TableAxisPtr axis1);
virtual ~Table1();
Table1(Table1 &&table);
Table1(const Table1 &table);
Table1 &operator= (Table1 &&table);
int order() const override { return 1; }
const TableAxis *axis1() const override { return axis1_.get(); }
const TableAxisPtr axis1ptr() const { return axis1_; }
float value(size_t axis_index1,
size_t axis_index2,
size_t axis_index3) const override;
float findValue(float value1,
float value2,
float value3) const override;
string reportValue(const char *result_name,
const LibertyCell *cell,
const Pvt *pvt,
float value1,
const char *comment1,
float value2,
float value3,
const Unit *table_unit,
int digits) const override;
void report(const Units *units,
Report *report) const override;
// Table1 specific functions.
float value(size_t index1) const;
void findValue(float axis_value1,
// Return values.
float &value,
bool &extrapolated) const;
float findValue(float axis_value1) const;
float findValueClip(float axis_value1) const;
FloatSeq *values() const { return values_; }
using Table::findValue;
private:
FloatSeq *values_;
TableAxisPtr axis1_;
};
// Two dimensional table.
class Table2 : public Table
{
public:
Table2(FloatTable *values,
TableAxisPtr axis1,
TableAxisPtr axis2);
virtual ~Table2();
int order() const override { return 2; }
const TableAxis *axis1() const override { return axis1_.get(); }
const TableAxis *axis2() const override { return axis2_.get(); }
float value(size_t axis_index1,
size_t axis_index2,
size_t axis_index3) const override;
float findValue(float value1,
float value2,
float value3) const override;
string reportValue(const char *result_name,
const LibertyCell *cell,
const Pvt *pvt,
float value1,
const char *comment1,
float value2,
float value3,
const Unit *table_unit,
int digits) const override;
void report(const Units *units,
Report *report) const override;
// Table2 specific functions.
float value(size_t axis_index1,
size_t axis_index2) const;
FloatTable *values3() { return values_; }
using Table::findValue;
protected:
FloatTable *values_;
// Row.
TableAxisPtr axis1_;
// Column.
TableAxisPtr axis2_;
};
// Three dimensional table.
class Table3 : public Table2
{
public:
Table3(FloatTable *values,
TableAxisPtr axis1,
TableAxisPtr axis2,
TableAxisPtr axis3);
virtual ~Table3() {}
int order() const override { return 3; }
const TableAxis *axis1() const override { return axis1_.get(); }
const TableAxis *axis2() const override { return axis2_.get(); }
const TableAxis *axis3() const override { return axis3_.get(); }
float value(size_t axis_index1,
size_t axis_index2,
size_t axis_index3) const override;
float findValue(float value1,
float value2,
float value3) const override;
string reportValue(const char *result_name,
const LibertyCell *cell,
const Pvt *pvt,
float value1,
const char *comment1,
float value2,
float value3,
const Unit *table_unit,
int digits) const override;
void report(const Units *units,
Report *report) const override;
using Table::findValue;
private:
TableAxisPtr axis3_;
};
class TableAxis
{
public:
TableAxis(TableAxisVariable variable,
FloatSeq *values);
~TableAxis();
TableAxisVariable variable() const { return variable_; }
const char *variableString() const;
const Unit *unit(const Units *units);
size_t size() const { return values_->size(); }
bool inBounds(float value) const;
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;
void findAxisIndex(float value,
// Return values.
size_t &index,
bool &exists) const;
FloatSeq *values() const { return values_; }
float min() const { return (*values_)[0]; }
float max() const { return (*values_)[values_->size() - 1]; }
private:
TableAxisVariable variable_;
FloatSeq *values_;
};
////////////////////////////////////////////////////////////////
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];
};
// Two dimensional (slew/cap) table of one dimensional time/current tables.
class OutputWaveforms
{
public:
OutputWaveforms(TableAxisPtr slew_axis,
TableAxisPtr cap_axis,
const RiseFall *rf,
Table1Seq &current_waveforms,
Table1 *ref_times);
~OutputWaveforms();
const RiseFall *rf() const { return rf_; }
const TableAxis *slewAxis() const { return slew_axis_.get(); }
const TableAxis *capAxis() const { return cap_axis_.get(); }
Table1 voltageWaveform(float in_slew,
float load_cap);
float voltageTime(float in_slew,
float load_cap,
float voltage);
const Table1 *currentWaveform(float slew,
float cap);
float timeCurrent(float slew,
float cap,
float time);
float timeVoltage(float slew,
float cap,
float time);
float voltageCurrent(float slew,
float cap,
float volt);
float referenceTime(float slew);
void makeVoltageWaveforms(float vdd);
static bool checkAxes(const TableTemplate *tbl_template);
private:
void findVoltages(size_t wave_index,
float cap);
float waveformValue(float slew,
float cap,
float axis_value,
Table1Seq &waveforms);
float voltageTime1(float voltage,
size_t wave_index);
void waveformMinMaxTime(float slew,
float cap,
Table1Seq &waveforms,
// Return values.
float &min_time,
float &max_time);
// Row.
TableAxisPtr slew_axis_;
// Column.
TableAxisPtr cap_axis_;
const RiseFall *rf_;
Table1Seq current_waveforms_;
Table1Seq voltage_waveforms_;
Table1Seq voltage_currents_;
FloatTable voltage_times_;
Table1 *ref_times_;
float vdd_;
static constexpr size_t voltage_waveform_step_count_ = 20;
};
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_;
};
} // namespace