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,57 +718,59 @@ LibertyReader::parseUnits(LibertyAttr *attr,
|
||||||
Unit *unit)
|
Unit *unit)
|
||||||
{
|
{
|
||||||
const char *unit_str = getAttrString(attr);
|
const char *unit_str = getAttrString(attr);
|
||||||
unsigned unit_str_length = strlen(unit_str);
|
if (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>.
|
||||||
// Find the multiplier digits.
|
// Find the multiplier digits.
|
||||||
char *mult_str = makeTmpString(unit_str_length);
|
char *mult_str = makeTmpString(unit_str_length);
|
||||||
const char *s = unit_str;
|
const char *s = unit_str;
|
||||||
char *m = mult_str;
|
char *m = mult_str;
|
||||||
for (; *s; s++) {
|
for (; *s; s++) {
|
||||||
char ch = *s;
|
char ch = *s;
|
||||||
if (isdigit(ch))
|
if (isdigit(ch))
|
||||||
*m++ = ch;
|
*m++ = ch;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
*m = '\0';
|
||||||
|
|
||||||
|
float mult = 1.0F;
|
||||||
|
if (*mult_str != '\0') {
|
||||||
|
if (stringEq(mult_str, "1"))
|
||||||
|
mult = 1.0F;
|
||||||
|
else if (stringEq(mult_str, "10"))
|
||||||
|
mult = 10.0F;
|
||||||
|
else if (stringEq(mult_str, "100"))
|
||||||
|
mult = 100.0F;
|
||||||
|
else
|
||||||
|
libWarn(38, attr, "unknown unit multiplier %s.", mult_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
float scale_mult = 1.0F;
|
||||||
|
if (*s && stringEqual(s + 1, unit_suffix)) {
|
||||||
|
char scale_char = tolower(*s);
|
||||||
|
if (scale_char == 'k')
|
||||||
|
scale_mult = 1E+3F;
|
||||||
|
else if (scale_char == 'm')
|
||||||
|
scale_mult = 1E-3F;
|
||||||
|
else if (scale_char == 'u')
|
||||||
|
scale_mult = 1E-6F;
|
||||||
|
else if (scale_char == 'n')
|
||||||
|
scale_mult = 1E-9F;
|
||||||
|
else if (scale_char == 'p')
|
||||||
|
scale_mult = 1E-12F;
|
||||||
|
else if (scale_char == 'f')
|
||||||
|
scale_mult = 1E-15F;
|
||||||
|
else
|
||||||
|
libWarn(39, attr, "unknown unit scale %c.", scale_char);
|
||||||
|
}
|
||||||
|
else if (!stringEqual(s, unit_suffix))
|
||||||
|
libWarn(40, attr, "unknown unit suffix %s.", s + 1);
|
||||||
|
|
||||||
|
scale_var = scale_mult * mult;
|
||||||
|
unit->setScale(scale_var);
|
||||||
}
|
}
|
||||||
*m = '\0';
|
|
||||||
|
|
||||||
float mult = 1.0F;
|
|
||||||
if (*mult_str != '\0') {
|
|
||||||
if (stringEq(mult_str, "1"))
|
|
||||||
mult = 1.0F;
|
|
||||||
else if (stringEq(mult_str, "10"))
|
|
||||||
mult = 10.0F;
|
|
||||||
else if (stringEq(mult_str, "100"))
|
|
||||||
mult = 100.0F;
|
|
||||||
else
|
|
||||||
libWarn(38, attr, "unknown unit multiplier %s.", mult_str);
|
|
||||||
}
|
|
||||||
|
|
||||||
float scale_mult = 1.0F;
|
|
||||||
if (*s && stringEqual(s + 1, unit_suffix)) {
|
|
||||||
char scale_char = tolower(*s);
|
|
||||||
if (scale_char == 'k')
|
|
||||||
scale_mult = 1E+3F;
|
|
||||||
else if (scale_char == 'm')
|
|
||||||
scale_mult = 1E-3F;
|
|
||||||
else if (scale_char == 'u')
|
|
||||||
scale_mult = 1E-6F;
|
|
||||||
else if (scale_char == 'n')
|
|
||||||
scale_mult = 1E-9F;
|
|
||||||
else if (scale_char == 'p')
|
|
||||||
scale_mult = 1E-12F;
|
|
||||||
else if (scale_char == 'f')
|
|
||||||
scale_mult = 1E-15F;
|
|
||||||
else
|
|
||||||
libWarn(39, attr, "unknown unit scale %c.", scale_char);
|
|
||||||
}
|
|
||||||
else if (!stringEqual(s, unit_suffix))
|
|
||||||
libWarn(40, attr, "unknown unit suffix %s.", s + 1);
|
|
||||||
|
|
||||||
scale_var = scale_mult * mult;
|
|
||||||
unit->setScale(scale_var);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -613,20 +613,22 @@ void
|
||||||
Search::seedFilterStarts()
|
Search::seedFilterStarts()
|
||||||
{
|
{
|
||||||
ExceptionPt *first_pt = filter_->firstPt();
|
ExceptionPt *first_pt = filter_->firstPt();
|
||||||
PinSet first_pins;
|
if (first_pt) {
|
||||||
first_pt->allPins(network_, &first_pins);
|
PinSet first_pins;
|
||||||
for (Pin *pin : first_pins) {
|
first_pt->allPins(network_, &first_pins);
|
||||||
if (network_->isHierarchical(pin)) {
|
for (Pin *pin : first_pins) {
|
||||||
SeedFaninsThruHierPin visitor(graph_, this);
|
if (network_->isHierarchical(pin)) {
|
||||||
visitDrvrLoadsThruHierPin(pin, network_, &visitor);
|
SeedFaninsThruHierPin visitor(graph_, this);
|
||||||
}
|
visitDrvrLoadsThruHierPin(pin, network_, &visitor);
|
||||||
else {
|
}
|
||||||
Vertex *vertex, *bidirect_drvr_vertex;
|
else {
|
||||||
graph_->pinVertices(pin, vertex, bidirect_drvr_vertex);
|
Vertex *vertex, *bidirect_drvr_vertex;
|
||||||
if (vertex)
|
graph_->pinVertices(pin, vertex, bidirect_drvr_vertex);
|
||||||
seedArrival(vertex);
|
if (vertex)
|
||||||
if (bidirect_drvr_vertex)
|
seedArrival(vertex);
|
||||||
seedArrival(bidirect_drvr_vertex);
|
if (bidirect_drvr_vertex)
|
||||||
|
seedArrival(bidirect_drvr_vertex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue