liberty reader rewrite

Signed-off-by: James Cherry <[email protected]>
This commit is contained in:
James Cherry
2026-02-27 17:12:50 -08:00
parent a47a8dd831
commit c010a0f99e
33 changed files with 4109 additions and 6830 deletions
+2 -2
View File
@@ -253,7 +253,7 @@ public:
float wire_delay) const;
// Check for supported axis variables.
// Return true if axes are supported.
static bool checkSlewDegradationAxes(const TablePtr &table);
static bool checkSlewDegradationAxes(const TableModel *table_model);
float defaultInputPinCap() const { return default_input_pin_cap_; }
void setDefaultInputPinCap(float cap);
@@ -1051,7 +1051,7 @@ public:
void setScale(ScaleFactorType type,
ScaleFactorPvt pvt,
float scale);
void print();
void report(Report *report);
protected:
std::string name_;
+17 -9
View File
@@ -49,6 +49,7 @@ using FloatTable = std::vector<FloatSeq>;
// Sequence of 1D tables (order 1).
using Table1Seq = std::vector<Table*>;
using Waveform = Table;
using TableModelsEarlyLate = std::array<TableModel*, EarlyLate::index_count>;
TableAxisVariable
stringTableAxisVariable(const char *variable);
@@ -63,11 +64,14 @@ class GateTableModel : public GateTimingModel
public:
GateTableModel(LibertyCell *cell,
TableModel *delay_model,
TableModel *delay_sigma_models[EarlyLate::index_count],
TableModelsEarlyLate delay_sigma_models,
TableModel *slew_model,
TableModel *slew_sigma_models[EarlyLate::index_count],
TableModelsEarlyLate slew_sigma_models,
ReceiverModelPtr receiver_model,
OutputWaveforms *output_waveforms);
GateTableModel(LibertyCell *cell,
TableModel *delay_model,
TableModel *slew_model);
~GateTableModel() override;
void gateDelay(const Pvt *pvt,
float in_slew,
@@ -100,7 +104,7 @@ public:
OutputWaveforms *outputWaveforms() const { return output_waveforms_.get(); }
// Check the axes before making the model.
// Return true if the model axes are supported.
static bool checkAxes(const TablePtr &table);
static bool checkAxes(const TableModel *table);
protected:
void maxCapSlew(float in_slew,
@@ -135,9 +139,9 @@ protected:
static bool checkAxis(const TableAxis *axis);
std::unique_ptr<TableModel> delay_model_;
std::array<std::unique_ptr<TableModel>, EarlyLate::index_count> delay_sigma_models_;
TableModelsEarlyLate delay_sigma_models_;
std::unique_ptr<TableModel> slew_model_;
std::array<std::unique_ptr<TableModel>, EarlyLate::index_count> slew_sigma_models_;
TableModelsEarlyLate slew_sigma_models_;
ReceiverModelPtr receiver_model_;
std::unique_ptr<OutputWaveforms> output_waveforms_;
};
@@ -147,7 +151,9 @@ class CheckTableModel : public CheckTimingModel
public:
CheckTableModel(LibertyCell *cell,
TableModel *model,
TableModel *sigma_models[EarlyLate::index_count]);
TableModelsEarlyLate sigma_models);
CheckTableModel(LibertyCell *cell,
TableModel *model);
~CheckTableModel() override;
ArcDelay checkDelay(const Pvt *pvt,
float from_slew,
@@ -166,7 +172,7 @@ public:
// Check the axes before making the model.
// Return true if the model axes are supported.
static bool checkAxes(const TablePtr table);
static bool checkAxes(const TableModel *table);
protected:
void setIsScaled(bool is_scaled) override;
@@ -197,7 +203,7 @@ protected:
static bool checkAxis(const TableAxis *axis);
std::unique_ptr<TableModel> model_;
std::array<std::unique_ptr<TableModel>, EarlyLate::index_count> sigma_models_;
TableModelsEarlyLate sigma_models_;
};
class TableAxis
@@ -254,6 +260,8 @@ public:
const TableAxis *axis2() const { return axis2_.get(); }
const TableAxis *axis3() const { return axis3_.get(); }
const TableAxisPtr axis1ptr() const { return axis1_; }
const TableAxisPtr axis2ptr() const { return axis2_; }
const TableAxisPtr axis3ptr() const { return axis3_; }
void setIsScaled(bool is_scaled);
float value(size_t axis_idx1,
@@ -409,7 +417,7 @@ public:
void setCapacitanceModel(TableModel table_model,
size_t segment,
const RiseFall *rf);
static bool checkAxes(TablePtr table);
static bool checkAxes(const TableModel *table);
private:
std::vector<TableModel> capacitance_models_;
+5 -4
View File
@@ -99,7 +99,7 @@ class TimingArcAttrs
public:
TimingArcAttrs();
TimingArcAttrs(TimingSense sense);
virtual ~TimingArcAttrs();
~TimingArcAttrs();
TimingType timingType() const { return timing_type_; }
void setTimingType(TimingType type);
TimingSense timingSense() const { return timing_sense_; }
@@ -145,7 +145,8 @@ class TimingArcSet
friend class LibertyCell;
public:
virtual ~TimingArcSet();
~TimingArcSet();
std::string to_string();
LibertyCell *libertyCell() const;
LibertyPort *from() const { return from_; }
LibertyPort *to() const { return to_; }
@@ -249,7 +250,7 @@ public:
TimingArcSet *set() const { return set_; }
TimingSense sense() const;
// Index in TimingArcSet.
unsigned index() const { return index_; }
size_t index() const { return index_; }
TimingModel *model() const { return model_; }
GateTimingModel *gateModel(const Scene *scene,
const MinMax *min_max) const;
@@ -270,7 +271,7 @@ public:
protected:
TimingModel *model(const Scene *scene,
const MinMax *min_max) const;
void setIndex(unsigned index);
void setIndex(size_t index);
void addScaledModel(const OperatingConditions *op_cond,
TimingModel *scaled_model);
+10
View File
@@ -24,8 +24,13 @@
#pragma once
#include <vector>
#include <string>
namespace sta {
using StdStringSeq = std::vector<std::string>;
// Iterate over the tokens in str separated by character sep.
// Similar in functionality to strtok, but does not leave the string
// side-effected. This is preferable to using strtok because it leaves
@@ -49,4 +54,9 @@ private:
bool first_;
};
// Parse delimiter separated tokens and skipp spaces.
StdStringSeq
parseTokens(const std::string &s,
const char delimiter);
} // namespace
+1
View File
@@ -48,6 +48,7 @@ public:
static const RiseFall *fall() { return &fall_; }
static int riseIndex() { return rise_.sdf_triple_index_; }
static int fallIndex() { return fall_.sdf_triple_index_; }
const std::string &to_string_long() const { return name_; }
const std::string &to_string() const { return short_name_; }
const char *name() const { return name_.c_str(); }
const char *shortName() const { return short_name_.c_str(); }