From 795a77f7ce1daf87fd142b1e281ecd8463893cb1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 27 Dec 2018 01:39:22 +0100 Subject: [PATCH] WIP: take care of the property name used for device terminal annotation. --- src/db/db/dbNetlistDeviceExtractor.cc | 10 ++++++++-- src/db/db/dbNetlistDeviceExtractor.h | 8 ++++++++ .../unit_tests/dbNetlistDeviceExtractorTests.cc | 16 ++++++++-------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/db/db/dbNetlistDeviceExtractor.cc b/src/db/db/dbNetlistDeviceExtractor.cc index a63744a90..60b00f006 100644 --- a/src/db/db/dbNetlistDeviceExtractor.cc +++ b/src/db/db/dbNetlistDeviceExtractor.cc @@ -41,6 +41,12 @@ NetlistDeviceExtractor::~NetlistDeviceExtractor () // .. nothing yet .. } +const tl::Variant &NetlistDeviceExtractor::terminal_property_name () +{ + static tl::Variant name ("TERMINAL"); + return name; +} + void NetlistDeviceExtractor::initialize (db::Netlist *nl) { m_device_classes.clear (); @@ -105,8 +111,8 @@ void NetlistDeviceExtractor::extract (db::Layout &layout, db::Cell &cell, const mp_layout = &layout; m_layers = layers; - // terminal properties are kept in property index 0 - m_propname_id = mp_layout->properties_repository ().prop_name_id (tl::Variant (int (0))); + // terminal properties are kept in a property with the terminal_property_name name + m_propname_id = mp_layout->properties_repository ().prop_name_id (terminal_property_name ()); tl_assert (m_netlist.get () != 0); diff --git a/src/db/db/dbNetlistDeviceExtractor.h b/src/db/db/dbNetlistDeviceExtractor.h index e98ab6def..ca5d8563b 100644 --- a/src/db/db/dbNetlistDeviceExtractor.h +++ b/src/db/db/dbNetlistDeviceExtractor.h @@ -55,6 +55,14 @@ public: // 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 * This method will produce the device classes required for the device extraction. diff --git a/src/db/unit_tests/dbNetlistDeviceExtractorTests.cc b/src/db/unit_tests/dbNetlistDeviceExtractorTests.cc index bfa83a9e7..d0cb30f19 100644 --- a/src/db/unit_tests/dbNetlistDeviceExtractorTests.cc +++ b/src/db/unit_tests/dbNetlistDeviceExtractorTests.cc @@ -255,8 +255,6 @@ public: 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 // and clipping. tl_assert (dss.layouts () == 1); @@ -265,17 +263,19 @@ public: tl_assert (layout->cells () != 0); 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 text_annot_name_id (false, 0); if (! dss.text_property_name ().is_nil ()) { text_annot_name_id = layout->properties_repository ().get_id_of_name (dss.text_property_name ()); } - // gets the device terminal annotation property ID - std::pair terminal_annot_name_id (false, 0); - if (! terminal_property_name.is_nil ()) { - terminal_annot_name_id = layout->properties_repository ().get_id_of_name (terminal_property_name); - } + // gets the device terminal annotation property ID - + // this is how the device extractor conveys terminal shape annotations. + std::pair terminal_annot_name_id; + 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);