Add a placeholder for the PLL in the doDesign.py for ls180.
authorJean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
Mon, 29 Mar 2021 18:53:40 +0000 (20:53 +0200)
committerJean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
Mon, 29 Mar 2021 18:53:40 +0000 (20:53 +0200)
experiments9/tsmc_c018/doDesign.py

index bb6cd279c3ee2d503caab090111525c4c5862617..dbd4ddefe931ee938ec8c4e96d9c8d49e4cdfb50 100644 (file)
@@ -2,6 +2,7 @@
 from   __future__ import print_function
 
 import os
+import re
 import json
 import sys
 import traceback
@@ -12,7 +13,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, DataBase, DbU, Transformation, Box, Instance
+from   Hurricane  import Breakpoint, DataBase, DbU, Transformation, Point, Box, \
+                         Cell, Instance
+from   plugins.alpha.block.matrix         import RegisterMatrix
 from   plugins.alpha.macro.macro          import Macro
 from   plugins.alpha.block.iospecs        import IoSpecs
 from   plugins.alpha.block.block          import Block
@@ -113,15 +116,22 @@ def rsetAbutmentBox ( cell, ab ):
         masterCell = occurrence.getEntity().getMasterCell()
         masterCell.setAbutmentBox( ab )
 
+def addPllPlaceHolder ( cell ):
+    pllPlaceHolder = Cell.create( af.getLibrary(0), 'pllplaceholder' )
+    pllPlaceHolder.setAbutmentBox( Box( u(0.0), u(0.0), u(200.0), u(200.0) ))
+    pllPlaceHolder.setTerminalNetlist( True )
+    instance = Instance.create( cell, 'pllPlaceholder', pllPlaceHolder )
+    return instance
+
 
 def scriptMain (**kw):
     """The mandatory function to be called by Coriolis CGT/Unicorn."""
     global af
    #helpers.setTraceLevel( 550 )
-   #Breakpoint.setStopLevel( 99 )
+   #Breakpoint.setStopLevel( 100 )
     rvalue     = True
    #coreSize   = u(37*90.0)
-    coreSize   = u(61*90.0)
+    coreSize   = u(59*90.0)
     chipBorder = u(2*214.0 + 10*13.0)
     ioSpecs    = IoSpecs()
    #pinmuxFile = './non_generated/litex_pinpads.json'
@@ -210,7 +220,7 @@ def scriptMain (**kw):
         ls180Conf.cfg.katana.vTracksReservedLocal = 3
         ls180Conf.cfg.katana.hTracksReservedMin = 3
         ls180Conf.cfg.katana.vTracksReservedMin = 1
-        ls180Conf.cfg.block.spareSide = u(9*13)
+        ls180Conf.cfg.block.spareSide = u(7*13)
         ls180Conf.cfg.chip.supplyRailWidth = u(35)
         ls180Conf.cfg.chip.supplyRailPitch = u(90)
         ls180Conf.editor = editor
@@ -253,19 +263,38 @@ def scriptMain (**kw):
             sramAb = sram.getAbutmentBox()
             coreAb = cell.getAbutmentBox()
             sliceHeight = chipBuilder.conf.sliceHeight
+            originX = coreAb.getXMin() + 2*chipBuilder.conf.sliceStep
             for i in range(4):
                 sram = rgetInstance( cell, sramPaths[i] )
                 chipBuilder.placeMacro \
                     ( sramPaths[i]
-                    , Transformation( coreAb.getXMin() + (sramAb.getWidth () + 2*sliceHeight)*i
-                                    , coreAb.getYMax() -  sramAb.getHeight() - 2*sliceHeight
+                    , Transformation( originX
+                                    , coreAb.getYMax() - sramAb.getHeight() - 2*sliceHeight
                                     , Transformation.Orientation.ID )
                     )
-            ls180Conf.placeArea = Box( coreAb.getXMin()
-                                     , coreAb.getYMin()
-                                     , coreAb.getXMax() - chipBuilder.conf.sliceStep
-                                     , coreAb.getYMax() - sramAb.getHeight() - 2*sliceHeight
-                                     )
+                originX += sramAb.getWidth () + 3*sliceHeight
+            pll = addPllPlaceHolder( cell )
+            pllAb = pll.getAbutmentBox()
+            pll.setTransformation( Transformation( coreAb.getXMax() - pllAb.getWidth()
+                                                 , coreAb.getYMax() - pllAb.getHeight()
+                                                 , Transformation.Orientation.ID ) )
+            pll.setPlacementStatus( Instance.PlacementStatus.FIXED )
+           #ls180Conf.placeArea = Box( coreAb.getXMin()
+           #                         , coreAb.getYMin()
+           #                         , coreAb.getXMax() - chipBuilder.conf.sliceStep
+           #                         , coreAb.getYMax() - sramAb.getHeight() - 2*sliceHeight
+           #                         )
+           #memPatterns = [ r'^mem_(?P<i>\d+)__(?P<j>[\d+])$'
+           #              , r'^mem_1_(?P<i>\d+)__(?P<j>[\d+])$' 
+           #              , r'^mem_2_(?P<i>\d+)__(?P<j>[\d+])$' 
+           #              , r'^mem_3_(?P<i>\d+)__(?P<j>[\d+])$' 
+           #              ]
+           #originX += 2*sliceHeight
+           #originY  = coreAb.getYMax()
+           #for i in range(len(memPatterns)):
+           #    mem = RegisterMatrix( ls180Conf, cell, memPatterns[i] )
+           #    originY -= mem.getHeight()
+           #    mem.place( Point(originX,originY) )
         Breakpoint.stop( 99, 'After core placement.' )
 
         rvalue = chipBuilder.doPnR()