mirror of https://github.com/KLayout/klayout.git
WIP: take care of the property name used for device terminal annotation.
This commit is contained in:
parent
62ffcd38e6
commit
795a77f7ce
|
|
@ -41,6 +41,12 @@ NetlistDeviceExtractor::~NetlistDeviceExtractor ()
|
||||||
// .. nothing yet ..
|
// .. nothing yet ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tl::Variant &NetlistDeviceExtractor::terminal_property_name ()
|
||||||
|
{
|
||||||
|
static tl::Variant name ("TERMINAL");
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
void NetlistDeviceExtractor::initialize (db::Netlist *nl)
|
void NetlistDeviceExtractor::initialize (db::Netlist *nl)
|
||||||
{
|
{
|
||||||
m_device_classes.clear ();
|
m_device_classes.clear ();
|
||||||
|
|
@ -105,8 +111,8 @@ void NetlistDeviceExtractor::extract (db::Layout &layout, db::Cell &cell, const
|
||||||
mp_layout = &layout;
|
mp_layout = &layout;
|
||||||
m_layers = layers;
|
m_layers = layers;
|
||||||
|
|
||||||
// terminal properties are kept in property index 0
|
// terminal properties are kept in a property with the terminal_property_name name
|
||||||
m_propname_id = mp_layout->properties_repository ().prop_name_id (tl::Variant (int (0)));
|
m_propname_id = mp_layout->properties_repository ().prop_name_id (terminal_property_name ());
|
||||||
|
|
||||||
tl_assert (m_netlist.get () != 0);
|
tl_assert (m_netlist.get () != 0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,14 @@ public:
|
||||||
|
|
||||||
// TODO: Do we need to declare input layers?
|
// TODO: Do we need to declare input layers?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the property name for the device terminal annotation
|
||||||
|
* Annotation happens through db::DeviceTerminalProperty objects attached to
|
||||||
|
* the terminal shapes.
|
||||||
|
* The name used for the property is the one returned by this function.
|
||||||
|
*/
|
||||||
|
static const tl::Variant &terminal_property_name ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the extractor
|
* @brief Initializes the extractor
|
||||||
* This method will produce the device classes required for the device extraction.
|
* This method will produce the device classes required for the device extraction.
|
||||||
|
|
|
||||||
|
|
@ -255,8 +255,6 @@ public:
|
||||||
|
|
||||||
void extract_nets (const db::DeepShapeStore &dss, const db::Connectivity &conn, db::Netlist *nl)
|
void extract_nets (const db::DeepShapeStore &dss, const db::Connectivity &conn, db::Netlist *nl)
|
||||||
{
|
{
|
||||||
tl::Variant terminal_property_name (0); // @@@ take somewhere else
|
|
||||||
|
|
||||||
// only works for singular-layout stores currently. This rules out layers from different sources
|
// only works for singular-layout stores currently. This rules out layers from different sources
|
||||||
// and clipping.
|
// and clipping.
|
||||||
tl_assert (dss.layouts () == 1);
|
tl_assert (dss.layouts () == 1);
|
||||||
|
|
@ -265,17 +263,19 @@ public:
|
||||||
tl_assert (layout->cells () != 0);
|
tl_assert (layout->cells () != 0);
|
||||||
const db::Cell &cell = layout->cell (*layout->begin_top_down ());
|
const db::Cell &cell = layout->cell (*layout->begin_top_down ());
|
||||||
|
|
||||||
// gets the text annotation property ID
|
// gets the text annotation property ID -
|
||||||
|
// this is how the texts are passed for annotating the net names
|
||||||
std::pair<bool, db::property_names_id_type> text_annot_name_id (false, 0);
|
std::pair<bool, db::property_names_id_type> text_annot_name_id (false, 0);
|
||||||
if (! dss.text_property_name ().is_nil ()) {
|
if (! dss.text_property_name ().is_nil ()) {
|
||||||
text_annot_name_id = layout->properties_repository ().get_id_of_name (dss.text_property_name ());
|
text_annot_name_id = layout->properties_repository ().get_id_of_name (dss.text_property_name ());
|
||||||
}
|
}
|
||||||
|
|
||||||
// gets the device terminal annotation property ID
|
// gets the device terminal annotation property ID -
|
||||||
std::pair<bool, db::property_names_id_type> terminal_annot_name_id (false, 0);
|
// this is how the device extractor conveys terminal shape annotations.
|
||||||
if (! terminal_property_name.is_nil ()) {
|
std::pair<bool, db::property_names_id_type> terminal_annot_name_id;
|
||||||
terminal_annot_name_id = layout->properties_repository ().get_id_of_name (terminal_property_name);
|
terminal_annot_name_id = layout->properties_repository ().get_id_of_name (db::NetlistDeviceExtractor::terminal_property_name ());
|
||||||
}
|
|
||||||
|
// the big part: actually extract the nets
|
||||||
|
|
||||||
m_net_clusters.build (*layout, cell, db::ShapeIterator::Polygons, conn);
|
m_net_clusters.build (*layout, cell, db::ShapeIterator::Polygons, conn);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue