import CRL
import Cfg
from Hurricane import Box
+from Hurricane import Transformation
from coriolis2.settings import af
from utils import Module, SessionManager, Config
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(
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.
: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
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 = []
else submodule
)
+
@property
def name(self):
return self.cell.getName()
# 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)