Library/Cell name/filename args string_view
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
a5921d1ca9
commit
f873c6520a
|
|
@ -56,8 +56,8 @@ using ConcretePortMemberIterator = VectorIterator<ConcretePortSeq, ConcretePort*
|
|||
class ConcreteLibrary
|
||||
{
|
||||
public:
|
||||
ConcreteLibrary(std::string name,
|
||||
std::string filename,
|
||||
ConcreteLibrary(std::string_view name,
|
||||
std::string_view filename,
|
||||
bool is_liberty);
|
||||
virtual ~ConcreteLibrary();
|
||||
const std::string &name() const { return name_; }
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class DriverWaveform;
|
|||
class ModeValueDef
|
||||
{
|
||||
public:
|
||||
ModeValueDef(std::string value);
|
||||
ModeValueDef(std::string_view value);
|
||||
ModeValueDef(ModeValueDef &&other) noexcept;
|
||||
~ModeValueDef();
|
||||
const std::string &value() const { return value_; }
|
||||
|
|
@ -204,8 +204,8 @@ timingSenseOpposite(TimingSense sense);
|
|||
class LibertyLibrary : public ConcreteLibrary
|
||||
{
|
||||
public:
|
||||
LibertyLibrary(std::string name,
|
||||
std::string filename);
|
||||
LibertyLibrary(std::string_view name,
|
||||
std::string_view filename);
|
||||
virtual ~LibertyLibrary();
|
||||
LibertyCell *findLibertyCell(std::string_view name) const;
|
||||
LibertyCellSeq findLibertyCellsMatching(PatternMatch *pattern);
|
||||
|
|
@ -215,12 +215,12 @@ public:
|
|||
|
||||
DelayModelType delayModelType() const { return delay_model_type_; }
|
||||
void setDelayModelType(DelayModelType type);
|
||||
BusDcl *makeBusDcl(std::string name,
|
||||
BusDcl *makeBusDcl(std::string_view name,
|
||||
int from,
|
||||
int to);
|
||||
BusDcl *findBusDcl(std::string_view name);
|
||||
BusDclSeq busDcls() const;
|
||||
TableTemplate *makeTableTemplate(std::string name,
|
||||
TableTemplate *makeTableTemplate(std::string_view name,
|
||||
TableTemplateType type);
|
||||
TableTemplate *findTableTemplate(std::string_view name,
|
||||
TableTemplateType type);
|
||||
|
|
@ -235,7 +235,7 @@ public:
|
|||
|
||||
void setScaleFactors(ScaleFactors *scales);
|
||||
// Make named scale factor group. Returns pointer to the inserted element.
|
||||
ScaleFactors *makeScaleFactors(std::string name);
|
||||
ScaleFactors *makeScaleFactors(std::string_view name);
|
||||
ScaleFactors *findScaleFactors(std::string_view name);
|
||||
ScaleFactors *scaleFactors() const { return scale_factors_; }
|
||||
float scaleFactor(ScaleFactorType type,
|
||||
|
|
@ -336,18 +336,18 @@ public:
|
|||
Units *units() { return units_; }
|
||||
const Units *units() const { return units_; }
|
||||
|
||||
Wireload *makeWireload(std::string name);
|
||||
Wireload *makeWireload(std::string_view name);
|
||||
const Wireload *findWireload(std::string_view name);
|
||||
void setDefaultWireload(const Wireload *wireload);
|
||||
const Wireload *defaultWireload() const;
|
||||
WireloadSelection *makeWireloadSelection(std::string name);
|
||||
WireloadSelection *makeWireloadSelection(std::string_view name);
|
||||
const WireloadSelection *findWireloadSelection(std::string_view name) const;
|
||||
const WireloadSelection *defaultWireloadSelection() const;
|
||||
WireloadMode defaultWireloadMode() const;
|
||||
void setDefaultWireloadMode(WireloadMode mode);
|
||||
void setDefaultWireloadSelection(const WireloadSelection *selection);
|
||||
|
||||
OperatingConditions *makeOperatingConditions(std::string name);
|
||||
OperatingConditions *makeOperatingConditions(std::string_view name);
|
||||
OperatingConditions *findOperatingConditions(std::string_view name);
|
||||
OperatingConditions *defaultOperatingConditions() const;
|
||||
void setDefaultOperatingConditions(OperatingConditions *op_cond);
|
||||
|
|
@ -358,9 +358,9 @@ public:
|
|||
void setOcvArcDepth(float depth);
|
||||
OcvDerate *defaultOcvDerate() const;
|
||||
void setDefaultOcvDerate(OcvDerate *derate);
|
||||
OcvDerate *makeOcvDerate(std::string name);
|
||||
OcvDerate *makeOcvDerate(std::string_view name);
|
||||
OcvDerate *findOcvDerate(std::string_view derate_name);
|
||||
void addSupplyVoltage(std::string suppy_name,
|
||||
void addSupplyVoltage(std::string_view suppy_name,
|
||||
float voltage);
|
||||
bool supplyExists(std::string_view supply_name) const;
|
||||
void supplyVoltage(std::string_view supply_name,
|
||||
|
|
@ -369,8 +369,8 @@ public:
|
|||
bool &exists) const;
|
||||
|
||||
// Make scaled cell. Call LibertyCell::addScaledCell after it is complete.
|
||||
LibertyCell *makeScaledCell(std::string name,
|
||||
std::string filename);
|
||||
LibertyCell *makeScaledCell(std::string_view name,
|
||||
std::string_view filename);
|
||||
|
||||
static void
|
||||
makeSceneMap(LibertyLibrary *lib,
|
||||
|
|
@ -395,7 +395,7 @@ public:
|
|||
|
||||
DriverWaveform *findDriverWaveform(std::string_view name);
|
||||
DriverWaveform *driverWaveformDefault() { return findDriverWaveform(""); }
|
||||
DriverWaveform *makeDriverWaveform(std::string name,
|
||||
DriverWaveform *makeDriverWaveform(std::string_view name,
|
||||
TablePtr waveforms);
|
||||
|
||||
protected:
|
||||
|
|
@ -474,8 +474,8 @@ class LibertyCell : public ConcreteCell
|
|||
{
|
||||
public:
|
||||
LibertyCell(LibertyLibrary *library,
|
||||
std::string name,
|
||||
std::string filename);
|
||||
std::string_view name,
|
||||
std::string_view filename);
|
||||
virtual ~LibertyCell();
|
||||
LibertyLibrary *libertyLibrary() const { return liberty_library_; }
|
||||
LibertyLibrary *libertyLibrary() { return liberty_library_; }
|
||||
|
|
@ -484,7 +484,7 @@ public:
|
|||
bool hasInternalPorts() const { return has_internal_ports_; }
|
||||
ScaleFactors *scaleFactors() const { return scale_factors_; }
|
||||
void setScaleFactors(ScaleFactors *scale_factors);
|
||||
ModeDef *makeModeDef(std::string name);
|
||||
ModeDef *makeModeDef(std::string_view name);
|
||||
const ModeDef *findModeDef(std::string_view name) const;
|
||||
|
||||
float area() const { return area_; }
|
||||
|
|
@ -544,7 +544,7 @@ public:
|
|||
const Statetable *statetable() const { return statetable_; }
|
||||
|
||||
// Find bus declaration local to this cell.
|
||||
BusDcl *makeBusDcl(std::string name,
|
||||
BusDcl *makeBusDcl(std::string_view name,
|
||||
int from,
|
||||
int to);
|
||||
BusDcl *findBusDcl(std::string_view name);
|
||||
|
|
@ -565,7 +565,7 @@ public:
|
|||
// AOCV
|
||||
float ocvArcDepth() const;
|
||||
OcvDerate *ocvDerate() const;
|
||||
OcvDerate *makeOcvDerate(std::string name);
|
||||
OcvDerate *makeOcvDerate(std::string_view name);
|
||||
OcvDerate *findOcvDerate(std::string_view derate_name);
|
||||
|
||||
// Build helpers.
|
||||
|
|
@ -620,9 +620,9 @@ public:
|
|||
static void checkLibertyScenes();
|
||||
void ensureVoltageWaveforms(const SceneSeq &scenes);
|
||||
const std::string &footprint() const { return footprint_; }
|
||||
void setFootprint(std::string footprint);
|
||||
void setFootprint(std::string_view footprint);
|
||||
const std::string &userFunctionClass() const { return user_function_class_; }
|
||||
void setUserFunctionClass(std::string user_function_class);
|
||||
void setUserFunctionClass(std::string_view user_function_class);
|
||||
|
||||
protected:
|
||||
void addPort(ConcretePort *port);
|
||||
|
|
@ -758,7 +758,7 @@ public:
|
|||
PwrGndType pwrGndType() const { return pwr_gnd_type_; }
|
||||
void setPwrGndType(PwrGndType type);
|
||||
const std::string &voltageName() const { return voltage_name_; }
|
||||
void setVoltageName(std::string voltage_name);
|
||||
void setVoltageName(std::string_view voltage_name);
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
ScanSignalType scanSignalType() const { return scan_signal_type_; }
|
||||
|
|
@ -906,7 +906,7 @@ public:
|
|||
protected:
|
||||
// Constructor is internal to LibertyBuilder.
|
||||
LibertyPort(LibertyCell *cell,
|
||||
std::string name,
|
||||
std::string_view name,
|
||||
bool is_bus,
|
||||
BusDcl *bus_dcl,
|
||||
int from_index,
|
||||
|
|
@ -1016,7 +1016,7 @@ protected:
|
|||
class OperatingConditions : public Pvt
|
||||
{
|
||||
public:
|
||||
OperatingConditions(std::string name);
|
||||
OperatingConditions(std::string_view name);
|
||||
const std::string &name() const { return name_; }
|
||||
WireloadTree wireloadTree() const { return wire_load_tree_; }
|
||||
void setWireloadTree(WireloadTree tree);
|
||||
|
|
@ -1029,7 +1029,7 @@ protected:
|
|||
class ScaleFactors
|
||||
{
|
||||
public:
|
||||
ScaleFactors(std::string name);
|
||||
ScaleFactors(std::string_view name);
|
||||
const std::string &name() const { return name_; }
|
||||
float scale(ScaleFactorType type,
|
||||
ScaleFactorPvt pvt,
|
||||
|
|
@ -1056,7 +1056,7 @@ protected:
|
|||
class BusDcl
|
||||
{
|
||||
public:
|
||||
BusDcl(std::string name,
|
||||
BusDcl(std::string_view name,
|
||||
int from,
|
||||
int to);
|
||||
const std::string &name() const { return name_; }
|
||||
|
|
@ -1073,9 +1073,9 @@ protected:
|
|||
class ModeDef
|
||||
{
|
||||
public:
|
||||
ModeDef(std::string name);
|
||||
ModeDef(std::string_view name);
|
||||
const std::string &name() const { return name_; }
|
||||
ModeValueDef *defineValue(std::string value);
|
||||
ModeValueDef *defineValue(std::string_view value);
|
||||
const ModeValueDef *findValueDef(std::string_view value) const;
|
||||
const ModeValueMap &values() const { return values_; }
|
||||
|
||||
|
|
@ -1090,15 +1090,15 @@ private:
|
|||
class TableTemplate
|
||||
{
|
||||
public:
|
||||
TableTemplate(std::string name);
|
||||
TableTemplate(std::string name,
|
||||
TableTemplate(std::string_view name);
|
||||
TableTemplate(std::string_view name,
|
||||
TableTemplateType type);
|
||||
TableTemplate(std::string name,
|
||||
TableTemplate(std::string_view name,
|
||||
TableAxisPtr axis1,
|
||||
TableAxisPtr axis2,
|
||||
TableAxisPtr axis3);
|
||||
const std::string &name() const { return name_; }
|
||||
void setName(std::string name);
|
||||
void setName(std::string_view name);
|
||||
TableTemplateType type() const { return type_; }
|
||||
const TableAxis *axis1() const { return axis1_.get(); }
|
||||
TableAxisPtr axis1ptr() const { return axis1_; }
|
||||
|
|
@ -1122,8 +1122,8 @@ class TestCell : public LibertyCell
|
|||
{
|
||||
public:
|
||||
TestCell(LibertyLibrary *library,
|
||||
std::string name,
|
||||
std::string filename);
|
||||
std::string_view name,
|
||||
std::string_view filename);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
|
@ -1131,7 +1131,7 @@ protected:
|
|||
class OcvDerate
|
||||
{
|
||||
public:
|
||||
OcvDerate(std::string name);
|
||||
OcvDerate(std::string_view name);
|
||||
~OcvDerate();
|
||||
const std::string &name() const { return name_; }
|
||||
const Table *derateTable(const RiseFall *rf,
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ deleteLiberty()
|
|||
TimingArcSet::destroy();
|
||||
}
|
||||
|
||||
LibertyLibrary::LibertyLibrary(std::string name,
|
||||
std::string filename) :
|
||||
ConcreteLibrary(std::move(name), std::move(filename), true),
|
||||
LibertyLibrary::LibertyLibrary(std::string_view name,
|
||||
std::string_view filename) :
|
||||
ConcreteLibrary(name, filename, true),
|
||||
units_(new Units()),
|
||||
delay_model_type_(DelayModelType::table), // default
|
||||
nominal_process_(0.0),
|
||||
|
|
@ -178,12 +178,12 @@ LibertyLibrary::setDelayModelType(DelayModelType type)
|
|||
}
|
||||
|
||||
BusDcl *
|
||||
LibertyLibrary::makeBusDcl(std::string name,
|
||||
LibertyLibrary::makeBusDcl(std::string_view name,
|
||||
int from,
|
||||
int to)
|
||||
{
|
||||
std::string key = name;
|
||||
auto [it, inserted] = bus_dcls_.try_emplace(std::move(key), std::move(name), from, to);
|
||||
std::string key(name);
|
||||
auto [it, inserted] = bus_dcls_.try_emplace(std::move(key), std::string(name), from, to);
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -203,13 +203,13 @@ LibertyLibrary::busDcls() const
|
|||
}
|
||||
|
||||
TableTemplate *
|
||||
LibertyLibrary::makeTableTemplate(std::string name,
|
||||
TableTemplateType type)
|
||||
LibertyLibrary::makeTableTemplate(std::string_view name,
|
||||
TableTemplateType type)
|
||||
{
|
||||
std::string key = name;
|
||||
std::string key(name);
|
||||
auto [it, inserted] = template_maps_[int(type)].try_emplace(std::move(key),
|
||||
std::move(name),
|
||||
type);
|
||||
std::string(name),
|
||||
type);
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -265,10 +265,10 @@ LibertyLibrary::setScaleFactors(ScaleFactors *scales)
|
|||
}
|
||||
|
||||
ScaleFactors *
|
||||
LibertyLibrary::makeScaleFactors(std::string name)
|
||||
LibertyLibrary::makeScaleFactors(std::string_view name)
|
||||
{
|
||||
std::string key = name;
|
||||
auto [it, inserted] = scale_factors_map_.emplace(std::move(key), std::move(name));
|
||||
std::string key(name);
|
||||
auto [it, inserted] = scale_factors_map_.emplace(std::move(key), std::string(name));
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -565,9 +565,10 @@ LibertyLibrary::setDefaultOutputPinRes(const RiseFall *rf,
|
|||
}
|
||||
|
||||
Wireload *
|
||||
LibertyLibrary::makeWireload(std::string name)
|
||||
LibertyLibrary::makeWireload(std::string_view name)
|
||||
{
|
||||
auto [it, inserted] = wireloads_.try_emplace(name, name, this);
|
||||
std::string key(name);
|
||||
auto [it, inserted] = wireloads_.try_emplace(std::move(key), std::string(name), this);
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -590,11 +591,11 @@ LibertyLibrary::defaultWireload() const
|
|||
}
|
||||
|
||||
WireloadSelection *
|
||||
LibertyLibrary::makeWireloadSelection(std::string name)
|
||||
LibertyLibrary::makeWireloadSelection(std::string_view name)
|
||||
{
|
||||
std::string key = name;
|
||||
std::string key(name);
|
||||
auto [it, inserted] = wire_load_selections_.try_emplace(std::move(key),
|
||||
std::move(name));
|
||||
std::string(name));
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -629,10 +630,10 @@ LibertyLibrary::setDefaultWireloadMode(WireloadMode mode)
|
|||
}
|
||||
|
||||
OperatingConditions *
|
||||
LibertyLibrary::makeOperatingConditions(std::string name)
|
||||
LibertyLibrary::makeOperatingConditions(std::string_view name)
|
||||
{
|
||||
std::string key = name;
|
||||
auto [it, inserted] = operating_conditions_.try_emplace(std::move(key), std::move(name));
|
||||
std::string key(name);
|
||||
auto [it, inserted] = operating_conditions_.try_emplace(std::move(key), std::string(name));
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -719,10 +720,10 @@ LibertyLibrary::setSlewDerateFromLibrary(float derate)
|
|||
}
|
||||
|
||||
LibertyCell *
|
||||
LibertyLibrary::makeScaledCell(std::string name,
|
||||
std::string filename)
|
||||
LibertyLibrary::makeScaledCell(std::string_view name,
|
||||
std::string_view filename)
|
||||
{
|
||||
return new LibertyCell(this, std::move(name), std::move(filename));
|
||||
return new LibertyCell(this, name, filename);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
|
@ -853,10 +854,10 @@ LibertyLibrary::setDefaultOcvDerate(OcvDerate *derate)
|
|||
}
|
||||
|
||||
OcvDerate *
|
||||
LibertyLibrary::makeOcvDerate(std::string name)
|
||||
LibertyLibrary::makeOcvDerate(std::string_view name)
|
||||
{
|
||||
std::string key = name;
|
||||
auto [it, inserted] = ocv_derate_map_.try_emplace(std::move(key), std::move(name));
|
||||
std::string key(name);
|
||||
auto [it, inserted] = ocv_derate_map_.try_emplace(std::move(key), std::string(name));
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -867,10 +868,10 @@ LibertyLibrary::findOcvDerate(std::string_view derate_name)
|
|||
}
|
||||
|
||||
void
|
||||
LibertyLibrary::addSupplyVoltage(std::string supply_name,
|
||||
LibertyLibrary::addSupplyVoltage(std::string_view supply_name,
|
||||
float voltage)
|
||||
{
|
||||
supply_voltage_map_[std::move(supply_name)] = voltage;
|
||||
supply_voltage_map_[std::string(supply_name)] = voltage;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -903,13 +904,13 @@ LibertyLibrary::findDriverWaveform(std::string_view name)
|
|||
}
|
||||
|
||||
DriverWaveform *
|
||||
LibertyLibrary::makeDriverWaveform(std::string name,
|
||||
LibertyLibrary::makeDriverWaveform(std::string_view name,
|
||||
TablePtr waveforms)
|
||||
{
|
||||
std::string key = name;
|
||||
std::string key(name);
|
||||
auto [it, inserted] = driver_waveform_map_.try_emplace(std::move(key),
|
||||
std::move(name),
|
||||
waveforms);
|
||||
std::string(name),
|
||||
waveforms);
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -935,8 +936,8 @@ LibertyCellIterator::next()
|
|||
////////////////////////////////////////////////////////////////
|
||||
|
||||
LibertyCell::LibertyCell(LibertyLibrary *library,
|
||||
std::string name,
|
||||
std::string filename) :
|
||||
std::string_view name,
|
||||
std::string_view filename) :
|
||||
ConcreteCell(name, filename, true, library),
|
||||
liberty_library_(library),
|
||||
area_(0.0),
|
||||
|
|
@ -1019,10 +1020,10 @@ LibertyCell::setHasInternalPorts(bool has_internal)
|
|||
}
|
||||
|
||||
ModeDef *
|
||||
LibertyCell::makeModeDef(std::string name)
|
||||
LibertyCell::makeModeDef(std::string_view name)
|
||||
{
|
||||
std::string key = name;
|
||||
auto [it, inserted] = mode_defs_.try_emplace(std::move(key), std::move(name));
|
||||
std::string key(name);
|
||||
auto [it, inserted] = mode_defs_.try_emplace(std::move(key), std::string(name));
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -1039,12 +1040,12 @@ LibertyCell::setScaleFactors(ScaleFactors *scale_factors)
|
|||
}
|
||||
|
||||
BusDcl *
|
||||
LibertyCell::makeBusDcl(std::string name,
|
||||
LibertyCell::makeBusDcl(std::string_view name,
|
||||
int from,
|
||||
int to)
|
||||
{
|
||||
std::string key = name;
|
||||
auto [it, inserted] = bus_dcls_.try_emplace(std::move(key), std::move(name), from, to);
|
||||
std::string key(name);
|
||||
auto [it, inserted] = bus_dcls_.try_emplace(std::move(key), std::string(name), from, to);
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -1624,10 +1625,10 @@ LibertyCell::setOcvDerate(OcvDerate *derate)
|
|||
}
|
||||
|
||||
OcvDerate *
|
||||
LibertyCell::makeOcvDerate(std::string name)
|
||||
LibertyCell::makeOcvDerate(std::string_view name)
|
||||
{
|
||||
std::string key = name;
|
||||
auto [it, inserted] = ocv_derate_map_.try_emplace(std::move(key), std::move(name));
|
||||
std::string key(name);
|
||||
auto [it, inserted] = ocv_derate_map_.try_emplace(std::move(key), std::string(name));
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -1929,15 +1930,15 @@ LibertyCell::ensureVoltageWaveforms(const SceneSeq &scenes)
|
|||
}
|
||||
|
||||
void
|
||||
LibertyCell::setFootprint(std::string footprint)
|
||||
LibertyCell::setFootprint(std::string_view footprint)
|
||||
{
|
||||
footprint_ = std::move(footprint);
|
||||
footprint_ = footprint;
|
||||
}
|
||||
|
||||
void
|
||||
LibertyCell::setUserFunctionClass(std::string user_function_class)
|
||||
LibertyCell::setUserFunctionClass(std::string_view user_function_class)
|
||||
{
|
||||
user_function_class_ = std::move(user_function_class);
|
||||
user_function_class_ = user_function_class;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
|
@ -1986,7 +1987,7 @@ LibertyCellPortBitIterator::next()
|
|||
////////////////////////////////////////////////////////////////
|
||||
|
||||
LibertyPort::LibertyPort(LibertyCell *cell,
|
||||
std::string name,
|
||||
std::string_view name,
|
||||
bool is_bus,
|
||||
BusDcl *bus_dcl,
|
||||
int from_index,
|
||||
|
|
@ -2079,9 +2080,9 @@ LibertyPort::setPwrGndType(PwrGndType type)
|
|||
}
|
||||
|
||||
void
|
||||
LibertyPort::setVoltageName(std::string voltage_name)
|
||||
LibertyPort::setVoltageName(std::string_view voltage_name)
|
||||
{
|
||||
voltage_name_ = std::move(voltage_name);
|
||||
voltage_name_ = voltage_name;
|
||||
}
|
||||
|
||||
static EnumNameMap<PwrGndType> pwr_gnd_type_map =
|
||||
|
|
@ -2840,10 +2841,10 @@ LibertyPortMemberIterator::next()
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
BusDcl::BusDcl(std::string name,
|
||||
BusDcl::BusDcl(std::string_view name,
|
||||
int from,
|
||||
int to) :
|
||||
name_(std::move(name)),
|
||||
name_(name),
|
||||
from_(from),
|
||||
to_(to)
|
||||
{
|
||||
|
|
@ -2851,16 +2852,16 @@ BusDcl::BusDcl(std::string name,
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
ModeDef::ModeDef(std::string name) :
|
||||
name_(std::move(name))
|
||||
ModeDef::ModeDef(std::string_view name) :
|
||||
name_(name)
|
||||
{
|
||||
}
|
||||
|
||||
ModeValueDef *
|
||||
ModeDef::defineValue(std::string value)
|
||||
ModeDef::defineValue(std::string_view value)
|
||||
{
|
||||
std::string key = value;
|
||||
auto [it, inserted] = values_.try_emplace(std::move(key), std::move(value));
|
||||
std::string key(value);
|
||||
auto [it, inserted] = values_.try_emplace(std::move(key), std::string(value));
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
|
@ -2872,8 +2873,8 @@ ModeDef::findValueDef(std::string_view value) const
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
ModeValueDef::ModeValueDef(std::string value) :
|
||||
value_(std::move(value)),
|
||||
ModeValueDef::ModeValueDef(std::string_view value) :
|
||||
value_(value),
|
||||
cond_(nullptr)
|
||||
{
|
||||
}
|
||||
|
|
@ -2905,8 +2906,8 @@ ModeValueDef::setSdfCond(std::string sdf_cond)
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
TableTemplate::TableTemplate(std::string name) :
|
||||
name_(std::move(name)),
|
||||
TableTemplate::TableTemplate(std::string_view name) :
|
||||
name_(name),
|
||||
type_(TableTemplateType::delay),
|
||||
axis1_(nullptr),
|
||||
axis2_(nullptr),
|
||||
|
|
@ -2914,9 +2915,9 @@ TableTemplate::TableTemplate(std::string name) :
|
|||
{
|
||||
}
|
||||
|
||||
TableTemplate::TableTemplate(std::string name,
|
||||
TableTemplate::TableTemplate(std::string_view name,
|
||||
TableTemplateType type) :
|
||||
name_(std::move(name)),
|
||||
name_(name),
|
||||
type_(type),
|
||||
axis1_(nullptr),
|
||||
axis2_(nullptr),
|
||||
|
|
@ -2924,11 +2925,11 @@ TableTemplate::TableTemplate(std::string name,
|
|||
{
|
||||
}
|
||||
|
||||
TableTemplate::TableTemplate(std::string name,
|
||||
TableTemplate::TableTemplate(std::string_view name,
|
||||
TableAxisPtr axis1,
|
||||
TableAxisPtr axis2,
|
||||
TableAxisPtr axis3) :
|
||||
name_(std::move(name)),
|
||||
name_(name),
|
||||
type_(TableTemplateType::delay),
|
||||
axis1_(axis1),
|
||||
axis2_(axis2),
|
||||
|
|
@ -2937,9 +2938,9 @@ TableTemplate::TableTemplate(std::string name,
|
|||
}
|
||||
|
||||
void
|
||||
TableTemplate::setName(std::string name)
|
||||
TableTemplate::setName(std::string_view name)
|
||||
{
|
||||
name_ = std::move(name);
|
||||
name_ = name;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2989,9 +2990,9 @@ Pvt::setTemperature(float temp)
|
|||
temperature_ = temp;
|
||||
}
|
||||
|
||||
OperatingConditions::OperatingConditions(std::string name) :
|
||||
OperatingConditions::OperatingConditions(std::string_view name) :
|
||||
Pvt(0.0, 0.0, 0.0),
|
||||
name_(std::move(name)),
|
||||
name_(name),
|
||||
// Default wireload tree.
|
||||
wire_load_tree_(WireloadTree::unknown)
|
||||
{
|
||||
|
|
@ -3085,8 +3086,8 @@ scaleFactorPvtName(ScaleFactorPvt pvt)
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
ScaleFactors::ScaleFactors(std::string name) :
|
||||
name_(std::move(name))
|
||||
ScaleFactors::ScaleFactors(std::string_view name) :
|
||||
name_(name)
|
||||
{
|
||||
for (int type = 0; type < scale_factor_type_count; type++) {
|
||||
for (int pvt = 0; pvt < scale_factor_pvt_count; pvt++) {
|
||||
|
|
@ -3168,16 +3169,16 @@ ScaleFactors::report(Report *report)
|
|||
}
|
||||
|
||||
TestCell::TestCell(LibertyLibrary *library,
|
||||
std::string name,
|
||||
std::string filename) :
|
||||
std::string_view name,
|
||||
std::string_view filename) :
|
||||
LibertyCell(library, name, filename)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
OcvDerate::OcvDerate(std::string name) :
|
||||
name_(std::move(name))
|
||||
OcvDerate::OcvDerate(std::string_view name) :
|
||||
name_(name)
|
||||
{
|
||||
for (auto el_index : EarlyLate::rangeIndex()) {
|
||||
for (auto rf_index : RiseFall::rangeIndex()) {
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ LibertyBuilder::makePort(LibertyCell *cell,
|
|||
|
||||
LibertyPort *
|
||||
LibertyBuilder::makeBundlePort(LibertyCell *cell,
|
||||
const char *name,
|
||||
std::string_view name,
|
||||
ConcretePortSeq *members)
|
||||
{
|
||||
LibertyPort *port = new LibertyPort(cell, name, false, nullptr, -1, -1, true, members);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
int to_index,
|
||||
BusDcl *bus_dcl);
|
||||
LibertyPort *makeBundlePort(LibertyCell *cell,
|
||||
const char *name,
|
||||
std::string_view name,
|
||||
ConcretePortSeq *members);
|
||||
// Build timing arc sets and their arcs given a type and sense.
|
||||
// Port functions and cell latches are also used by this builder
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ LibertyReader::endCell(const LibertyGroup *cell_group,
|
|||
if (cell_group->hasFirstParam()) {
|
||||
const std::string &name = cell_group->firstParam();
|
||||
debugPrint(debug_, "liberty", 1, "cell {}", name);
|
||||
LibertyCell *cell = builder_.makeCell(library_, name, std::string(filename_));
|
||||
LibertyCell *cell = builder_.makeCell(library_, name, filename_);
|
||||
readCell(cell, cell_group);
|
||||
}
|
||||
else
|
||||
|
|
@ -849,7 +849,7 @@ LibertyReader::readDefaultWireLoadSelection(const LibertyGroup *library_group)
|
|||
library_group->findAttrString("default_wire_load_selection");
|
||||
if (!selection_name.empty()) {
|
||||
const WireloadSelection *selection =
|
||||
library_->findWireloadSelection(selection_name.c_str());
|
||||
library_->findWireloadSelection(selection_name);
|
||||
if (selection)
|
||||
library_->setDefaultWireloadSelection(selection);
|
||||
else
|
||||
|
|
@ -1003,9 +1003,8 @@ LibertyReader::readScaledCell(const LibertyGroup *scaled_cell_group)
|
|||
OperatingConditions *op_cond = library_->findOperatingConditions(op_cond_name);
|
||||
if (op_cond) {
|
||||
debugPrint(debug_, "liberty", 1, "scaled cell {} {}",
|
||||
name.c_str(), op_cond_name.c_str());
|
||||
LibertyCell *scaled_cell = library_->makeScaledCell(name,
|
||||
std::string(filename_));
|
||||
name, op_cond_name);
|
||||
LibertyCell *scaled_cell = library_->makeScaledCell(name, filename_);
|
||||
readCell(scaled_cell, scaled_cell_group);
|
||||
checkScaledCell(scaled_cell, owner, scaled_cell_group, op_cond_name);
|
||||
// Add scaled cell AFTER ports and timing arcs are defined.
|
||||
|
|
@ -1163,8 +1162,7 @@ LibertyReader::makeBundlePort(LibertyCell *cell,
|
|||
members->push_back(member);
|
||||
}
|
||||
}
|
||||
LibertyPort *bundle_port = builder_.makeBundlePort(cell, bundle_name.c_str(),
|
||||
members);
|
||||
LibertyPort *bundle_port = builder_.makeBundlePort(cell, bundle_name, members);
|
||||
port_group_map[bundle_group].push_back(bundle_port);
|
||||
// Make ports for pin groups inside the bundle group.
|
||||
makeBundlePinPorts(cell, bundle_group, port_group_map);
|
||||
|
|
@ -1204,7 +1202,7 @@ LibertyReader::makePgPinPort(LibertyCell *cell,
|
|||
|
||||
const std::string &type_name = pg_pin_group->findAttrString("pg_type");
|
||||
if (!type_name.empty()) {
|
||||
PwrGndType type = findPwrGndType(type_name.c_str());
|
||||
PwrGndType type = findPwrGndType(type_name);
|
||||
PortDirection *dir = PortDirection::unknown();
|
||||
switch (type) {
|
||||
case PwrGndType::primary_ground:
|
||||
|
|
@ -1229,7 +1227,7 @@ LibertyReader::makePgPinPort(LibertyCell *cell,
|
|||
|
||||
const std::string &voltate_name = pg_pin_group->findAttrString("voltage_name");
|
||||
if (!voltate_name.empty())
|
||||
pg_port->setVoltageName(voltate_name.c_str());
|
||||
pg_port->setVoltageName(voltate_name);
|
||||
}
|
||||
else
|
||||
warn(1314, pg_pin_group, "pg_pin missing name.");
|
||||
|
|
@ -1289,7 +1287,7 @@ LibertyReader::readDriverWaveform(const LibertyPortSeq &ports,
|
|||
: "driver_waveform_fall";
|
||||
const std::string &name = port_group->findAttrString(attr_name);
|
||||
if (!name.empty()) {
|
||||
DriverWaveform *waveform = library_->findDriverWaveform(name.c_str());
|
||||
DriverWaveform *waveform = library_->findDriverWaveform(name);
|
||||
if (waveform) {
|
||||
for (LibertyPort *port : ports)
|
||||
port->setDriverWaveform(waveform, rf);
|
||||
|
|
@ -1824,9 +1822,9 @@ LibertyReader::readCellAttributes(LibertyCell *cell,
|
|||
const std::string &clock_gate_type =
|
||||
cell_group->findAttrString("clock_gating_integrated_cell");
|
||||
if (!clock_gate_type.empty()) {
|
||||
if (stringBeginEqual(clock_gate_type.c_str(), "latch_posedge"))
|
||||
if (stringBeginEqual(clock_gate_type, "latch_posedge"))
|
||||
cell->setClockGateType(ClockGateType::latch_posedge);
|
||||
else if (stringBeginEqual(clock_gate_type.c_str(), "latch_negedge"))
|
||||
else if (stringBeginEqual(clock_gate_type, "latch_negedge"))
|
||||
cell->setClockGateType(ClockGateType::latch_negedge);
|
||||
else
|
||||
cell->setClockGateType(ClockGateType::other);
|
||||
|
|
@ -1846,7 +1844,7 @@ LibertyReader::readScaleFactors(LibertyCell *cell,
|
|||
cell_group->findAttrString("scaling_factors");
|
||||
if (!scale_factors_name.empty()) {
|
||||
ScaleFactors *scale_factors =
|
||||
library_->findScaleFactors(scale_factors_name.c_str());
|
||||
library_->findScaleFactors(scale_factors_name);
|
||||
if (scale_factors)
|
||||
cell->setScaleFactors(scale_factors);
|
||||
else
|
||||
|
|
@ -1856,7 +1854,7 @@ LibertyReader::readScaleFactors(LibertyCell *cell,
|
|||
|
||||
void
|
||||
LibertyReader::readCellAttrString(std::string_view attr_name,
|
||||
void (LibertyCell::*set_func)(std::string value),
|
||||
void (LibertyCell::*set_func)(std::string_view value),
|
||||
LibertyCell *cell,
|
||||
const LibertyGroup *group)
|
||||
{
|
||||
|
|
@ -2937,9 +2935,9 @@ LibertyReader::readCellOcvDerateGroup(LibertyCell *cell,
|
|||
{
|
||||
const std::string &derate_name = cell_group->findAttrString("ocv_derate_group");
|
||||
if (!derate_name.empty()) {
|
||||
OcvDerate *derate = cell->findOcvDerate(derate_name.c_str());
|
||||
OcvDerate *derate = cell->findOcvDerate(derate_name);
|
||||
if (derate == nullptr)
|
||||
derate = library_->findOcvDerate(derate_name.c_str());
|
||||
derate = library_->findOcvDerate(derate_name);
|
||||
if (derate)
|
||||
cell->setOcvDerate(derate);
|
||||
else
|
||||
|
|
@ -3447,7 +3445,7 @@ LibertyReader::readDefaultOcvDerateGroup(const LibertyGroup *library_group)
|
|||
const std::string &derate_name =
|
||||
library_group->findAttrString("default_ocv_derate_group");
|
||||
if (!derate_name.empty()) {
|
||||
OcvDerate *derate = library_->findOcvDerate(derate_name.c_str());
|
||||
OcvDerate *derate = library_->findOcvDerate(derate_name);
|
||||
if (derate)
|
||||
library_->setDefaultOcvDerate(derate);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ protected:
|
|||
void readScaleFactors(LibertyCell *cell,
|
||||
const LibertyGroup *cell_group);
|
||||
void readCellAttrString(std::string_view attr_name,
|
||||
void (LibertyCell::*set_func)(std::string value),
|
||||
void (LibertyCell::*set_func)(std::string_view value),
|
||||
LibertyCell *cell,
|
||||
const LibertyGroup *group);
|
||||
void readCellAttrFloat(std::string_view attr_name,
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@ namespace sta {
|
|||
|
||||
static constexpr char escape_ = '\\';
|
||||
|
||||
ConcreteLibrary::ConcreteLibrary(std::string name,
|
||||
std::string filename,
|
||||
ConcreteLibrary::ConcreteLibrary(std::string_view name,
|
||||
std::string_view filename,
|
||||
bool is_liberty) :
|
||||
name_(std::move(name)),
|
||||
name_(name),
|
||||
id_(ConcreteNetwork::nextObjectId()),
|
||||
filename_(std::move(filename)),
|
||||
filename_(filename),
|
||||
is_liberty_(is_liberty),
|
||||
bus_brkt_left_('['),
|
||||
bus_brkt_right_(']')
|
||||
|
|
|
|||
Loading…
Reference in New Issue