A more compact string representation for Hurricane::Path.

This commit is contained in:
Jean-Paul Chaput 2021-03-15 23:45:33 +01:00
parent dbb16b618f
commit 11390867f1
3 changed files with 13 additions and 7 deletions

View File

@ -256,16 +256,21 @@ void Path::setNameSeparator(char nameSeparator)
SharedPath::setNameSeparator(nameSeparator);
}
string Path::getCompactString() const
// **********************************
string Path::getCompactString( bool showBrackets ) const
// *****************************************************
{
if (isEmpty()) return "<empty>";
if (isEmpty()) {
if (not showBrackets) return "__empty__";
return "<empty>";
}
string s = "<";
string s;
if (showBrackets) s += "<";
s += getString(getOwnerCell()->getName());
s += ":";
s += getString(_sharedPath->getName()) + ":";
s += getString(getMasterCell()->getName()) + ">";
s += getString(_sharedPath->getName());
if (showBrackets)
s += ":" + getString(getMasterCell()->getName()) + ">";
return s;
}

View File

@ -96,7 +96,7 @@ class Path {
// Others
// ******
public: string getCompactString() const;
public: string getCompactString(bool showBrackets=true) const;
public: string getJsonString(unsigned long flags) const;
public: string _getTypeName() const { return _TName("Occurrence"); };
public: string _getString() const;

View File

@ -866,6 +866,7 @@ extern "C" {
LoadObjectConstant(PyTypeCell.tp_dict,Cell::Flags::BuildClockRings ,"Flags_BuildClockRings");
LoadObjectConstant(PyTypeCell.tp_dict,Cell::Flags::BuildSupplyRings,"Flags_BuildSupplyRings");
LoadObjectConstant(PyTypeCell.tp_dict,Cell::Flags::NoClockFlatten ,"Flags_NoClockFlatten");
LoadObjectConstant(PyTypeCell.tp_dict,Cell::Flags::TerminalNetlist ,"Flags_TerminalNetlist");
LoadObjectConstant(PyTypeCell.tp_dict,Cell::Flags::AbstractedSupply,"Flags_AbstractedSupply");
}