Adjusted doDesign.py scripts to use Chip.doChipFloorplan().
authorJean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
Sun, 14 Mar 2021 15:37:19 +0000 (16:37 +0100)
committerJean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
Sun, 14 Mar 2021 15:37:19 +0000 (16:37 +0100)
experiments12/doDesign.py
experiments9/tsmc_c018/doDesign.py

index 497a048cc943ac32a81eb0b3567b721a10861921..8df819076dfe82e6f8332a019f3879b73451a03d 100644 (file)
@@ -10,7 +10,7 @@ from   helpers         import trace, l, u, n
 from   helpers.io      import ErrorMessage, WarningMessage
 from   helpers.overlay import UpdateSession
 import plugins
-from   Hurricane  import Breakpoint, DbU, Transformation, Box, Instance
+from   Hurricane  import Breakpoint, DbU, Point, Box, Transformation, Instance
 from   plugins.alpha.macro.macro          import Macro
 from   plugins.alpha.block.block          import Block
 from   plugins.alpha.block.configuration  import IoPin, GaugeConf
@@ -114,33 +114,33 @@ def scriptMain ( **kw ):
         memoryConf.chipSize            = ( u(2000.0), u(2000.0) )
 
         with UpdateSession():
-            sliceHeight = memoryConf.sliceHeight
-            coreAb      = Box( 0, 0, u(988.0), u(988.0) )
+            coreAb = Box( 0, 0, u(988.0), u(988.0) )
             cell.setAbutmentBox( coreAb )
-            sramName = 'subckt_500_SPBlock_512W64B8W'
-            sram     = cell.getInstance( sramName )
-            if not sram:
-                print( '[ERROR] SRAM instance "{}" not found.'.format(sramName) )
-            else:
-                Macro.wrap( sram.getMasterCell(), 'FlexLib', 3, 2 )
-                sramAb = sram.getMasterCell().getAbutmentBox()
-                Macro.place( sram
-                           , Transformation( coreAb.getXMax() - sramAb.getWidth()
-                                           , u(0.0)
-                                           , Transformation.Orientation.ID )
-                           , Instance.PlacementStatus.FIXED )
-                sramAb = sram.getAbutmentBox()
-                memoryConf.placeArea = Box( coreAb.getXMin()
-                                          , coreAb.getYMax() - sliceHeight*26
-                                          , coreAb.getXMin() + sliceHeight*25
-                                          , coreAb.getYMax()
-                                          )
-        Breakpoint.stop( 99, 'After core block placement.' )
         
         if buildChip:
             memoryToChip = CoreToChip( memoryConf )
             memoryToChip.buildChip()
             chipBuilder = Chip( memoryConf )
+            chipBuilder.doChipFloorplan()
+            with UpdateSession():
+                sramName = 'subckt_500_SPBlock_512W64B8W'
+                sram     = cell.getInstance( sramName )
+                if not sram:
+                    print( '[ERROR] SRAM instance "{}" not found.'.format(sramName) )
+                else:
+                    sliceHeight = memoryToChip.conf.sliceHeight
+                    coreAb      = cell.getAbutmentBox()
+                    sramAb      = sram.getMasterCell().getAbutmentBox()
+                    position    = Transformation( coreAb.getXMax() - sramAb.getWidth() - 2*sliceHeight
+                                                , u(0.0)
+                                                , Transformation.Orientation.ID )
+                    chipBuilder.placeMacro( 'subckt_500_SPBlock_512W64B8W', position )
+                    memoryConf.placeArea = Box( coreAb.getXMin()
+                                              , coreAb.getYMax() - sliceHeight*26
+                                              , coreAb.getXMin() + sliceHeight*25
+                                              , coreAb.getYMax()
+                                              )
+            Breakpoint.stop( 99, 'After core block placement.' )
             rvalue = chipBuilder.doPnR()
             chipBuilder.save()
             CRL.Gds.save( memoryConf.chip )
index 9321f3324c8d253deb67732dd0104e26df466f27..928a6f0c1427f7b4a6a3e1012668c3b485edab62 100644 (file)
@@ -12,7 +12,7 @@ from   helpers         import trace, l, u, n
 from   helpers.io      import ErrorMessage, WarningMessage
 from   helpers.overlay import UpdateSession
 import plugins
-from   Hurricane  import Breakpoint, DbU, Transformation, Box, Instance
+from   Hurricane  import Breakpoint, DataBase, DbU, Transformation, Box, Instance
 from   plugins.alpha.macro.macro          import Macro
 from   plugins.alpha.block.iospecs        import IoSpecs
 from   plugins.alpha.block.block          import Block
@@ -118,6 +118,7 @@ def scriptMain (**kw):
     """The mandatory function to be called by Coriolis CGT/Unicorn."""
     global af
    #helpers.setTraceLevel( 550 )
+   #Breakpoint.setStopLevel( 99 )
     rvalue     = True
     coreSize   = u(5850.0)
     chipBorder = u(2*214.0 + 10*13.0)
@@ -208,7 +209,7 @@ def scriptMain (**kw):
         ls180Conf.cfg.katana.vTracksReservedLocal = 3
         ls180Conf.cfg.katana.hTracksReservedMin = 3
         ls180Conf.cfg.katana.vTracksReservedMin = 1
-        ls180Conf.cfg.block.spareSide = u(156)
+        ls180Conf.cfg.block.spareSide = u(100)
         ls180Conf.cfg.chip.supplyRailWidth = u(35)
         ls180Conf.cfg.chip.supplyRailPitch = u(90)
         ls180Conf.editor = editor
@@ -226,35 +227,40 @@ def scriptMain (**kw):
             sliceHeight = ls180Conf.sliceHeight
             coreAb      = Box( 0, 0, coreSize, coreSize )
             rsetAbutmentBox( cell, coreAb )
+
+        ls180ToChip = CoreToChip( ls180Conf )
+        ls180ToChip.buildChip()
+        chipBuilder = Chip( ls180Conf )
+        chipBuilder.doChipFloorplan()
+
+        with UpdateSession():
             tiPath = 'subckt_38695_test_issuer.subckt_1_ti.'
             sramPaths = [ tiPath+'subckt_3695_sram4k_0.subckt_144_SPBlock_512W64B8W'
                         , tiPath+'subckt_3696_sram4k_1.subckt_144_SPBlock_512W64B8W'
                         , tiPath+'subckt_3697_sram4k_2.subckt_144_SPBlock_512W64B8W'
                         , tiPath+'subckt_3698_sram4k_3.subckt_144_SPBlock_512W64B8W'
                         ]
-            sramAb    = None
+            sram = DataBase.getDB().getCell( 'SPBlock_512W64B8W' )
+            if not sram:
+                raise ErrorMessage( 1, 'SRAM instance "{}" not found.'.format(sramPaths[i]) )
+            sramAb = sram.getAbutmentBox()
+            coreAb = cell.getAbutmentBox()
+            sliceHeight = chipBuilder.conf.sliceHeight
             for i in range(4):
                 sram = rgetInstance( cell, sramPaths[i] )
-                if not sram:
-                    raise ErrorMessage( 1, 'SRAM instance "{}" not found.'.format(sramPaths[i]) )
-                if i == 0:
-                    Macro.wrap( sram.getMasterCell(), 'FlexLib', 3, 2 )
-                sramAb = sram.getMasterCell().getAbutmentBox()
-                Macro.place( sram
-                           , Transformation( coreAb.getXMin() + sramAb.getWidth ()*i
-                                           , coreAb.getYMax() - sramAb.getHeight()
-                                           , Transformation.Orientation.ID )
-                           , Instance.PlacementStatus.FIXED )
+                chipBuilder.placeMacro \
+                    ( sramPaths[i]
+                    , Transformation( coreAb.getXMin() + (sramAb.getWidth () + 2*sliceHeight)*i
+                                    , coreAb.getYMax() -  sramAb.getHeight() - 2*sliceHeight
+                                    , Transformation.Orientation.ID )
+                    )
             ls180Conf.placeArea = Box( coreAb.getXMin()
                                      , coreAb.getYMin()
                                      , coreAb.getXMax()
-                                     , coreAb.getYMax() - sramAb.getHeight()
+                                     , coreAb.getYMax() - sramAb.getHeight() - 2*sliceHeight
                                      )
         Breakpoint.stop( 99, 'After core placement.' )
 
-        ls180ToChip = CoreToChip( ls180Conf )
-        ls180ToChip.buildChip()
-        chipBuilder = Chip( ls180Conf )
         rvalue = chipBuilder.doPnR()
         chipBuilder.save()
         CRL.Gds.save( ls180Conf.chip )