From 89c281f87a0e8f882b6ce42a9767c4b84c825275 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 12 Mar 2024 23:24:54 +0100 Subject: [PATCH] Integration API into LVS+DRC --- samples/lvs/ringo.gds | Bin 10050 -> 10046 bytes src/db/db/gsiDeclDbLayoutToNetlist.cc | 44 ++++++++++++- src/drc/drc/built-in-macros/_drc_engine.rb | 26 ++++++++ src/drc/drc/built-in-macros/_drc_netter.rb | 72 +++++++++++++++++++++ 4 files changed, 141 insertions(+), 1 deletion(-) diff --git a/samples/lvs/ringo.gds b/samples/lvs/ringo.gds index 3d79ce740a11be70ff71dbb038fd820ea8283281..c29e3d5a61b53c7d4a6863b6ba2f472997bd8af9 100644 GIT binary patch delta 346 zcmX@)x6eWhbBEOULTw2zFJhp4_}daULrGfX6f{ delta 361 zcmdnzcgRnPfsKKQDS|rQ?q`FiquVZP1xr9UxE4rk(>d{3%)@!pRzi02JGpeMhMNclv+Ht6viXI(`uH#~um}P%I|G9ZD^3q@Zs6$TBvDHQyC` decl_dbLayoutToNetlist ("db", "LayoutToNetlist", "\n" "This variant has been introduced in version 0.27.\n" ) + + gsi::method ("soft_connect", (void (db::LayoutToNetlist::*) (const db::Region &, const db::Region &)) &db::LayoutToNetlist::soft_connect, gsi::arg ("a"), gsi::arg ("b"), + "@brief Defines an inter-layer connection for the given layers in soft mode.\n" + "Connects two layers through a soft connection.\n" + "Soft connections cannot make connections between two different nets.\n" + "These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion).\n" + "\n" + "Soft connections have been introduced in version 0.29.\n" + ) + + gsi::method ("soft_connect", (void (db::LayoutToNetlist::*) (const db::Region &, const db::Texts &)) &db::LayoutToNetlist::soft_connect, gsi::arg ("a"), gsi::arg ("b"), + "@brief Defines an inter-layer connection for the given layers in soft mode.\n" + "Connects two layers through a soft connection.\n" + "Soft connections cannot make connections between two different nets.\n" + "These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion).\n" + "As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.\n" + "\n" + "Soft connections have been introduced in version 0.29.\n" + ) + + gsi::method ("soft_connect", (void (db::LayoutToNetlist::*) (const db::Texts &, const db::Region &)) &db::LayoutToNetlist::soft_connect, gsi::arg ("a"), gsi::arg ("b"), + "@brief Defines an inter-layer connection for the given layers in soft mode.\n" + "Connects two layers through a soft connection.\n" + "Soft connections cannot make connections between two different nets.\n" + "These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion).\n" + "As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.\n" + "\n" + "Soft connections have been introduced in version 0.29.\n" + ) + 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"), "@brief Defines a connection of the given layer with a global net.\n" "This method returns the ID of the global net. Use \\global_net_name to get " @@ -441,10 +467,26 @@ Class decl_dbLayoutToNetlist ("db", "LayoutToNetlist", 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"), "@brief Defines a connection of the given text layer with a global net.\n" "This method returns the ID of the global net. Use \\global_net_name to get " - "the name back from the ID." + "the name back from the ID.\n" "\n" "This variant has been introduced in version 0.27.\n" ) + + 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"), + "@brief Defines a connection of the given layer with a global net in soft mode.\n" + "This method returns the ID of the global net. Use \\global_net_name to get " + "the name back from the ID.\n" + "Soft connections are directional, where the global net is the 'lower' layer (typically high-ohmic substrate or diffusion).\n" + "\n" + "Soft connections have been introduced in version 0.29.\n" + ) + + 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"), + "@brief Defines a connection of the given text layer with a global net in soft mode.\n" + "This method returns the ID of the global net. Use \\global_net_name to get " + "the name back from the ID.\n" + "Soft connections are directional, where the global net is the 'lower' layer (typically high-ohmic substrate or diffusion).\n" + "\n" + "Soft connections have been introduced in version 0.29.\n" + ) + gsi::method ("global_net_name", &db::LayoutToNetlist::global_net_name, gsi::arg ("global_net_id"), "@brief Gets the global net name for the given global net ID." ) + diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb index 14eb0c842..68a64d524 100644 --- a/src/drc/drc/built-in-macros/_drc_engine.rb +++ b/src/drc/drc/built-in-macros/_drc_engine.rb @@ -2244,12 +2244,36 @@ CODE # @synopsis connect(a, b) # See \Netter#connect for a description of that function. + # %DRC% + # @name soft_connect + # @brief Specifies a soft connection between two layers + # @synopsis soft_connect(a, b) + # A "soft connection" is made between two layers and + # is a directional connection (like an ideal diode). + # Soft connections allow detecting if nets are connected + # via a high-ohmic substrate or diffusion layer (the + # "lower" layer). + # "b" is the "lower" and "a" the upper layer. + # + # See \Netter#connect for a more detailed description of that function. + # %DRC% # @name connect_global # @brief Specifies a connection to a global net # @synopsis connect_global(l, name) # See \Netter#connect_global for a description of that function. + # %DRC% + # @name soft_connect_global + # @brief Specifies a soft connection to a global net + # @synopsis soft_connect_global(l, name) + # Like \soft_connect, a soft connection is made between + # a layer and a global net (e.g. substrate). The global net + # is always the "lower" net of the soft connection. + # + # See \Netter#soft_connect_global for a more detailed + # description of that function. + # %DRC% # @name clear_connections # @brief Clears all connections stored so far @@ -2320,6 +2344,8 @@ CODE clear_connections connect connect_global + soft_connect + soft_connect_global connect_implicit connect_explicit device_scaling diff --git a/src/drc/drc/built-in-macros/_drc_netter.rb b/src/drc/drc/built-in-macros/_drc_netter.rb index 8c970483c..0f977103d 100644 --- a/src/drc/drc/built-in-macros/_drc_netter.rb +++ b/src/drc/drc/built-in-macros/_drc_netter.rb @@ -116,6 +116,51 @@ module DRC end + # %DRC% + # @name soft_connect + # @brief Specifies a soft connection between two layers + # @synopsis soft_connect(a, b) + # a and b must be polygon or text layers. After calling this function, the + # Netter considers shapes from layer a and b connected in "soft mode". + # Typically, b is a high-ohmic layer such as diffusion, implant for substate + # material, also called the "lower" layer. + # + # A soft connection between shapes from layer a and b forms a directional + # connection like an ideal diode: current can flow down, but now up + # (not meant in the physical sense, this is a concept). + # + # Hence, two nets are disconnected, if they both connect to the same lower layer, + # but do not have a connection between them. + # + # The netlist extractor will use this scheme to identify nets that are + # connected only via such a high-ohmic region. Such a case is typically + # bad for the functionality of a device and reported as an error. + # Once, the check has been made and no error is found, soft-connected + # nets are joined the same way than hard connections are made. + # + # Beside this, soft connections follow the same rules than hard connections + # (see \connect). + + def soft_connect(a, b) + + @engine._context("soft_connect") do + + a.is_a?(DRC::DRCLayer) || raise("First argument must be a layer") + b.is_a?(DRC::DRCLayer) || raise("Second argument must be a layer") + a.requires_texts_or_region + b.requires_texts_or_region + + register_layer(a.data) + register_layer(b.data) + # soft connections imply hard intra-layer connections + a.data.is_a?(RBA::Region) && @l2n.connect(a.data) + b.data.is_a?(RBA::Region) && @l2n.connect(b.data) + @l2n.soft_connect(a.data, b.data) + + end + + end + # %DRC% # @name connect_global # @brief Connects a layer with a global net @@ -140,6 +185,33 @@ module DRC end + # %DRC% + # @name soft_connect_global + # @brief Soft-connects a layer with a global net + # @synopsis soft-connect_global(l, name) + # Connects the shapes from the given layer l to a global net with the given name + # in "soft mode". + # + # See \connect_global for details about the concepts of global nets. + # See \soft_connect for details about the concept of soft connections. + # In global net soft connections, the global net (typically a substrate) + # is always the "lower" layer. + + def soft_connect_global(l, name) + + @engine._context("soft_connect_global") do + + l.is_a?(DRC::DRCLayer) || raise("Layer argument must be a layer") + l.requires_texts_or_region + + register_layer(l.data) + l.data.is_a?(RBA::Region) && @l2n.connect(l.data) + @l2n.soft_connect_global(l.data, name) + + end + + end + # %DRC% # @name extract_devices # @brief Extracts devices based on the given extractor class, name and device layer selection