Skip to content

Commit 89c281f

Browse files
author
Matthias Koefferlein
committed
Integration API into LVS+DRC
1 parent d87e3de commit 89c281f

File tree

4 files changed

+141
-1
lines changed

4 files changed

+141
-1
lines changed

samples/lvs/ringo.gds

-4 Bytes
Binary file not shown.

src/db/db/gsiDeclDbLayoutToNetlist.cc

+43-1
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,32 @@ Class<db::LayoutToNetlist> decl_dbLayoutToNetlist ("db", "LayoutToNetlist",
433433
"\n"
434434
"This variant has been introduced in version 0.27.\n"
435435
) +
436+
gsi::method ("soft_connect", (void (db::LayoutToNetlist::*) (const db::Region &, const db::Region &)) &db::LayoutToNetlist::soft_connect, gsi::arg ("a"), gsi::arg ("b"),
437+
"@brief Defines an inter-layer connection for the given layers in soft mode.\n"
438+
"Connects two layers through a soft connection.\n"
439+
"Soft connections cannot make connections between two different nets.\n"
440+
"These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion).\n"
441+
"\n"
442+
"Soft connections have been introduced in version 0.29.\n"
443+
) +
444+
gsi::method ("soft_connect", (void (db::LayoutToNetlist::*) (const db::Region &, const db::Texts &)) &db::LayoutToNetlist::soft_connect, gsi::arg ("a"), gsi::arg ("b"),
445+
"@brief Defines an inter-layer connection for the given layers in soft mode.\n"
446+
"Connects two layers through a soft connection.\n"
447+
"Soft connections cannot make connections between two different nets.\n"
448+
"These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion).\n"
449+
"As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.\n"
450+
"\n"
451+
"Soft connections have been introduced in version 0.29.\n"
452+
) +
453+
gsi::method ("soft_connect", (void (db::LayoutToNetlist::*) (const db::Texts &, const db::Region &)) &db::LayoutToNetlist::soft_connect, gsi::arg ("a"), gsi::arg ("b"),
454+
"@brief Defines an inter-layer connection for the given layers in soft mode.\n"
455+
"Connects two layers through a soft connection.\n"
456+
"Soft connections cannot make connections between two different nets.\n"
457+
"These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion).\n"
458+
"As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.\n"
459+
"\n"
460+
"Soft connections have been introduced in version 0.29.\n"
461+
) +
436462
gsi::method ("connect_global", (size_t (db::LayoutToNetlist::*) (const db::Region &, const std::string &)) &db::LayoutToNetlist::connect_global, gsi::arg ("l"), gsi::arg ("global_net_name"),
437463
"@brief Defines a connection of the given layer with a global net.\n"
438464
"This method returns the ID of the global net. Use \\global_net_name to get "
@@ -441,10 +467,26 @@ Class<db::LayoutToNetlist> decl_dbLayoutToNetlist ("db", "LayoutToNetlist",
441467
gsi::method ("connect_global", (size_t (db::LayoutToNetlist::*) (const db::Texts &, const std::string &)) &db::LayoutToNetlist::connect_global, gsi::arg ("l"), gsi::arg ("global_net_name"),
442468
"@brief Defines a connection of the given text layer with a global net.\n"
443469
"This method returns the ID of the global net. Use \\global_net_name to get "
444-
"the name back from the ID."
470+
"the name back from the ID.\n"
445471
"\n"
446472
"This variant has been introduced in version 0.27.\n"
447473
) +
474+
gsi::method ("soft_connect_global", (size_t (db::LayoutToNetlist::*) (const db::Region &, const std::string &)) &db::LayoutToNetlist::soft_connect_global, gsi::arg ("l"), gsi::arg ("global_net_name"),
475+
"@brief Defines a connection of the given layer with a global net in soft mode.\n"
476+
"This method returns the ID of the global net. Use \\global_net_name to get "
477+
"the name back from the ID.\n"
478+
"Soft connections are directional, where the global net is the 'lower' layer (typically high-ohmic substrate or diffusion).\n"
479+
"\n"
480+
"Soft connections have been introduced in version 0.29.\n"
481+
) +
482+
gsi::method ("soft_connect_global", (size_t (db::LayoutToNetlist::*) (const db::Texts &, const std::string &)) &db::LayoutToNetlist::soft_connect_global, gsi::arg ("l"), gsi::arg ("global_net_name"),
483+
"@brief Defines a connection of the given text layer with a global net in soft mode.\n"
484+
"This method returns the ID of the global net. Use \\global_net_name to get "
485+
"the name back from the ID.\n"
486+
"Soft connections are directional, where the global net is the 'lower' layer (typically high-ohmic substrate or diffusion).\n"
487+
"\n"
488+
"Soft connections have been introduced in version 0.29.\n"
489+
) +
448490
gsi::method ("global_net_name", &db::LayoutToNetlist::global_net_name, gsi::arg ("global_net_id"),
449491
"@brief Gets the global net name for the given global net ID."
450492
) +

src/drc/drc/built-in-macros/_drc_engine.rb

+26
Original file line numberDiff line numberDiff line change
@@ -2244,12 +2244,36 @@ def netter
22442244
# @synopsis connect(a, b)
22452245
# See \Netter#connect for a description of that function.
22462246

2247+
# %DRC%
2248+
# @name soft_connect
2249+
# @brief Specifies a soft connection between two layers
2250+
# @synopsis soft_connect(a, b)
2251+
# A "soft connection" is made between two layers and
2252+
# is a directional connection (like an ideal diode).
2253+
# Soft connections allow detecting if nets are connected
2254+
# via a high-ohmic substrate or diffusion layer (the
2255+
# "lower" layer).
2256+
# "b" is the "lower" and "a" the upper layer.
2257+
#
2258+
# See \Netter#connect for a more detailed description of that function.
2259+
22472260
# %DRC%
22482261
# @name connect_global
22492262
# @brief Specifies a connection to a global net
22502263
# @synopsis connect_global(l, name)
22512264
# See \Netter#connect_global for a description of that function.
22522265

2266+
# %DRC%
2267+
# @name soft_connect_global
2268+
# @brief Specifies a soft connection to a global net
2269+
# @synopsis soft_connect_global(l, name)
2270+
# Like \soft_connect, a soft connection is made between
2271+
# a layer and a global net (e.g. substrate). The global net
2272+
# is always the "lower" net of the soft connection.
2273+
#
2274+
# See \Netter#soft_connect_global for a more detailed
2275+
# description of that function.
2276+
22532277
# %DRC%
22542278
# @name clear_connections
22552279
# @brief Clears all connections stored so far
@@ -2320,6 +2344,8 @@ def netter
23202344
clear_connections
23212345
connect
23222346
connect_global
2347+
soft_connect
2348+
soft_connect_global
23232349
connect_implicit
23242350
connect_explicit
23252351
device_scaling

src/drc/drc/built-in-macros/_drc_netter.rb

+72
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,51 @@ def connect(a, b)
116116

117117
end
118118

119+
# %DRC%
120+
# @name soft_connect
121+
# @brief Specifies a soft connection between two layers
122+
# @synopsis soft_connect(a, b)
123+
# a and b must be polygon or text layers. After calling this function, the
124+
# Netter considers shapes from layer a and b connected in "soft mode".
125+
# Typically, b is a high-ohmic layer such as diffusion, implant for substate
126+
# material, also called the "lower" layer.
127+
#
128+
# A soft connection between shapes from layer a and b forms a directional
129+
# connection like an ideal diode: current can flow down, but now up
130+
# (not meant in the physical sense, this is a concept).
131+
#
132+
# Hence, two nets are disconnected, if they both connect to the same lower layer,
133+
# but do not have a connection between them.
134+
#
135+
# The netlist extractor will use this scheme to identify nets that are
136+
# connected only via such a high-ohmic region. Such a case is typically
137+
# bad for the functionality of a device and reported as an error.
138+
# Once, the check has been made and no error is found, soft-connected
139+
# nets are joined the same way than hard connections are made.
140+
#
141+
# Beside this, soft connections follow the same rules than hard connections
142+
# (see \connect).
143+
144+
def soft_connect(a, b)
145+
146+
@engine._context("soft_connect") do
147+
148+
a.is_a?(DRC::DRCLayer) || raise("First argument must be a layer")
149+
b.is_a?(DRC::DRCLayer) || raise("Second argument must be a layer")
150+
a.requires_texts_or_region
151+
b.requires_texts_or_region
152+
153+
register_layer(a.data)
154+
register_layer(b.data)
155+
# soft connections imply hard intra-layer connections
156+
a.data.is_a?(RBA::Region) && @l2n.connect(a.data)
157+
b.data.is_a?(RBA::Region) && @l2n.connect(b.data)
158+
@l2n.soft_connect(a.data, b.data)
159+
160+
end
161+
162+
end
163+
119164
# %DRC%
120165
# @name connect_global
121166
# @brief Connects a layer with a global net
@@ -140,6 +185,33 @@ def connect_global(l, name)
140185

141186
end
142187

188+
# %DRC%
189+
# @name soft_connect_global
190+
# @brief Soft-connects a layer with a global net
191+
# @synopsis soft-connect_global(l, name)
192+
# Connects the shapes from the given layer l to a global net with the given name
193+
# in "soft mode".
194+
#
195+
# See \connect_global for details about the concepts of global nets.
196+
# See \soft_connect for details about the concept of soft connections.
197+
# In global net soft connections, the global net (typically a substrate)
198+
# is always the "lower" layer.
199+
200+
def soft_connect_global(l, name)
201+
202+
@engine._context("soft_connect_global") do
203+
204+
l.is_a?(DRC::DRCLayer) || raise("Layer argument must be a layer")
205+
l.requires_texts_or_region
206+
207+
register_layer(l.data)
208+
l.data.is_a?(RBA::Region) && @l2n.connect(l.data)
209+
@l2n.soft_connect_global(l.data, name)
210+
211+
end
212+
213+
end
214+
143215
# %DRC%
144216
# @name extract_devices
145217
# @brief Extracts devices based on the given extractor class, name and device layer selection

0 commit comments

Comments
 (0)