From 3801d65cdcc7ac2c1d36f76c0a1e3952cdfd4c33 Mon Sep 17 00:00:00 2001 From: Sophie Belloeil Date: Wed, 16 Feb 2011 13:59:03 +0000 Subject: [PATCH] (suite) Gestion de la fonction d'evaluation de la consommation pour memoire : stratus utilise toujours la variable STRATUS_MAPPING_NAME --- stratus1/src/stratus/st_getrealmodel.py | 11 +++++++++++ stratus1/src/stratus/st_model.py | 12 +++--------- stratus1/src/stratus/st_parser.py | 13 +++++++++++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/stratus1/src/stratus/st_getrealmodel.py b/stratus1/src/stratus/st_getrealmodel.py index 3b2afdfa..7adce3e5 100644 --- a/stratus1/src/stratus/st_getrealmodel.py +++ b/stratus1/src/stratus/st_getrealmodel.py @@ -91,3 +91,14 @@ def GetWeightArea ( model ) : raise Exception ( err ) return myP._weightArea[model] + +def GetWeightPower ( model ) : + myP = WeightParser() + + if 'STRATUS_MAPPING_NAME' in os.environ : + myP.Parse ( os.environ['STRATUS_MAPPING_NAME'] ) + else : + err = "\n[Stratus ERROR] Virtual library : No file found in order to parse.\nCheck STRATUS_MAPPING_NAME.\n" + raise Exception ( err ) + + return myP._weightPower[model] diff --git a/stratus1/src/stratus/st_model.py b/stratus1/src/stratus/st_model.py index f3723f7b..2d57babb 100644 --- a/stratus1/src/stratus/st_model.py +++ b/stratus1/src/stratus/st_model.py @@ -300,8 +300,7 @@ class Model : # Hurricane cell found: if hurCell : found = False - for netLoc in hurCell.getExternalNets(): - net = netLoc.getElement() + for net in hurCell.getExternalNets(): direction = net.getDirection() name = str(net.getName()) @@ -455,7 +454,7 @@ class Model : self._vbe = True ##### View : in order to see the in the editor ##### - def View ( self ) : + def View ( self, stopLevel=1, message="Status stop point" ) : global EDITOR if not self._hur_cell : @@ -465,10 +464,6 @@ class Model : if EDITOR: EDITOR.setCell ( self._hur_cell ) EDITOR.fit () - - ##### Breakpoint : stop point with a level. Also load in the Viewer ##### - def Breakpoint ( self, stopLevel=1, message="Status stop point" ) : - self.View () Breakpoint.stop ( stopLevel, message ) ##### Save : in order to create the output files ##### @@ -501,8 +496,7 @@ class Model : if not name : name = self._name - # Removed unknown asimut options: -nocheckdriver -nostrict -nowarning - if tool == 'asimut' : runpat ( self._name, name, '-l 1 -p 100 -zerodelay -bdd' ) + if tool == 'asimut' : runpat ( self._name, name, '-l 1 -p 100 -zerodelay -nocheckdriver -nostrict -bdd -nowarning' ) else : raise Exception ( 'not implemented yet' ) ##### Create a stratus file given the database ##### diff --git a/stratus1/src/stratus/st_parser.py b/stratus1/src/stratus/st_parser.py index 28e44f02..68ec7eb2 100644 --- a/stratus1/src/stratus/st_parser.py +++ b/stratus1/src/stratus/st_parser.py @@ -183,8 +183,9 @@ class WeightParser : self._p.EndElementHandler = self.end_element self._p.CharacterDataHandler = self.char_data - self._weightTime = {} - self._weightArea = {} + self._weightTime = {} + self._weightArea = {} + self._weightPower = {} # Handler functions @@ -208,6 +209,14 @@ class WeightParser : temp = 1 self._weightArea[virtName] = temp + + if 'power' in attrs : + temp = float(attrs['power']) + else : +# print 'Warning: no weight done in the file, weight put to 1.' + temp = 1 + + self._weightPower[virtName] = temp ################################ def end_element ( self, name ) : pass