Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/db/db/dbEdgePairs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ EdgePairs::EdgePairs (DeepShapeStore &dss)
mp_delegate = new DeepEdgePairs (DeepLayer (&dss, layout_index, dss.layout (layout_index).insert_layer ()));
}

void
EdgePairs::convert_to_deep (const db::DeepLayer &layer)
{
tl_assert (mp_delegate->deep () == 0);
set_delegate (copy_data_id (new db::DeepEdgePairs (layer)));
}

void
EdgePairs::write (const std::string &fn) const
{
Expand Down
5 changes: 5 additions & 0 deletions src/db/db/dbEdgePairs.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ class DB_PUBLIC EdgePairs
*/
explicit EdgePairs (DeepShapeStore &dss);

/**
* @brief Converts the shape collection to a deep one using the specified layer
*/
virtual void convert_to_deep (const db::DeepLayer &layer);

/**
* @brief Writes the edge pair collection to a file
*
Expand Down
7 changes: 7 additions & 0 deletions src/db/db/dbEdges.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ Edges::Edges (DeepShapeStore &dss)
mp_delegate = new DeepEdges (DeepLayer (&dss, layout_index, dss.layout (layout_index).insert_layer ()));
}

void
Edges::convert_to_deep (const db::DeepLayer &layer)
{
tl_assert (mp_delegate->deep () == 0);
set_delegate (copy_data_id (new db::DeepEdges (layer)));
}

const db::RecursiveShapeIterator &
Edges::iter () const
{
Expand Down
5 changes: 5 additions & 0 deletions src/db/db/dbEdges.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ class DB_PUBLIC Edges
*/
explicit Edges (DeepShapeStore &dss);

/**
* @brief Converts the shape collection to a deep one using the specified layer
*/
virtual void convert_to_deep (const db::DeepLayer &layer);

/**
* @brief Implementation of the ShapeCollection interface
*/
Expand Down
6 changes: 4 additions & 2 deletions src/db/db/dbNetlistDeviceExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ void NetlistDeviceExtractor::extract (db::DeepShapeStore &dss, unsigned int layo

std::pair<bool, db::DeepLayer> alias = dss.layer_for_flat (tl::id_of (l->second->get_delegate ()));
if (alias.first) {
// use deep layer alias for a given flat one (if found)
layers.push_back (alias.second.layer ());
// use deep layer alias for a given flat one (if found) and convert layer to a deep one
db::DeepLayer dl = alias.second;
l->second->convert_to_deep (dl);
layers.push_back (dl.layer ());
} else {
throw tl::Exception (tl::sprintf (tl::to_string (tr ("Invalid region passed to input layer '%s' for device extraction (device %s): must be of deep region kind")), ld->name, name ()));
}
Expand Down
7 changes: 7 additions & 0 deletions src/db/db/dbRegion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ Region::Region (DeepShapeStore &dss)
mp_delegate = new db::DeepRegion (db::DeepLayer (&dss, layout_index, dss.layout (layout_index).insert_layer ()));
}

void
Region::convert_to_deep (const db::DeepLayer &layer)
{
tl_assert (mp_delegate->deep () == 0);
set_delegate (copy_data_id (new db::DeepRegion (layer)));
}

void
Region::write (const std::string &fn) const
{
Expand Down
5 changes: 5 additions & 0 deletions src/db/db/dbRegion.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ class DB_PUBLIC Region
*/
void write (const std::string &fn) const;

/**
* @brief Converts the shape collection to a deep one using the specified layer
*/
virtual void convert_to_deep (const db::DeepLayer &layer);

/**
* @brief Implementation of the ShapeCollection interface
*/
Expand Down
36 changes: 35 additions & 1 deletion src/db/db/dbShapeCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ class DB_PUBLIC ShapeCollectionDelegateBase
: public tl::UniqueId
{
public:
ShapeCollectionDelegateBase () { }
ShapeCollectionDelegateBase ()
: m_data_id (tl::id_of (this))
{
// .. nothing yet ..
}

virtual ~ShapeCollectionDelegateBase () { }

virtual DeepShapeCollectionDelegateBase *deep () { return 0; }
Expand All @@ -88,6 +93,22 @@ class DB_PUBLIC ShapeCollectionDelegateBase
apply_property_translator (db::PropertiesTranslator::make_remove_all ());
}
}

tl::id_type data_id () const
{
return m_data_id;
}

private:
friend class ShapeCollection;

tl::id_type m_data_id;

// used for conversion to deep
void set_data_id (tl::id_type data_id)
{
m_data_id = data_id;
}
};

/**
Expand All @@ -102,6 +123,11 @@ class DB_PUBLIC ShapeCollection

virtual ShapeCollectionDelegateBase *get_delegate () const = 0;

/**
* @brief Converts the shape collection to a deep one using the specified layer
*/
virtual void convert_to_deep (const db::DeepLayer &layer) = 0;

/**
* @brief Applies a PropertyTranslator
*
Expand All @@ -111,6 +137,14 @@ class DB_PUBLIC ShapeCollection
* delivered by "properties_repository".
*/
void apply_property_translator (const db::PropertiesTranslator &pt);

protected:
template <class Delegate>
Delegate *copy_data_id (Delegate *dlg)
{
dlg->set_data_id (get_delegate ()->data_id ());
return dlg;
}
};

}
Expand Down
7 changes: 7 additions & 0 deletions src/db/db/dbTexts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ Texts::Texts (DeepShapeStore &dss)
mp_delegate = new DeepTexts (DeepLayer (&dss, layout_index, dss.layout (layout_index).insert_layer ()));
}

void
Texts::convert_to_deep (const db::DeepLayer &layer)
{
tl_assert (mp_delegate->deep () == 0);
set_delegate (copy_data_id (new db::DeepTexts (layer)));
}

void
Texts::write (const std::string &fn) const
{
Expand Down
5 changes: 5 additions & 0 deletions src/db/db/dbTexts.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ class DB_PUBLIC Texts
*/
void write (const std::string &fn) const;

/**
* @brief Converts the shape collection to a deep one using the specified layer
*/
virtual void convert_to_deep (const db::DeepLayer &layer);

/**
* @brief Implementation of the ShapeCollection interface
*/
Expand Down
6 changes: 3 additions & 3 deletions src/db/db/gsiDeclDbEdgePairs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,9 @@ static bool is_deep (const db::EdgePairs *ep)
return dynamic_cast<const db::DeepEdgePairs *> (ep->delegate ()) != 0;
}

static size_t id (const db::EdgePairs *ep)
static size_t data_id (const db::EdgePairs *ep)
{
return tl::id_of (ep->delegate ());
return ep->delegate ()->data_id ();
}

static db::EdgePairs filtered (const db::EdgePairs *r, const gsi::EdgePairFilterBase *f)
Expand Down Expand Up @@ -1114,7 +1114,7 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"\n"
"This method has been added in version 0.26."
) +
method_ext ("data_id", &id,
method_ext ("data_id", &data_id,
"@brief Returns the data ID (a unique identifier for the underlying data storage)\n"
"\n"
"This method has been added in version 0.26."
Expand Down
6 changes: 3 additions & 3 deletions src/db/db/gsiDeclDbEdges.cc
Original file line number Diff line number Diff line change
Expand Up @@ -892,9 +892,9 @@ static db::Edges *new_texts_as_dots2 (const db::RecursiveShapeIterator &si, db::
return new db::Edges (db::Region (si).texts_as_dots (pat, pattern, dss));
}

static size_t id (const db::Edges *e)
static size_t data_id (const db::Edges *e)
{
return tl::id_of (e->delegate ());
return e->delegate ()->data_id ();
}

static std::vector<db::Edges> andnot_with_edges (const db::Edges *r, const db::Edges &other)
Expand Down Expand Up @@ -2572,7 +2572,7 @@ Class<db::Edges> decl_Edges (decl_dbShapeCollection, "db", "Edges",
"\n"
"This method has been added in version 0.26."
) +
method_ext ("data_id", &id,
method_ext ("data_id", &data_id,
"@brief Returns the data ID (a unique identifier for the underlying data storage)\n"
"\n"
"This method has been added in version 0.26."
Expand Down
6 changes: 3 additions & 3 deletions src/db/db/gsiDeclDbRegion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,9 @@ static bool is_deep (const db::Region *region)
return dynamic_cast<const db::DeepRegion *> (region->delegate ()) != 0;
}

static size_t id (const db::Region *r)
static size_t data_id (const db::Region *r)
{
return tl::id_of (r->delegate ());
return r->delegate ()->data_id ();
}


Expand Down Expand Up @@ -4214,7 +4214,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"This method has been added in version 0.26."
) +
method_ext ("data_id", &id,
method_ext ("data_id", &data_id,
"@brief Returns the data ID (a unique identifier for the underlying data storage)\n"
"\n"
"This method has been added in version 0.26."
Expand Down
6 changes: 3 additions & 3 deletions src/db/db/gsiDeclDbTexts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ static bool is_deep (const db::Texts *t)
return dynamic_cast<const db::DeepTexts *> (t->delegate ()) != 0;
}

static size_t id (const db::Texts *t)
static size_t data_id (const db::Texts *t)
{
return tl::id_of (t->delegate ());
return t->delegate ()->data_id ();
}

static db::Texts filtered (const db::Texts *r, const gsi::TextFilterBase *f)
Expand Down Expand Up @@ -686,7 +686,7 @@ Class<db::Texts> decl_Texts (decl_dbShapeCollection, "db", "Texts",
method_ext ("is_deep?", &is_deep,
"@brief Returns true if the edge pair collection is a deep (hierarchical) one\n"
) +
method_ext ("data_id", &id,
method_ext ("data_id", &data_id,
"@brief Returns the data ID (a unique identifier for the underlying data storage)\n"
) +
method ("+|join", &db::Texts::operator+, gsi::arg ("other"),
Expand Down
4 changes: 3 additions & 1 deletion src/drc/drc/built-in-macros/_drc_netter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ def extract_devices(devex, layer_selection)
#
# If layers are not named, they will be given a name made from the
# \name_prefix and an incremental number when the layer is used for the
# first time.
# first time. As the default name prefix is "l", you may can name conflicts
# with auto-named layers, if you register explicit layer names like "l5".
# Consider changing the name prefix in that case to some prefix you are not using.
#
# \name can only be used once on a layer and the layer names must be
# unique (not taken by another layer).
Expand Down
6 changes: 6 additions & 0 deletions src/lvs/unit_tests/lvsSimpleTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,9 @@ TEST(63_FlagMissingPorts)
run_test (_this, "flag_missing_ports", "flag_missing_ports.gds", false, true, "TOP");
}

// Split substrate - marker and global connection (issue #2345)
TEST(64_SplitSubstrate)
{
run_test (_this, "split_substrate", "split_substrate.gds", true, false /*no LVS*/);
}

Binary file modified testdata/drc/drcSimpleTests_au121.gds
Binary file not shown.
13 changes: 13 additions & 0 deletions testdata/lvs/split_substrate.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* Extracted by KLayout

.SUBCKT TOP A Q IOSUB SUBSTRATE
X$1 \$7 \$1 Q IOSUB IOSUB INV
X$2 \$7 A \$1 SUBSTRATE SUBSTRATE INV
.ENDS TOP

.SUBCKT INV \$2 \$4 \$5 \$1 \$I11
M$1 \$2 \$4 \$5 \$2 PMOS L=0.25U W=0.95U AS=0.73625P AD=0.73625P PS=3.45U
+ PD=3.45U
M$2 \$1 \$4 \$5 \$I11 NMOS L=0.25U W=0.95U AS=0.73625P AD=0.73625P PS=3.45U
+ PD=3.45U
.ENDS INV
Binary file added testdata/lvs/split_substrate.gds
Binary file not shown.
Loading
Loading