:param height: module height,
:param submodules: submodules (Module objects)
or tuples of (submodule, x, y), where (x, y) is a submodule's
- placement point (in lambdas, defaults to (0.0, 0.0)),
+ placement point in lambdas,
:param pin_width: default pin width,
:param pin_height: default pin height,
:param pin_suffix: default pin suffix,
if submodules is not None:
for submodule in submodules:
self._submodules.append(
- (submodule, 0.0, 0.0) if isinstance(submodule, Module)
+ (submodule, None, None) if isinstance(submodule, Module)
else submodule
)
def place_submodules(self):
"""
Places the submodules in the current module using their initial
- placement points.
+ placement points, if set.
"""
for submodule, x, y in self._submodules:
- self.place_submodule(submodule, x, y)
+ if x is not None and y is not None:
+ self.place_submodule(submodule, x, y)
+ else:
+ raise Warning((
+ '{}: cannot place {}, because its '
+ 'initial placement point is not set.'
+ ).format(self.name, submodule.name))
def save(self):
""" Saves cell. """