mirror of https://github.com/KLayout/klayout.git
Implemented a solution for #2195
A new PCell method cell_name/cell_name_impl that delivers a cell name, which is used for "convert to static cell" and as cell name in general. Needs testing.
This commit is contained in:
parent
564111af77
commit
e8e2858af3
|
|
@ -149,6 +149,18 @@ created as well.
|
||||||
This method must be reimplemented in a PCell class to identify the PCell in human-readable form.
|
This method must be reimplemented in a PCell class to identify the PCell in human-readable form.
|
||||||
This text is shown in the cell tree for the PCell for example.
|
This text is shown in the cell tree for the PCell for example.
|
||||||
|
|
||||||
|
@method cell_name_impl
|
||||||
|
|
||||||
|
@brief Delivers the cell name to be used for the PCell variant
|
||||||
|
|
||||||
|
A PCell variant is represented in the cell tree by a placeholder cell. By
|
||||||
|
default, the name of this cell is the PCell name. Since multiple variants
|
||||||
|
may exist, usually a disambiguator is added to the name (e.g. "..$1").
|
||||||
|
|
||||||
|
This method allows encoding the PCell parameters into that cell name,
|
||||||
|
so the PCell variant is easier to identify in the cell tree - for example
|
||||||
|
in the GDS file - instead of the unspecific disambiguator.
|
||||||
|
|
||||||
@method produce_impl
|
@method produce_impl
|
||||||
|
|
||||||
@brief Produces the layout
|
@brief Produces the layout
|
||||||
|
|
@ -466,6 +478,19 @@ module RBA
|
||||||
text
|
text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# implementation of display_text
|
||||||
|
def cell_name(parameters)
|
||||||
|
self._start
|
||||||
|
@param_values = parameters
|
||||||
|
text = ""
|
||||||
|
begin
|
||||||
|
text = cell_name_impl
|
||||||
|
ensure
|
||||||
|
self._finish
|
||||||
|
end
|
||||||
|
text
|
||||||
|
end
|
||||||
|
|
||||||
# get the parameters
|
# get the parameters
|
||||||
def get_parameters
|
def get_parameters
|
||||||
@param_decls
|
@param_decls
|
||||||
|
|
@ -568,6 +593,11 @@ module RBA
|
||||||
""
|
""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# default implementation
|
||||||
|
def cell_name_impl
|
||||||
|
self.name
|
||||||
|
end
|
||||||
|
|
||||||
# default implementation
|
# default implementation
|
||||||
def coerce_parameters_impl
|
def coerce_parameters_impl
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,18 @@ created as well.
|
||||||
This method must be reimplemented in a PCell class to identify the PCell in human-readable form.
|
This method must be reimplemented in a PCell class to identify the PCell in human-readable form.
|
||||||
This text is shown in the cell tree for the PCell for example.
|
This text is shown in the cell tree for the PCell for example.
|
||||||
|
|
||||||
|
@method cell_name_impl
|
||||||
|
|
||||||
|
@brief Delivers the cell name to be used for the PCell variant
|
||||||
|
|
||||||
|
A PCell variant is represented in the cell tree by a placeholder cell. By
|
||||||
|
default, the name of this cell is the PCell name. Since multiple variants
|
||||||
|
may exist, usually a disambiguator is added to the name (e.g. "..$1").
|
||||||
|
|
||||||
|
This method allows encoding the PCell parameters into that cell name,
|
||||||
|
so the PCell variant is easier to identify in the cell tree - for example
|
||||||
|
in the GDS file - instead of the unspecific disambiguator.
|
||||||
|
|
||||||
@method produce_impl
|
@method produce_impl
|
||||||
|
|
||||||
@brief Produces the layout
|
@brief Produces the layout
|
||||||
|
|
|
||||||
|
|
@ -862,6 +862,12 @@ Cell::get_basic_name () const
|
||||||
return layout ()->cell_name (cell_index ());
|
return layout ()->cell_name (cell_index ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
Cell::get_variant_name () const
|
||||||
|
{
|
||||||
|
return get_basic_name ();
|
||||||
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
Cell::get_qualified_name () const
|
Cell::get_qualified_name () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -890,7 +890,7 @@ public:
|
||||||
void set_name (const std::string &name);
|
void set_name (const std::string &name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the basic name
|
* @brief Gets the basic name
|
||||||
*
|
*
|
||||||
* The basic name of the cell is either the cell name or the cell name in the
|
* The basic name of the cell is either the cell name or the cell name in the
|
||||||
* target library (for library proxies) or the PCell name (for PCell proxies).
|
* target library (for library proxies) or the PCell name (for PCell proxies).
|
||||||
|
|
@ -898,6 +898,14 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual std::string get_basic_name () const;
|
virtual std::string get_basic_name () const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the variant name
|
||||||
|
*
|
||||||
|
* The variant name is the PCell's "cell_name" - which may encode the PCell parameters
|
||||||
|
* into a formal name. Usually that is identical to the PCell name.
|
||||||
|
*/
|
||||||
|
virtual std::string get_variant_name () const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the display name
|
* @brief Gets the display name
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -2462,7 +2462,7 @@ Layout::get_pcell_variant_dict (pcell_id_type pcell_id, const std::map<std::stri
|
||||||
pcell_variant_type *variant = header->get_variant (*this, parameters);
|
pcell_variant_type *variant = header->get_variant (*this, parameters);
|
||||||
if (! variant) {
|
if (! variant) {
|
||||||
|
|
||||||
std::string b (header->get_name ());
|
std::string b (header->declaration ()->get_cell_name (parameters));
|
||||||
if (m_cell_map.find (b.c_str ()) != m_cell_map.end ()) {
|
if (m_cell_map.find (b.c_str ()) != m_cell_map.end ()) {
|
||||||
b = uniquify_cell_name (b.c_str ());
|
b = uniquify_cell_name (b.c_str ());
|
||||||
}
|
}
|
||||||
|
|
@ -2501,7 +2501,7 @@ Layout::get_pcell_variant (pcell_id_type pcell_id, const std::vector<tl::Variant
|
||||||
pcell_variant_type *variant = header->get_variant (*this, parameters);
|
pcell_variant_type *variant = header->get_variant (*this, parameters);
|
||||||
if (! variant) {
|
if (! variant) {
|
||||||
|
|
||||||
std::string b (header->get_name ());
|
std::string b (header->declaration ()->get_cell_name (parameters));
|
||||||
if (m_cell_map.find (b.c_str ()) != m_cell_map.end ()) {
|
if (m_cell_map.find (b.c_str ()) != m_cell_map.end ()) {
|
||||||
b = uniquify_cell_name (b.c_str ());
|
b = uniquify_cell_name (b.c_str ());
|
||||||
}
|
}
|
||||||
|
|
@ -2627,9 +2627,18 @@ Layout::convert_cell_to_static (db::cell_index_type ci)
|
||||||
|
|
||||||
const cell_type &org_cell = cell (ci);
|
const cell_type &org_cell = cell (ci);
|
||||||
|
|
||||||
// Note: convert to static cell by explicitly cloning to the db::Cell class
|
|
||||||
ret_ci = add_cell (org_cell.get_basic_name ().c_str ());
|
std::string vn = org_cell.get_variant_name ();
|
||||||
|
if (vn == cell_name (ci)) {
|
||||||
|
// there is a cell name conflict: give priority to the static cell, so it
|
||||||
|
// will see the variant name
|
||||||
|
std::string rename_org = uniquify_cell_name (cell_name (ci));
|
||||||
|
rename_cell (ci, rename_org.c_str ());
|
||||||
|
}
|
||||||
|
|
||||||
|
ret_ci = add_cell (vn.c_str ());
|
||||||
cell_type &new_cell = cell (ret_ci);
|
cell_type &new_cell = cell (ret_ci);
|
||||||
|
// Note: we convert to static cell by explicitly cloning to the db::Cell class
|
||||||
new_cell = org_cell;
|
new_cell = org_cell;
|
||||||
new_cell.set_cell_index (ret_ci);
|
new_cell.set_cell_index (ret_ci);
|
||||||
|
|
||||||
|
|
@ -3126,6 +3135,12 @@ Layout::basic_name (cell_index_type cell_index) const
|
||||||
return cell (cell_index).get_basic_name ();
|
return cell (cell_index).get_basic_name ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
Layout::variant_name (cell_index_type cell_index) const
|
||||||
|
{
|
||||||
|
return cell (cell_index).get_variant_name ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Layout::register_lib_proxy (db::LibraryProxy *lib_proxy)
|
Layout::register_lib_proxy (db::LibraryProxy *lib_proxy)
|
||||||
{
|
{
|
||||||
|
|
@ -3161,7 +3176,7 @@ Layout::get_lib_proxy (Library *lib, cell_index_type cell_index)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// create a new unique name
|
// create a new unique name
|
||||||
std::string b (lib->layout ().basic_name (cell_index));
|
std::string b (lib->layout ().variant_name (cell_index));
|
||||||
if (m_cell_map.find (b.c_str ()) != m_cell_map.end ()) {
|
if (m_cell_map.find (b.c_str ()) != m_cell_map.end ()) {
|
||||||
b = uniquify_cell_name (b.c_str ());
|
b = uniquify_cell_name (b.c_str ());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -675,7 +675,7 @@ public:
|
||||||
std::string display_name (cell_index_type cell_index) const;
|
std::string display_name (cell_index_type cell_index) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return the basic name for the given cell
|
* @brief Returns the basic name for the given cell
|
||||||
*
|
*
|
||||||
* This method is forwarded to the respective method of the cell.
|
* This method is forwarded to the respective method of the cell.
|
||||||
* The basic name is the "original" cell name within the library or
|
* The basic name is the "original" cell name within the library or
|
||||||
|
|
@ -684,6 +684,15 @@ public:
|
||||||
*/
|
*/
|
||||||
std::string basic_name (cell_index_type cell_index) const;
|
std::string basic_name (cell_index_type cell_index) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the variant name for the given cell
|
||||||
|
*
|
||||||
|
* The variant name usually is the basic name. For PCells, this name
|
||||||
|
* can encode PCell parameters, depending on the definition of the
|
||||||
|
* PCell.
|
||||||
|
*/
|
||||||
|
std::string variant_name (cell_index_type cell_index) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a cell object with the given ID and name
|
* @brief Add a cell object with the given ID and name
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,22 @@ LibraryProxy::get_basic_name () const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
LibraryProxy::get_variant_name () const
|
||||||
|
{
|
||||||
|
Library *lib = LibraryManager::instance ().lib (lib_id ());
|
||||||
|
if (lib) {
|
||||||
|
if (! lib->layout ().is_valid_cell_index (library_cell_index ())) {
|
||||||
|
return "<defunct>";
|
||||||
|
} else {
|
||||||
|
const db::Cell &lib_cell = lib->layout ().cell (library_cell_index ());
|
||||||
|
return lib_cell.get_variant_name ();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Cell::get_variant_name ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
LibraryProxy::get_display_name () const
|
LibraryProxy::get_display_name () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -96,25 +96,28 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Gets the basic name
|
* @brief Gets the basic name
|
||||||
*
|
*
|
||||||
* The basic name of the cell is either the cell name or the cell name in the
|
* This returns the basic name of the proxy target
|
||||||
* target library (for library proxies) or the PCell name (for PCell proxies).
|
|
||||||
* The actual name may be different by a extension to make it unique.
|
|
||||||
*/
|
*/
|
||||||
virtual std::string get_basic_name () const;
|
virtual std::string get_basic_name () const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the variant name
|
||||||
|
*
|
||||||
|
* This returns the basic name of the proxy target
|
||||||
|
*/
|
||||||
|
virtual std::string get_variant_name () const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the display name
|
* @brief Gets the display name
|
||||||
*
|
*
|
||||||
* The display name is some "nice" descriptive name of the cell (variant)
|
* This returns the basic name of the proxy target
|
||||||
* For normal cells this name is equivalent to the normal cell name.
|
|
||||||
*/
|
*/
|
||||||
virtual std::string get_display_name () const;
|
virtual std::string get_display_name () const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the qualified name
|
* @brief Gets the qualified name
|
||||||
*
|
*
|
||||||
* The qualified name for a library proxy is made from the library name, a
|
* Gets a combination of the library name and the target cell's qualified name
|
||||||
* dot and the cell's name.
|
|
||||||
*/
|
*/
|
||||||
virtual std::string get_qualified_name () const;
|
virtual std::string get_qualified_name () const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -673,6 +673,18 @@ public:
|
||||||
return std::string ();
|
return std::string ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets a cell name for the PCell, which can depend on the parameters
|
||||||
|
*
|
||||||
|
* The actual cell name in the layout may differ by disambiguation. This method
|
||||||
|
* delivers a proposal for a cell name.
|
||||||
|
* By default, the PCell name is returned.
|
||||||
|
*/
|
||||||
|
virtual std::string get_cell_name (const pcell_parameters_type &) const
|
||||||
|
{
|
||||||
|
return m_name;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the description text of the PCell
|
* @brief Returns the description text of the PCell
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,17 @@ PCellVariant::get_basic_name () const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
PCellVariant::get_variant_name () const
|
||||||
|
{
|
||||||
|
const PCellHeader *header = pcell_header ();
|
||||||
|
if (header) {
|
||||||
|
return m_variant_name;
|
||||||
|
} else {
|
||||||
|
return Cell::get_basic_name ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
PCellVariant::get_display_name () const
|
PCellVariant::get_display_name () const
|
||||||
{
|
{
|
||||||
|
|
@ -172,6 +183,7 @@ PCellVariant::update (ImportLayerMapping *layer_mapping)
|
||||||
header->declaration ()->produce (*layout (), layer_ids, plist, *this);
|
header->declaration ()->produce (*layout (), layer_ids, plist, *this);
|
||||||
|
|
||||||
m_display_name = header->declaration ()->get_display_name (plist);
|
m_display_name = header->declaration ()->get_display_name (plist);
|
||||||
|
m_variant_name = header->declaration ()->get_cell_name (plist);
|
||||||
|
|
||||||
} catch (tl::Exception &ex) {
|
} catch (tl::Exception &ex) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,42 +94,37 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the basic name
|
* @brief Gets the basic name
|
||||||
*
|
|
||||||
* The basic name of the cell is either the cell name or the cell name in the
|
|
||||||
* target library (for library proxies) or the PCell name (for PCell proxies).
|
|
||||||
* The actual name may be different by a extension to make it unique.
|
|
||||||
*/
|
*/
|
||||||
virtual std::string get_basic_name () const;
|
virtual std::string get_basic_name () const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the display name
|
* @brief Gets the variant name
|
||||||
*
|
*/
|
||||||
* The display name is some "nice" descriptive name of the cell (variant)
|
virtual std::string get_variant_name () const;
|
||||||
* For normal cells this name is equivalent to the normal cell name.
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the display name
|
||||||
*/
|
*/
|
||||||
virtual std::string get_display_name () const;
|
virtual std::string get_display_name () const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unregister a cell from it's context.
|
* @brief Unregisters a cell from it's context.
|
||||||
*/
|
*/
|
||||||
virtual void unregister ();
|
virtual void unregister ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reregister a cell inside it's context.
|
* @brief Re-registers a cell inside it's context.
|
||||||
*/
|
*/
|
||||||
virtual void reregister ();
|
virtual void reregister ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Update the layout
|
* @brief Updates the layout
|
||||||
*/
|
*/
|
||||||
virtual void update (ImportLayerMapping *layer_mapping = 0);
|
virtual void update (ImportLayerMapping *layer_mapping = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Tell, if this cell is a proxy cell
|
* @brief Gets a value indicating if this cell is a proxy cell
|
||||||
*
|
|
||||||
* Proxy cells are such whose layout represents a snapshot of another entity.
|
|
||||||
* Such cells can be PCell variants or library references for example.
|
|
||||||
*/
|
*/
|
||||||
virtual bool is_proxy () const
|
virtual bool is_proxy () const
|
||||||
{
|
{
|
||||||
|
|
@ -138,7 +133,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @brief Get the PCell header for this variant
|
* @brief Gets the PCell header for this variant
|
||||||
*/
|
*/
|
||||||
PCellHeader *pcell_header ()
|
PCellHeader *pcell_header ()
|
||||||
{
|
{
|
||||||
|
|
@ -146,7 +141,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the PCell header for this variant
|
* @brief Gets the PCell header for this variant
|
||||||
*/
|
*/
|
||||||
const PCellHeader *pcell_header () const
|
const PCellHeader *pcell_header () const
|
||||||
{
|
{
|
||||||
|
|
@ -156,6 +151,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
pcell_parameters_type m_parameters;
|
pcell_parameters_type m_parameters;
|
||||||
mutable std::string m_display_name;
|
mutable std::string m_display_name;
|
||||||
|
mutable std::string m_variant_name;
|
||||||
db::pcell_id_type m_pcell_id;
|
db::pcell_id_type m_pcell_id;
|
||||||
bool m_registered;
|
bool m_registered;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -368,6 +368,7 @@ Class<db::PCellDeclaration> decl_PCellDeclaration_Native ("db", "PCellDeclaratio
|
||||||
gsi::method ("via_types", &db::PCellDeclaration::via_types) +
|
gsi::method ("via_types", &db::PCellDeclaration::via_types) +
|
||||||
gsi::method ("description", &db::PCellDeclaration::get_description) +
|
gsi::method ("description", &db::PCellDeclaration::get_description) +
|
||||||
gsi::method ("display_text", &db::PCellDeclaration::get_display_name, gsi::arg ("parameters")) +
|
gsi::method ("display_text", &db::PCellDeclaration::get_display_name, gsi::arg ("parameters")) +
|
||||||
|
gsi::method ("cell_name", &db::PCellDeclaration::get_cell_name, gsi::arg ("parameters")) +
|
||||||
gsi::method ("layout", &db::PCellDeclaration::layout,
|
gsi::method ("layout", &db::PCellDeclaration::layout,
|
||||||
"@brief Gets the Layout object the PCell is registered in or nil if it is not registered yet.\n"
|
"@brief Gets the Layout object the PCell is registered in or nil if it is not registered yet.\n"
|
||||||
"This attribute has been added in version 0.27.5."
|
"This attribute has been added in version 0.27.5."
|
||||||
|
|
@ -659,6 +660,20 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string get_cell_name_fb (const db::pcell_parameters_type ¶meters) const
|
||||||
|
{
|
||||||
|
return db::PCellDeclaration::get_cell_name (parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual std::string get_cell_name (const db::pcell_parameters_type ¶meters) const
|
||||||
|
{
|
||||||
|
if (cb_get_cell_name.can_issue ()) {
|
||||||
|
return cb_get_cell_name.issue<db::PCellDeclaration, std::string, const db::pcell_parameters_type &> (&db::PCellDeclaration::get_cell_name, parameters);
|
||||||
|
} else {
|
||||||
|
return db::PCellDeclaration::get_cell_name (parameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gsi::Callback cb_get_layer_declarations;
|
gsi::Callback cb_get_layer_declarations;
|
||||||
gsi::Callback cb_get_parameter_declarations;
|
gsi::Callback cb_get_parameter_declarations;
|
||||||
gsi::Callback cb_produce;
|
gsi::Callback cb_produce;
|
||||||
|
|
@ -669,6 +684,7 @@ public:
|
||||||
gsi::Callback cb_coerce_parameters;
|
gsi::Callback cb_coerce_parameters;
|
||||||
gsi::Callback cb_callback;
|
gsi::Callback cb_callback;
|
||||||
gsi::Callback cb_get_display_name;
|
gsi::Callback cb_get_display_name;
|
||||||
|
gsi::Callback cb_get_cell_name;
|
||||||
gsi::Callback cb_get_description;
|
gsi::Callback cb_get_description;
|
||||||
gsi::Callback cb_via_types;
|
gsi::Callback cb_via_types;
|
||||||
};
|
};
|
||||||
|
|
@ -809,6 +825,13 @@ Class<PCellDeclarationImpl> decl_PCellDeclaration (decl_PCellDeclaration_Native,
|
||||||
"@brief Returns the display text for this PCell given a certain parameter set\n"
|
"@brief Returns the display text for this PCell given a certain parameter set\n"
|
||||||
"Reimplement this method to create a distinct display text for a PCell variant with \n"
|
"Reimplement this method to create a distinct display text for a PCell variant with \n"
|
||||||
"the given parameter set. If this method is not implemented, a default text is created. \n"
|
"the given parameter set. If this method is not implemented, a default text is created. \n"
|
||||||
|
) +
|
||||||
|
gsi::callback ("cell_name", &PCellDeclarationImpl::get_cell_name, &PCellDeclarationImpl::cb_get_cell_name, gsi::arg ("parameters"),
|
||||||
|
"@brief Returns a cell name used for the PCell variant\n"
|
||||||
|
"Reimplement this method to create a cell name the system uses for the PCell variant. By default that is the PCell name.\n"
|
||||||
|
"This feature allows encoding the PCell parameters into the cell name for easier identification of the PCell variant in a cell tree.\n"
|
||||||
|
"\n"
|
||||||
|
"This feature has been added in version 0.30.5.\n"
|
||||||
),
|
),
|
||||||
"@brief A PCell declaration providing the parameters and code to produce the PCell\n"
|
"@brief A PCell declaration providing the parameters and code to produce the PCell\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,21 @@ class _PCellDeclarationHelperMixin:
|
||||||
self._finish()
|
self._finish()
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
def cell_name(self, parameters):
|
||||||
|
"""
|
||||||
|
Reimplementation of PCellDeclaration.cell_name
|
||||||
|
|
||||||
|
This function delegates the implementation to self.cell_name_impl
|
||||||
|
after configuring the PCellDeclaration object.
|
||||||
|
"""
|
||||||
|
self._start()
|
||||||
|
self._param_values = parameters
|
||||||
|
try:
|
||||||
|
text = self.cell_name_impl()
|
||||||
|
finally:
|
||||||
|
self._finish()
|
||||||
|
return text
|
||||||
|
|
||||||
def get_parameters(self):
|
def get_parameters(self):
|
||||||
"""
|
"""
|
||||||
Reimplementation of PCellDeclaration.get_parameters
|
Reimplementation of PCellDeclaration.get_parameters
|
||||||
|
|
@ -333,6 +348,12 @@ class _PCellDeclarationHelperMixin:
|
||||||
"""
|
"""
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
def cell_name_impl(self):
|
||||||
|
"""
|
||||||
|
default implementation
|
||||||
|
"""
|
||||||
|
return self.name()
|
||||||
|
|
||||||
def coerce_parameters_impl(self):
|
def coerce_parameters_impl(self):
|
||||||
"""
|
"""
|
||||||
default implementation
|
default implementation
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue