ScaleFactor enum counts
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
db7b807c6a
commit
bb36b3cb31
|
|
@ -79,9 +79,11 @@ enum class ClockGateType { none, latch_posedge, latch_negedge, other };
|
||||||
|
|
||||||
enum class DelayModelType { cmos_linear, cmos_pwl, cmos2, table, polynomial, dcm };
|
enum class DelayModelType { cmos_linear, cmos_pwl, cmos2, table, polynomial, dcm };
|
||||||
|
|
||||||
enum class ScaleFactorPvt { process, volt, temp, count, unknown };
|
enum class ScaleFactorPvt { process, volt, temp, unknown };
|
||||||
|
constexpr int scale_factor_pvt_count = int(ScaleFactorPvt::unknown) + 1;
|
||||||
|
|
||||||
enum class TableTemplateType { delay, power, output_current, ocv, count };
|
enum class TableTemplateType { delay, power, output_current, ocv };
|
||||||
|
constexpr int table_template_type_count = int(TableTemplateType::ocv) + 1;
|
||||||
|
|
||||||
void
|
void
|
||||||
initLiberty();
|
initLiberty();
|
||||||
|
|
@ -300,7 +302,7 @@ protected:
|
||||||
Units *units_;
|
Units *units_;
|
||||||
DelayModelType delay_model_type_;
|
DelayModelType delay_model_type_;
|
||||||
BusDclMap bus_dcls_;
|
BusDclMap bus_dcls_;
|
||||||
TableTemplateMap template_maps_[int(TableTemplateType::count)];
|
TableTemplateMap template_maps_[table_template_type_count];
|
||||||
float nominal_process_;
|
float nominal_process_;
|
||||||
float nominal_voltage_;
|
float nominal_voltage_;
|
||||||
float nominal_temperature_;
|
float nominal_temperature_;
|
||||||
|
|
@ -912,7 +914,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const char *name_;
|
const char *name_;
|
||||||
float scales_[scale_factor_type_count][int(ScaleFactorPvt::count)][RiseFall::index_count];
|
float scales_[scale_factor_type_count][scale_factor_pvt_count][RiseFall::index_count];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScaleFactors);
|
DISALLOW_COPY_AND_ASSIGN(ScaleFactors);
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ LibertyLibrary::LibertyLibrary(const char *name,
|
||||||
buffers_(nullptr)
|
buffers_(nullptr)
|
||||||
{
|
{
|
||||||
// Scalar templates are builtin.
|
// Scalar templates are builtin.
|
||||||
for (int i = 0; i != int(TableTemplateType::count); i++) {
|
for (int i = 0; i != table_template_type_count; i++) {
|
||||||
TableTemplateType type = static_cast<TableTemplateType>(i);
|
TableTemplateType type = static_cast<TableTemplateType>(i);
|
||||||
TableTemplate *scalar_template = new TableTemplate("scalar", nullptr,
|
TableTemplate *scalar_template = new TableTemplate("scalar", nullptr,
|
||||||
nullptr, nullptr);
|
nullptr, nullptr);
|
||||||
|
|
@ -107,7 +107,7 @@ LibertyLibrary::LibertyLibrary(const char *name,
|
||||||
LibertyLibrary::~LibertyLibrary()
|
LibertyLibrary::~LibertyLibrary()
|
||||||
{
|
{
|
||||||
bus_dcls_.deleteContents();
|
bus_dcls_.deleteContents();
|
||||||
for (int i = 0; i < int(TableTemplateType::count); i++)
|
for (int i = 0; i < table_template_type_count; i++)
|
||||||
template_maps_[i].deleteContents();
|
template_maps_[i].deleteContents();
|
||||||
scale_factors_map_.deleteContents();
|
scale_factors_map_.deleteContents();
|
||||||
delete scale_factors_;
|
delete scale_factors_;
|
||||||
|
|
@ -2719,7 +2719,7 @@ ScaleFactors::ScaleFactors(const char *name) :
|
||||||
name_(stringCopy(name))
|
name_(stringCopy(name))
|
||||||
{
|
{
|
||||||
for (int type = 0; type < scale_factor_type_count; type++) {
|
for (int type = 0; type < scale_factor_type_count; type++) {
|
||||||
for (int pvt = 0; pvt < int(ScaleFactorPvt::count); pvt++) {
|
for (int pvt = 0; pvt < scale_factor_pvt_count; pvt++) {
|
||||||
for (auto tr_index : RiseFall::rangeIndex()) {
|
for (auto tr_index : RiseFall::rangeIndex()) {
|
||||||
scales_[type][pvt][tr_index] = 0.0;
|
scales_[type][pvt][tr_index] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
@ -2776,7 +2776,7 @@ void
|
||||||
ScaleFactors::print()
|
ScaleFactors::print()
|
||||||
{
|
{
|
||||||
printf("%10s", " ");
|
printf("%10s", " ");
|
||||||
for (int pvt_index = 0; pvt_index < int(ScaleFactorPvt::count); pvt_index++) {
|
for (int pvt_index = 0; pvt_index < scale_factor_pvt_count; pvt_index++) {
|
||||||
ScaleFactorPvt pvt = (ScaleFactorPvt) pvt_index;
|
ScaleFactorPvt pvt = (ScaleFactorPvt) pvt_index;
|
||||||
printf("%10s", scaleFactorPvtName(pvt));
|
printf("%10s", scaleFactorPvtName(pvt));
|
||||||
}
|
}
|
||||||
|
|
@ -2784,7 +2784,7 @@ ScaleFactors::print()
|
||||||
for (int type_index = 0; type_index < scale_factor_type_count; type_index++) {
|
for (int type_index = 0; type_index < scale_factor_type_count; type_index++) {
|
||||||
ScaleFactorType type = (ScaleFactorType) type_index;
|
ScaleFactorType type = (ScaleFactorType) type_index;
|
||||||
printf("%10s ", scaleFactorTypeName(type));
|
printf("%10s ", scaleFactorTypeName(type));
|
||||||
for (int pvt_index = 0; pvt_index < int(ScaleFactorPvt::count); pvt_index++) {
|
for (int pvt_index = 0; pvt_index < scale_factor_pvt_count; pvt_index++) {
|
||||||
if (scaleFactorTypeRiseFallSuffix(type)
|
if (scaleFactorTypeRiseFallSuffix(type)
|
||||||
|| scaleFactorTypeRiseFallPrefix(type)
|
|| scaleFactorTypeRiseFallPrefix(type)
|
||||||
|| scaleFactorTypeLowHighSuffix(type)) {
|
|| scaleFactorTypeLowHighSuffix(type)) {
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,7 @@ LibertyReader::defineScalingFactorVisitors()
|
||||||
for (int type_index = 0; type_index < scale_factor_type_count; type_index++) {
|
for (int type_index = 0; type_index < scale_factor_type_count; type_index++) {
|
||||||
ScaleFactorType type = static_cast<ScaleFactorType>(type_index);
|
ScaleFactorType type = static_cast<ScaleFactorType>(type_index);
|
||||||
const char *type_name = scaleFactorTypeName(type);
|
const char *type_name = scaleFactorTypeName(type);
|
||||||
for (int pvt_index = 0; pvt_index < int(ScaleFactorPvt::count); pvt_index++) {
|
for (int pvt_index = 0; pvt_index < scale_factor_pvt_count; pvt_index++) {
|
||||||
ScaleFactorPvt pvt = static_cast<ScaleFactorPvt>(pvt_index);
|
ScaleFactorPvt pvt = static_cast<ScaleFactorPvt>(pvt_index);
|
||||||
const char *pvt_name = scaleFactorPvtName(pvt);
|
const char *pvt_name = scaleFactorPvtName(pvt);
|
||||||
if (scaleFactorTypeRiseFallSuffix(type)) {
|
if (scaleFactorTypeRiseFallSuffix(type)) {
|
||||||
|
|
@ -718,6 +718,7 @@ LibertyReader::parseUnits(LibertyAttr *attr,
|
||||||
Unit *unit)
|
Unit *unit)
|
||||||
{
|
{
|
||||||
const char *unit_str = getAttrString(attr);
|
const char *unit_str = getAttrString(attr);
|
||||||
|
if (unit_str) {
|
||||||
unsigned unit_str_length = strlen(unit_str);
|
unsigned unit_str_length = strlen(unit_str);
|
||||||
|
|
||||||
// Unit format is <multipler_digits><scale_suffix_char><unit_suffix>.
|
// Unit format is <multipler_digits><scale_suffix_char><unit_suffix>.
|
||||||
|
|
@ -770,6 +771,7 @@ LibertyReader::parseUnits(LibertyAttr *attr,
|
||||||
scale_var = scale_mult * mult;
|
scale_var = scale_mult * mult;
|
||||||
unit->setScale(scale_var);
|
unit->setScale(scale_var);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LibertyReader::visitCapacitiveLoadUnit(LibertyAttr *attr)
|
LibertyReader::visitCapacitiveLoadUnit(LibertyAttr *attr)
|
||||||
|
|
|
||||||
|
|
@ -613,6 +613,7 @@ void
|
||||||
Search::seedFilterStarts()
|
Search::seedFilterStarts()
|
||||||
{
|
{
|
||||||
ExceptionPt *first_pt = filter_->firstPt();
|
ExceptionPt *first_pt = filter_->firstPt();
|
||||||
|
if (first_pt) {
|
||||||
PinSet first_pins;
|
PinSet first_pins;
|
||||||
first_pt->allPins(network_, &first_pins);
|
first_pt->allPins(network_, &first_pins);
|
||||||
for (Pin *pin : first_pins) {
|
for (Pin *pin : first_pins) {
|
||||||
|
|
@ -630,6 +631,7 @@ Search::seedFilterStarts()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue