From 75e03eb25f6d6968b04426a210c9dbab3d71d054 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 6 Apr 2020 15:16:28 +0000 Subject: [PATCH] segfault in katana routing --- experiments7/doAlu16.py | 15 +++++++++------ experiments7/utils.py | 9 +++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/experiments7/doAlu16.py b/experiments7/doAlu16.py index 435c619..954a311 100755 --- a/experiments7/doAlu16.py +++ b/experiments7/doAlu16.py @@ -6,6 +6,7 @@ import sys import CRL import Cfg from Hurricane import Box +from Hurricane import Transformation from coriolis2.settings import af from utils import Module, SessionManager, Config @@ -134,32 +135,34 @@ def ScriptMain(editor=None, **kwargs): add = AddSub( 'add', editor, north_pins=[ - {'net': 'a({})', 'x': 10.0, 'delta': 20.0, 'repeat': BIT_WIDTH}, - {'net': 'b({})', 'x': 20.0, 'delta': 20.0, 'repeat': BIT_WIDTH}, + {'net': 'a({})', 'x': 10.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, + {'net': 'b({})', 'x': 15.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, + {'net': 'o({})', 'x': 180.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, ], south_pins=[ - {'net': 'o({})', 'x': 100.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, ], pads={ 'b({})'.format(BIT_WIDTH-1): ( 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4', ), }, + orientation=Transformation.Orientation.ID, ) sub = AddSub( 'sub', editor, north_pins=[ - {'net': 'a({})', 'x': 10.0, 'delta': 20.0, 'repeat': BIT_WIDTH}, - {'net': 'b({})', 'x': 20.0, 'delta': 20.0, 'repeat': BIT_WIDTH}, + {'net': 'a({})', 'x': 180.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, + {'net': 'b({})', 'x': 185.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, + {'net': 'o({})', 'x': 10.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, ], south_pins=[ - {'net': 'o({})', 'x': 100.0, 'delta': 10.0, 'repeat': BIT_WIDTH}, ], pads={ 'b({})'.format(BIT_WIDTH-1): ( 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4', ), }, + orientation=Transformation.Orientation.XR, ) alu16 = ALU16( diff --git a/experiments7/utils.py b/experiments7/utils.py index 5e5738f..04f9cde 100644 --- a/experiments7/utils.py +++ b/experiments7/utils.py @@ -34,7 +34,8 @@ class Module(object): def __init__(self, cell, editor, width=None, height=None, submodules=None, pin_width=2.0, pin_height=2.0, pin_suffix='.0', pin_layer=None, north_pins=None, east_pins=None, - south_pins=None, west_pins=None, pads=None, **kwargs): + south_pins=None, west_pins=None, pads=None, + orientation=None, **kwargs): """ Creates a module. @@ -55,6 +56,7 @@ class Module(object): :param south_pins: ditto (for the south side), :param west_pins: ditto (for the west side), :param pads: dictionary of {net: list of layers} for creating pads, + :param orientation: when placed, should be orientated/mirrored etc. :param kwargs: extra parameters to be implemented in derived classes. """ self.editor = editor @@ -82,6 +84,8 @@ class Module(object): self.south_pins = south_pins or [] self.west_pins = west_pins or [] + self.orientation = orientation or Transformation.Orientation.ID + self.pads = pads or {} self._submodules = [] @@ -92,6 +96,7 @@ class Module(object): else submodule ) + @property def name(self): return self.cell.getName() @@ -362,7 +367,7 @@ class Module(object): # place submodule instance.setTransformation(Transformation( - self.to_dbu(x), self.to_dbu(y), Transformation.Orientation.ID + self.to_dbu(x), self.to_dbu(y), submodule.orientation, )) instance.setPlacementStatus(Instance.PlacementStatus.FIXED) -- 2.30.2