From de02cf5685424cf5e6b86d80f77049f6185c011b Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 30 Oct 2017 15:41:26 +0100 Subject: [PATCH] In stratus.buildModel(), do not always save Logical AND Physical. * Bug: In stratus.buildModel(), the physical view was always saved, even only the logical one was created. Also add the ability to run the simulator. --- stratus1/src/stratus/stratus.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/stratus1/src/stratus/stratus.py b/stratus1/src/stratus/stratus.py index 0c10efb2..7ffd7d2c 100644 --- a/stratus1/src/stratus/stratus.py +++ b/stratus1/src/stratus/stratus.py @@ -67,10 +67,11 @@ except Exception, e: sys.exit(2) -DoNetlist = 0x0001 -DoLayout = 0x0002 -DoPattern = 0x0004 -DoStop = 0x0008 +DoNetlist = 0x00000001 +DoLayout = 0x00000002 +DoPattern = 0x00000004 +DoStop = 0x00000008 +RunSimulator = 0x00000010 def buildModel ( moduleName, flags, className=None, modelName=None, parameters={} ): @@ -90,9 +91,9 @@ def buildModel ( moduleName, flags, className=None, modelName=None, parameters={ model.Interface() saveFlags = 0 - if flags & DoNetlist: model.Netlist(); saveFlags |= LOGICAL - if flags & DoLayout: model.Layout (); saveFlags |= PHYSICAL - if flags & DoPattern: model.Pattern() + if flags & DoNetlist: model.Netlist(); saveFlags |= LOGICAL + if flags & DoLayout: model.Layout (); saveFlags |= PHYSICAL + if flags & (DoPattern|RunSimulator): model.Pattern() stopLevel=0 if flags & DoStop: stopLevel = 1 @@ -100,6 +101,8 @@ def buildModel ( moduleName, flags, className=None, modelName=None, parameters={ model.Save(saveFlags) UpdateSession.close() + if flags & RunSimulator: model.Simul() + except ImportError, e: module = str(e).split()[-1]