try adding short track manually (doesnt work)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 27 Feb 2020 14:25:53 +0000 (14:25 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 27 Feb 2020 14:25:53 +0000 (14:25 +0000)
experiments5/doAlu16.py

index d7af2f6b28a06756738d35875e3dc5e37105aaf3..86621d6c7e78ec95b16bf488af8bf82107fc8d33 100755 (executable)
@@ -15,6 +15,8 @@ from   Hurricane import Breakpoint
 from   Hurricane import Box
 from   Hurricane import Transformation
 from   Hurricane import Instance
+from   Hurricane import Contact
+from   Hurricane import Vertical
 from   Hurricane import Pin
 import Viewer
 import CRL
@@ -30,6 +32,42 @@ import symbolic.cmos
 
 af = CRL.AllianceFramework.get()
 
+
+def toDbU ( l ): return DbU.fromLambda(l)
+
+def createVertical ( contacts, x, layer, width=None):
+    def yincrease ( lhs, rhs ): return int(lhs.getY() - rhs.getY())
+
+    contacts.sort( yincrease )
+
+    if width is None: width = l(2.0)
+
+    for i in range(1,len(contacts)):
+        print "create vert", contacts[i-1], contacts[i], layer, x, width
+        Vertical.create( contacts[i-1], contacts[i], layer, x, width )
+
+
+def createHorizontal ( contactPaths, y, layer, width=None):
+    def xincrease ( lhs, rhs ): return int(lhs.getX() - rhs.getX())
+
+    contacts = contactPaths
+
+    if width is None: width = toDbU(2.0)
+
+    contacts.sort( xincrease )
+
+    for i in range(1,len(contacts)):
+        Horizontal.create( contacts[i-1], contacts[i], layer, y, width )
+
+def build_downtrace(net, layer, x, y, y1):
+
+    contacts = \
+      [ Contact.create( net, layer, l(x), l(y), l(2.0), l(2.0) )
+      , Contact.create( net, layer, l(x), l(y1), l(2.0), l(2.0) )
+      ]
+
+    createVertical( contacts, l(x), layer )
+
 #print "af", dir(af)
 #sys.exit(0)
 
@@ -51,7 +89,7 @@ Cfg.getParamBool      ( 'misc.verboseLevel2'          ).setBool      ( True    )
 #Cfg.getParamInt       ( 'misc.minTraceLevel'          ).setInt       ( 159     )
 #Cfg.getParamInt       ( 'misc.maxTraceLevel'          ).setInt       ( 160     )
 Cfg.getParamEnumerate ( 'etesian.effort'              ).setInt       ( 2       )
-Cfg.getParamPercentage( 'etesian.spaceMargin'         ).setPercentage( 9.0    )
+Cfg.getParamPercentage( 'etesian.spaceMargin'         ).setPercentage( 20.0    )
 Cfg.getParamPercentage( 'etesian.aspectRatio'         ).setPercentage( 100.0   )
 Cfg.getParamBool      ( 'etesian.uniformDensity'      ).setBool      ( True    )
 Cfg.getParamInt       ( 'anabatic.edgeLenght'         ).setInt       ( 24      )
@@ -103,7 +141,7 @@ def add ( **kw ):
   spaceMargin = (Cfg.getParamPercentage('etesian.spaceMargin').asPercentage()+5) / 100.0
   aspectRatio =  Cfg.getParamPercentage('etesian.aspectRatio').asPercentage()    / 100.0
   clocktree.ClockTree.computeAbutmentBox( cell, spaceMargin, aspectRatio, cellGauge )
-  ab = cell.getAbutmentBox()
+  ab2 = cell.getAbutmentBox()
   print "calc box", ab, ab.getHeight(), ab.getWidth()
 
   #height = ab.getHeight()
@@ -122,12 +160,17 @@ def add ( **kw ):
               , l( 2.0 )            , l( 2.0 )  # Size.
               )
     if True:
-        Pin.create( cell.getNet('b(%d)' % i)
+        net = cell.getNet('b(%d)' % i)
+        x = 20.0*i + 18.0
+        y = height
+        #build_downtrace(net, metal3, x, y, y-5)
+        #continue
+        Pin.create( net
               , 'b(%d).0' % i
               , Pin.Direction.NORTH
-              , Pin.PlacementStatus.FIXED
+              , Pin.PlacementStatus.UNPLACED
               , metal3
-              , l( 20.0*i + 19.0 ), l( height-25 )   # Position.
+              , l( x ), l( y - 21 )   # Position.
               , l( 2.0 )            , l( 2.0 )  # Size.
               )
     if True:
@@ -153,25 +196,26 @@ def add ( **kw ):
             )
   UpdateSession.close()
 
-  if editor: editor.setCell( cell )
-
-  etesian = Etesian.EtesianEngine.create(cell)
-  etesian.place()
-
-  katana = Katana.KatanaEngine.create(cell)
-  katana.digitalInit          ()
-  #katana.runNegociatePreRouted()
-  print dir(katana)
-  katana.runGlobalRouter      (0)
-  katana.loadGlobalRouting    ( Anabatic.EngineLoadGrByNet )
-  katana.layerAssign          ( Anabatic.EngineNoNetLayerAssign )
-  katana.runNegociate         ( Katana.Flags.NoFlags )
-  katana.finalizeLayout       ()
-  print dir(katana)
-  success = katana.getSuccessState()
-  katana.destroy()
-
- #af.saveCell( cell, CRL.Catalog.State.Views )
+  if True:
+        if editor: editor.setCell( cell )
+
+        etesian = Etesian.EtesianEngine.create(cell)
+        etesian.place()
+
+        katana = Katana.KatanaEngine.create(cell)
+        katana.digitalInit          ()
+        #katana.runNegociatePreRouted()
+        print dir(katana)
+        katana.runGlobalRouter      (0)
+        katana.loadGlobalRouting    ( Anabatic.EngineLoadGrByNet )
+        katana.layerAssign          ( Anabatic.EngineNoNetLayerAssign )
+        katana.runNegociate         ( Katana.Flags.NoFlags )
+        katana.finalizeLayout       ()
+        print dir(katana)
+        success = katana.getSuccessState()
+        katana.destroy()
+
+  #af.saveCell( cell, CRL.Catalog.State.Views )
   plugins.RSavePlugin.ScriptMain( **kw )
 
 ###################
@@ -382,3 +426,4 @@ if __name__ == '__main__':
 
   sys.exit( shellSuccess )
 
+