From 8e53a1bc369102a3b28103851fbe56c0160b06a7 Mon Sep 17 00:00:00 2001 From: Sophie Belloeil Date: Mon, 6 Sep 2010 09:12:24 +0000 Subject: [PATCH] No more Error when no vdd/vss in a cell, back to a warning Be careful when using iter(...).next() : causes a stopException if no element, the exception has to be catched if only un warning is wanted --- stratus1/src/stratus/st_model.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/stratus1/src/stratus/st_model.py b/stratus1/src/stratus/st_model.py index b69c844d..c96204eb 100644 --- a/stratus1/src/stratus/st_model.py +++ b/stratus1/src/stratus/st_model.py @@ -82,6 +82,9 @@ class Model : def __init__ ( self, nom, param = {}, hurCell = None, hurricane_plug = True ) : global FRAMEWORK, CELLS + # Look up the editor + if globals().has_key ( "__editor" ) : setEditor ( __editor ) + self._name = nom self._param = param @@ -151,12 +154,18 @@ class Model : from st_net import VddInFromHur from st_net import VssInFromHur - netVdd = iter(hurCell.getPowerNets()).next() - netVss = iter(hurCell.getGroundNets()).next() + try: + netVdd = iter(hurCell.getPowerNets()).next() + except StopIteration: + print "[Stratus Warning] : Cell", self._name, "does not have a vdd port." + pass + try: + netVss = iter(hurCell.getGroundNets()).next() + except StopIteration: + print "[Stratus Warning] : Cell", self._name, "does not have a vss port." + pass if netVdd != None : self._st_vdds.append ( VddInFromHur ( netVdd ) ) - else : print "[Stratus Warning] : Cell", self._name, "does not have a vdd port." if netVss != None : self._st_vsss.append ( VssInFromHur ( netVss ) ) - else : print "[Stratus Warning] : Cell", self._name, "does not have a vss port." self._st_cks = []