use --recursive on git submodule not --remote - one does a "latest update"
[soclayout.git] / experiments12 / doDesign.py
index 5c525c463bb0bdf85ce9f7a4b1d84e14af0b0e22..c7eea1d7aff5eea63942a1d586c216dd866b83d9 100644 (file)
@@ -10,7 +10,9 @@ 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, \
+                         DataBase
+from   plugins.alpha.macro.macro          import Macro
 from   plugins.alpha.block.block          import Block
 from   plugins.alpha.block.configuration  import IoPin, GaugeConf
 from   plugins.alpha.core2chip.libresocio import CoreToChip
@@ -51,7 +53,7 @@ def scriptMain ( **kw ):
     global af
     rvalue = True
     try:
-       #helpers.setTraceLevel( 540 )
+        #helpers.setTraceLevel( 550 )
         Breakpoint.setStopLevel( 100 )
         buildChip = True
         cell, editor = plugins.kwParseMain( **kw )
@@ -99,9 +101,11 @@ def scriptMain ( **kw ):
        #memoryConf.cfg.chip.padCoreSide            = 'North'
        #memoryConf.cfg.chip.use45corners           = False
         memoryConf.cfg.chip.useAbstractPads        = True
+        memoryConf.cfg.chip.supplyRailWidth        = u(35)
+        memoryConf.cfg.chip.supplyRailPitch        = u(90)
         memoryConf.editor              = editor
-        memoryConf.useSpares           = False
-        memoryConf.useClockTree        = False
+        memoryConf.useSpares           = True
+        memoryConf.useClockTree        = True
         memoryConf.useHFNS             = False
         memoryConf.bColumns            = 2
         memoryConf.bRows               = 3
@@ -111,31 +115,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:
-                sramAb = sram.getMasterCell().getAbutmentBox()
-                sram.setTransformation( Transformation( coreAb.getXMax() - sramAb.getWidth()
-                                                      , u(0.0)
-                                                      , Transformation.Orientation.ID ) )
-                sram.setPlacementStatus( Instance.PlacementStatus.FIXED )
-                sramAb = sram.getAbutmentBox()
-                memoryConf.placeArea = Box( coreAb.getXMin()
-                                          , coreAb.getYMax() - sliceHeight*10
-                                          , coreAb.getXMax()
-                                          , coreAb.getYMax()
-                                          )
-        Breakpoint.stop( 99, 'After core block placement.' )
         
         if buildChip:
-            arlet6502ToChip = CoreToChip( memoryConf )
-            arlet6502ToChip.buildChip()
+            memoryToChip = CoreToChip( memoryConf )
+            memoryToChip.buildChip()
             chipBuilder = Chip( memoryConf )
+            chipBuilder.doChipFloorplan()
+            with UpdateSession():
+                sramName = 'spblock_512w64b8w'
+                sram     = DataBase.getDB().getCell( 'spblock_512w64b8w' )
+                if not sram:
+                    print( '[ERROR] SRAM cell "{}" not found.'.format(sramName) )
+                else:
+                    sliceHeight = memoryToChip.conf.sliceHeight
+                    coreAb      = cell.getAbutmentBox()
+                    sramAb      = sram.getAbutmentBox()
+                    position    = Transformation( coreAb.getXMax() - sramAb.getWidth() - 2*sliceHeight
+                                                , u(0.0)
+                                                , Transformation.Orientation.ID )
+                    chipBuilder.placeMacro( '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 )