New CRL/helpers.technology.createVia() helpers method.

This commit is contained in:
Jean-Paul Chaput 2020-11-25 21:52:05 +01:00
parent e08bc9a407
commit 2a900c4abb
1 changed files with 23 additions and 1 deletions

View File

@ -18,7 +18,7 @@ Some helpers to create or load a technology and it's libraries.
""" """
from __future__ import print_function from __future__ import print_function
from Hurricane import DataBase, Library, BasicLayer, Layer from Hurricane import DataBase, Library, BasicLayer, Layer, ViaLayer
__all__ = [ 'safeGetLibrary', 'createBL', 'setEnclosures' ] __all__ = [ 'safeGetLibrary', 'createBL', 'setEnclosures' ]
@ -67,6 +67,28 @@ def createBL ( tech, layerName, material, size=None, spacing=None, gds2Layer=Non
return layer return layer
def createVia ( tech, viaName, botName, cutName, topName, size=None ):
"""
Create a new ViaLayer. Parameters ``tech``, ``viaName``, ``botName``,
``cutName`` and ``topName`` are mandatory.
:param tech: The technology the basic layer will be part of.
:param viaName: The name of the newly defined VIA layer.
:param botName: The name of the *bottom* metal layer.
:param cutName: The name of the *cut* (aka, via hole) layer.
:param topName: The name of the *top* metal layer.
:param size: The minimal side size of the square *cut* layer.
"""
layer = ViaLayer.create( tech
, viaName
, tech.getLayer(botName)
, tech.getLayer(cutName)
, tech.getLayer(topName) )
if size is not None:
layer.setMinimalSize( size )
return layer
def setEnclosures ( layer, subLayer, enclosures ): def setEnclosures ( layer, subLayer, enclosures ):
""" """
Set horizontal & vertical enclosure for a given ``subLayer`` in a Set horizontal & vertical enclosure for a given ``subLayer`` in a