From: Jock Tanner Date: Mon, 6 Apr 2020 04:50:57 +0000 (+0000) Subject: Distinguish unset submodule placement. X-Git-Tag: partial-core-ls180-gdsii~149 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf7e643e41eb8dfdb3d0b2f73e7e9cfab9b211c9;p=soclayout.git Distinguish unset submodule placement. --- diff --git a/experiments7/utils.py b/experiments7/utils.py index 3ec6155..62ba528 100644 --- a/experiments7/utils.py +++ b/experiments7/utils.py @@ -44,7 +44,7 @@ class Module(object): :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, @@ -88,7 +88,7 @@ class Module(object): 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 ) @@ -353,10 +353,16 @@ class Module(object): 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. """