2010-07-12 10:33:22 -05:00
|
|
|
#!/usr/bin/python
|
|
|
|
#
|
2012-12-03 02:31:26 -06:00
|
|
|
# This file is part of the Coriolis Software.
|
2016-01-20 17:41:19 -06:00
|
|
|
# Copyright (c) UPMC 2008-2016, All Rights Reserved
|
2010-07-12 10:33:22 -05:00
|
|
|
#
|
2012-12-03 02:31:26 -06:00
|
|
|
# +-----------------------------------------------------------------+
|
2010-07-12 10:33:22 -05:00
|
|
|
# | C O R I O L I S |
|
2012-12-03 02:31:26 -06:00
|
|
|
# | S t r a t u s - Netlists/Layouts Description |
|
2010-07-12 10:33:22 -05:00
|
|
|
# | |
|
|
|
|
# | Author : Sophie BELLOEIL |
|
|
|
|
# | E-mail : Sophie.Belloeil@asim.lip6.fr |
|
|
|
|
# | =============================================================== |
|
|
|
|
# | Py Module : "./stratus.py" |
|
2012-12-03 02:31:26 -06:00
|
|
|
# +-----------------------------------------------------------------+
|
2010-07-12 10:33:22 -05:00
|
|
|
|
|
|
|
|
2012-12-03 02:31:26 -06:00
|
|
|
try:
|
|
|
|
import sys
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
import traceback
|
2012-12-03 02:31:26 -06:00
|
|
|
import Cfg
|
|
|
|
import CRL
|
2010-07-12 10:33:22 -05:00
|
|
|
|
2012-12-03 02:31:26 -06:00
|
|
|
# Triggers the default configuration files loading.
|
|
|
|
CRL.AllianceFramework.get()
|
2012-03-09 01:49:45 -06:00
|
|
|
|
2012-12-03 02:31:26 -06:00
|
|
|
Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.ApplicationBuiltin)
|
|
|
|
Cfg.getParamString('stratus1.format' ).setString('vst')
|
|
|
|
Cfg.getParamString('stratus1.simulator').setString('asimut')
|
|
|
|
Cfg.Configuration.popDefaultPriority()
|
2012-03-09 01:49:45 -06:00
|
|
|
|
2012-12-03 02:31:26 -06:00
|
|
|
print ' o Stratus Configuration:'
|
|
|
|
print ' - Netlist format: <%s>.' % Cfg.getParamString('stratus1.format').asString()
|
|
|
|
print ' - Simulator: <%s>.' % Cfg.getParamString('stratus1.simulator').asString()
|
|
|
|
|
|
|
|
from st_model import *
|
|
|
|
from st_net import *
|
|
|
|
from st_instance import *
|
|
|
|
from st_placement import *
|
2015-03-17 16:50:00 -05:00
|
|
|
#from st_placeAndRoute import *
|
2012-12-03 02:31:26 -06:00
|
|
|
from st_ref import *
|
|
|
|
from st_generate import *
|
|
|
|
from st_const import *
|
|
|
|
from st_cat import *
|
|
|
|
from st_param import *
|
|
|
|
from st_getrealmodel import GetWeightTime, GetWeightArea, GetWeightPower
|
|
|
|
|
|
|
|
from util_Const import *
|
|
|
|
from util_Defs import *
|
|
|
|
from util_Misc import *
|
|
|
|
from util_Gen import *
|
|
|
|
from util_Shift import *
|
|
|
|
from util_uRom import *
|
|
|
|
from util import *
|
|
|
|
|
|
|
|
from patterns import *
|
|
|
|
except ImportError, e:
|
|
|
|
module = str(e).split()[-1]
|
2012-03-09 01:49:45 -06:00
|
|
|
|
2012-12-03 02:31:26 -06:00
|
|
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
|
|
|
print ' Please check the integrity of the <coriolis> package.'
|
|
|
|
sys.exit(1)
|
|
|
|
except Exception, e:
|
|
|
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
|
|
|
print ' modules. Something may be wrong at Python/C API level.\n'
|
|
|
|
print ' %s' % e
|
|
|
|
sys.exit(2)
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
DoNetlist = 0x0001
|
|
|
|
DoLayout = 0x0002
|
|
|
|
DoStop = 0x0004
|
|
|
|
|
|
|
|
|
2016-04-13 11:49:50 -05:00
|
|
|
def buildModel ( moduleName, flags, className=None, modelName=None, parameters={} ):
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
try:
|
2016-04-13 11:49:50 -05:00
|
|
|
#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)
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
sys.exit(1)
|
|
|
|
|
2016-04-13 11:49:50 -05:00
|
|
|
print ' - Generating Stratus Model <%s> (generator:<%s>).' % (modelName, className)
|
|
|
|
model = module.__dict__[className](modelName,parameters)
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
model.Interface()
|
|
|
|
|
|
|
|
if flags & DoNetlist: model.Netlist()
|
|
|
|
if flags & DoLayout: model.Layout ()
|
|
|
|
|
|
|
|
stopLevel=0
|
|
|
|
if flags & DoStop: stopLevel = 1
|
2016-04-13 11:49:50 -05:00
|
|
|
model.View(stopLevel, 'Model %s' % modelName)
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
model.Save(LOGICAL|PHYSICAL)
|
|
|
|
|
|
|
|
except ImportError, e:
|
|
|
|
module = str(e).split()[-1]
|
|
|
|
|
|
|
|
print '[ERROR] The <%s> Stratus design cannot be loaded.' % module
|
|
|
|
print ' Please check your design hierarchy.'
|
2015-03-17 16:50:00 -05:00
|
|
|
print e
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
sys.exit(1)
|
|
|
|
except Exception, e:
|
|
|
|
print '[ERROR] A strange exception occurred while loading the Stratus'
|
2016-04-13 11:49:50 -05:00
|
|
|
print ' design <%s>. Please check that module for error:\n' % moduleName
|
Correctly manage clock net isolateds from the main clock.
* New: In Bootstrap, in ccb.py, check if cmake is installed and issue
a warning, if not.
* New: In Hurricane, added Cell::getDeepNet() to search for a deepnet
given a path and a leaf net. This method is slow and must not be
used too often. Introduced for Kite::BuildPowerRails().
* Change: In CRL Core, in cmos/alliance.conf, modify the clock name
pattern to match the sub-clock signals in the datapath operators.
* Bug: In Etesian, do not blindly reset the top cell abutment-box.
Do it only if it's empty, otherwise keep it.
* Bug: In Kite, in buildPowerRails(), in getRootNet() the management
of clock nets was incomplete. The case of unrouted clock nets
that where not connected to the top core clock net, like the
one in the datapath registers was faulty. They were partly
recognized as unrouteds and partly as blockage generating a
routing deadlock: routage impossible due to blockage generated
from itself...
* New: In Stratus1, add a buildModel() utility function to automate
the model generation and allow a call by the model name (string).
* Change: In Unicorn, in cgt.py, display the Alliance environement.
2015-02-25 15:17:44 -06:00
|
|
|
traceback.print_tb(sys.exc_info()[2])
|
|
|
|
print ' %s' % e
|
|
|
|
sys.exit(2)
|
|
|
|
|
|
|
|
framework = CRL.AllianceFramework.get()
|
2016-04-13 11:49:50 -05:00
|
|
|
return framework.getCell( modelName, CRL.Catalog.State.Views )
|