from helpers.io import ErrorMessage, WarningMessage
from helpers.overlay import UpdateSession
import plugins
-from Hurricane import Breakpoint, DataBase, DbU, Transformation, Point, Box, \
- Cell, 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
, ioSpec[5].format(bit)
, ioSpec[6].format(bit) ))
else:
- raise ErrorMessage( 1, [ 'doIoPinVector(): Argument "ioSpec" must have between 5 and 7 fields ({})'.format(len(ioSpec))
+ raise ErrorMessage( 1, [ 'doIoPinVector(): Argument "ioSpec" ' \
+ 'must have between 5 and 7 ' \
+ 'fields ({})'.format(len(ioSpec))
, '(ioSpec={})'.format(ioSpec)
] )
return v
if isinstance(path,str):
path = path.split( '.' )
elif not isinstance(path,list):
- raise ErrorMessage( 1, 'rgetInstance(): "path" argument is neither a string or a list ({})"' \
+ raise ErrorMessage( 1, 'rgetInstance(): "path" argument is neither ' \
+ 'a string or a list ({})"' \
.format(path) )
instance = cell.getInstance( path[0] )
if instance is None:
- raise ErrorMessage( 1, 'rgetInstance(): no instance "{}" in cell "{}"' \
+ raise ErrorMessage( 1, 'rgetInstance(): no instance "{}" ' \
+ 'in cell "{}"' \
.format(path[0],cell.getName()) )
if len(path) == 1:
return instance
cell, editor = plugins.kwParseMain( **kw )
cell = af.getCell( 'ls180', CRL.Catalog.State.Logical )
if cell is None:
- print( ErrorMessage( 2, 'doDesign.scriptMain(): Unable to load cell "{}".' \
+ print( ErrorMessage( 2, 'doDesign.scriptMain(): Unable to ' \
+ ' load cell "{}".' \
.format('ls180') ))
sys.exit(1)
if editor: editor.setCell( cell )
chipBuilder.doChipFloorplan()
with UpdateSession():
- # Thoses ids are dependent on Yosys. They need to be adjusted whenever
- # the design changes.
+ # Thoses ids are dependent on Yosys. They need to be adjusted
+ # whenever the design changes.
#tiId = 38695
tiId = 38381
#sramId = 3695
, tiPath+'subckt_{}_sram4k_3.subckt_144_SPBlock_512W64B8W'.format(sramId+3)
]
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
- originX = coreAb.getXMin() + 2*chipBuilder.conf.sliceStep
- for i in range(4):
- sram = rgetInstance( cell, sramPaths[i] )
- chipBuilder.placeMacro \
- ( sramPaths[i]
- , Transformation( originX
- , coreAb.getYMax() - sramAb.getHeight() - 2*sliceHeight
- , Transformation.Orientation.ID )
- )
- originX += sramAb.getWidth () + 3*sliceHeight
+ if sram:
+ 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] )
+ y = coreAb.getYMax() - sramAb.getHeight() - 2*sliceHeight
+ chipBuilder.placeMacro \
+ ( sramPaths[i]
+ , Transformation( originX
+ , y
+ , Transformation.Orientation.ID )
+ )
+ originX += sramAb.getWidth () + 3*sliceHeight
+ else:
+ print (ErrorMessage( 1, 'SRAM instance not found.'))
pll = addPllPlaceHolder( cell )
pllAb = pll.getAbutmentBox()
- pll.setTransformation( Transformation( coreAb.getXMax() - pllAb.getWidth()
- , coreAb.getYMax() - pllAb.getHeight()
- , Transformation.Orientation.ID ) )
+ t = Transformation( coreAb.getXMax() - pllAb.getWidth()
+ , coreAb.getYMax() - pllAb.getHeight()
+ , Transformation.Orientation.ID )
+ pll.setTransformation( t )
pll.setPlacementStatus( Instance.PlacementStatus.FIXED )
#ls180Conf.placeArea = Box( coreAb.getXMin()
# , coreAb.getYMin()
- # , coreAb.getXMax() - chipBuilder.conf.sliceStep
- # , coreAb.getYMax() - sramAb.getHeight() - 2*sliceHeight
+ # , 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+])$'