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.
This commit is contained in:
parent
41609a4bb4
commit
8328c890bb
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue