coriolis/stratus1/src/stratus/stratus.py

110 lines
3.7 KiB
Python
Raw Normal View History

2010-07-12 10:33:22 -05:00
#!/usr/bin/python
#
# 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
#
# +-----------------------------------------------------------------+
2010-07-12 10:33:22 -05:00
# | C O R I O L I S |
# | 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" |
# +-----------------------------------------------------------------+
2010-07-12 10:33:22 -05:00
try:
import sys
import traceback
import Cfg
import CRL
2010-07-12 10:33:22 -05:00
# Triggers the default configuration files loading.
CRL.AllianceFramework.get()
2012-03-09 01:49:45 -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
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 *
#from st_placeAndRoute import *
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
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)
DoNetlist = 0x0001
DoLayout = 0x0002
DoStop = 0x0004
def buildModel ( name, flags ):
try:
Added support for "same layer" dogleg. Big fix for pad routing. * Change: In Knik, in Vertex, add a "blocked" flag to signal disabled vertexes in the grid (must not be used by the global router). Modificate the Graph::getVertex() method so that when a vertex is geometrically queried, if is a blocked one, return a non-blocked neighbor. This mechanism is introduced to, at last, prevent the global router to go *under* the pad in case of a commplete chip. * New: In Katabatic, in AutoSegment, a new state has been added: "reduced". A reduced segment is in the same layer as it's perpandiculars. To be reduced, a segments has to be connected on source & target to AutoContactTurn, both of the perpandiculars must be of the same layer (below or above) and it's length must not exceed one pitch in the perpandicular direction. To reduce an AutoSegment, call ::reduce() and to revert the state, call ::raise(). Two associated predicates are associated: ::canReduce() and ::mustRaise(). Note: No two adjacent segments can be reduced at the same time. * Bug: In Katabatic, in GCellTopology, add a new method ::doRp_AccessPad() to connect to the pads. Create wiring, fixed and non managed by Katabatic, to connect the pad connector layer to the lowest routing layers (depth 1 & 2). The former implementation was sometimes leading to gaps (sheared contact) that *must not* occurs during the building stage. Remark: This bug did put under the light the fact that the initial wiring must be created without gaps. Gaps are closed by making doglegs on contacts. But this mechanism could only work when the database if fully initialised (the cache is up to date). Otherwise various problems arise, in the canonization process for example. * New: In Katabatic, in AutoContactTerminal::getNativeConstraintBox(), when anchored on a RoutingPad, now take account the potential rotation of the Path's transformation. Here again, for the chip's pads. * New: In Kite, support for reduced AutoSegment. TrackSegment associateds to reduced AutoSegment are *not* inserted into track to become effectively invisibles. When a segment becomes reduced, a TrackEvent is generated to remove it. Conversely when it is raised a RoutingEvent is created/rescheduled to insert it. All this is mostly managed inside the Session::revalidate() method. * New: In Kite, in KiteEngine::createGlobalGraph(), in case of a chip, mark all global routing vertexes (Knik) that are under a pad, as blockeds. * Bug: In Cumulus, in PadsCorona.Side.getAxis(), inversion between X and Y coordinate of the chip size. Did not show until a non-square chip was routed (i.e. our MIPS R3000). * Change: In Stratus1, in st_placement.py add the ClockBuffer class for backward compatibility with the MIPS32 bench. Have to review this functionnality coming from the deprecated placeAndroute.py. In st_instance.py, no longer creates the Plug ring of a Net. In my opinion it just clutter the display until the P&R is called. Can re-enable later as an option (in Unicorn). * Change: In Unicorn, in cgt.py, more reliable way of loading then running user supplied scripts. Borrowed from alliance-checker-toolkit doChip.py .
2015-08-16 16:29:28 -05:00
#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
sys.exit(1)
print ' - Generating Stratus Model <%s>' % name
model = module.__dict__[name](name)
model.Interface()
if flags & DoNetlist: model.Netlist()
if flags & DoLayout: model.Layout ()
stopLevel=0
if flags & DoStop: stopLevel = 1
model.View(stopLevel, 'Model %s' % name)
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.'
print e
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
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 )