From 8328c890bb21ba04d0236c5f9c97ef053e7c3b00 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 13 Apr 2016 18:49:50 +0200 Subject: [PATCH] In Stratus, in dpgen_RAM get cell height from the library. * Change: In Stratus, in dpgen_RAM, the cell height was fixed to 50l. Now read the prech[0] to set up the cell height (useful for MOSIS cells). * New: In Stratus, in buildModel(), the stand alone generator caller now support a className, a modelName and a set of parameters to pass on to the model. This is very useful when the module name (the file), the class name and the model name are not the same. --- cumulus/src/plugins/RSavePlugin.py | 2 +- stratus1/src/dpgen/dpgen_RAM.py | 4 +++- stratus1/src/stratus/stratus.py | 23 +++++++++++++---------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/cumulus/src/plugins/RSavePlugin.py b/cumulus/src/plugins/RSavePlugin.py index 7056bbf4..8494504f 100644 --- a/cumulus/src/plugins/RSavePlugin.py +++ b/cumulus/src/plugins/RSavePlugin.py @@ -60,7 +60,7 @@ def rsave ( cell, views=CRL.Catalog.State.Physical, depth=0 ): sviews = '' if views & CRL.Catalog.State.Logical: sviews += 'netlist' if views & CRL.Catalog.State.Physical: - if not sviews: sviews += ',' + if sviews: sviews += ',' sviews += 'layout' print ' %s+ %s (%s).' % ( ' '*(depth*2), cell.getName(), sviews ) diff --git a/stratus1/src/dpgen/dpgen_RAM.py b/stratus1/src/dpgen/dpgen_RAM.py index 939e4847..1ac62b94 100644 --- a/stratus1/src/dpgen/dpgen_RAM.py +++ b/stratus1/src/dpgen/dpgen_RAM.py @@ -48,6 +48,7 @@ +from Hurricane import DbU from stratus import * class DpgenRam ( Model ) : @@ -589,7 +590,8 @@ class DpgenRam ( Model ) : ############################ def Layout ( self ) : - HCELL = 50 + #HCELL = 50 + HCELL = DbU.toLambda( self.Prech[0]._hur_masterCell.getAbutmentBox().getHeight() ) # Lignes de bit bottom = 0 diff --git a/stratus1/src/stratus/stratus.py b/stratus1/src/stratus/stratus.py index 61e4d788..aa1afb13 100644 --- a/stratus1/src/stratus/stratus.py +++ b/stratus1/src/stratus/stratus.py @@ -71,16 +71,19 @@ DoLayout = 0x0002 DoStop = 0x0004 -def buildModel ( name, flags ): +def buildModel ( moduleName, flags, className=None, modelName=None, parameters={} ): try: - #print name - module = __import__( name, globals(), locals(), name ) - if not module.__dict__.has_key(name): - print '[ERROR] Stratus module <%s> do not contains a design of the same name.' % name + #print moduleName + if not className: className = moduleName + if not modelName: modelName = moduleName.lower() + + module = __import__( moduleName, globals(), locals(), className ) + if not module.__dict__.has_key(className): + print '[ERROR] Stratus module <%s> do not contains a design named <%s>.' % (moduleName,className) sys.exit(1) - print ' - Generating Stratus Model <%s>' % name - model = module.__dict__[name](name) + print ' - Generating Stratus Model <%s> (generator:<%s>).' % (modelName, className) + model = module.__dict__[className](modelName,parameters) model.Interface() if flags & DoNetlist: model.Netlist() @@ -88,7 +91,7 @@ def buildModel ( name, flags ): stopLevel=0 if flags & DoStop: stopLevel = 1 - model.View(stopLevel, 'Model %s' % name) + model.View(stopLevel, 'Model %s' % modelName) model.Save(LOGICAL|PHYSICAL) except ImportError, e: @@ -100,10 +103,10 @@ def buildModel ( name, flags ): sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the Stratus' - print ' design <%s>. Please check that module for error:\n' % name + print ' design <%s>. Please check that module for error:\n' % moduleName traceback.print_tb(sys.exc_info()[2]) print ' %s' % e sys.exit(2) framework = CRL.AllianceFramework.get() - return framework.getCell( name, CRL.Catalog.State.Views ) + return framework.getCell( modelName, CRL.Catalog.State.Views )