2012-11-16 06:49:47 -06:00
|
|
|
|
|
|
|
# -*- mode:Python -*-
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os.path
|
|
|
|
import string
|
|
|
|
import traceback
|
|
|
|
import Hurricane
|
|
|
|
from Hurricane import DbU
|
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
|
|
|
from Hurricane import DataBase
|
2012-11-16 06:49:47 -06:00
|
|
|
from Hurricane import BasicLayer
|
|
|
|
from helpers import ErrorMessage
|
|
|
|
|
|
|
|
|
|
|
|
realFile = '<No real file specified>'
|
|
|
|
|
|
|
|
|
New coriolis launcher. Configuration files cleanup.
* Change: In CRL Core, simplify the loading sequence. The technology,
both symbolic and real is now loaded directly from coriolisInit.py
and not through the Alliance loader. This was a leftover from the
time configuration was in XML. Remove others traces of XML loading.
Remove SYMB_TECHNO_NAME, REAL_TECHNO_NAME & DISPLAY from the Alliance
environement, as they was no longer used.
Note that technology *still* need to be loader *after* Alliance
framework has been initialized.
Gauge information is moved from <alliance.conf> to <kite.conf>.
* Bug: In Coloquinte, in optimization_subproblems.cxx static variables
must not be inlined. Generate a problem when linking in debug mode
(seems the symbol gets optimised out).
* Bug: In Katabatic, in Grid::getGCell(), when the coordinate is *outside*
the area, do not try to find a GCell, directly return NULL.
* New: In Unicorn, create a generic command launcher named "coriolis" which
automatically take cares of all environement setup, then run a command
by default, it's <cgt>, but it can be anything. For example: <zsh>.
2015-04-13 11:54:09 -05:00
|
|
|
def loadGdsLayers ( realLayersTable, confFile ):
|
|
|
|
realFile = confFile
|
|
|
|
technology = DataBase.getDB().getTechnology()
|
|
|
|
|
2012-11-16 06:49:47 -06:00
|
|
|
entryNo = 0
|
|
|
|
for entry in realLayersTable:
|
|
|
|
entryNo += 1
|
|
|
|
|
|
|
|
try:
|
|
|
|
if len(entry) != 3:
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,['Malformed entry in <realLayersTable>.'
|
|
|
|
,'Must have exactly three fields: (symb_name,real_name,GDSII_extnb).'
|
|
|
|
,str(entry)
|
|
|
|
])
|
2012-11-16 06:49:47 -06:00
|
|
|
symbName, realName, gdsiiExtractNumber = entry
|
|
|
|
if not isinstance(gdsiiExtractNumber,int):
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,['Incoherency in <realLayersTable> entry.'
|
|
|
|
,'GDSII exctract number is not of int type (%s).' \
|
|
|
|
% helpers.stype(gdsiiExtractNumber)
|
|
|
|
,str(entry)
|
|
|
|
])
|
2012-11-16 06:49:47 -06:00
|
|
|
|
|
|
|
basicLayer = technology.getBasicLayer(symbName)
|
|
|
|
if not basicLayer:
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,['Incoherency in <realLayersTable> entry.'
|
|
|
|
,'The real layer "%s" associated to the GDSII "%s" do not exists.' \
|
|
|
|
% (symbName,realName)
|
|
|
|
,str(entry)
|
|
|
|
])
|
2012-11-16 06:49:47 -06:00
|
|
|
basicLayer.setRealName ( realName )
|
|
|
|
basicLayer.setExtractNumber( gdsiiExtractNumber )
|
|
|
|
|
|
|
|
except Exception, e:
|
|
|
|
ErrorMessage.wrapPrint(e,'In %s:<realLayersTable> at index %d.' % (realFile,entryNo))
|
|
|
|
return
|
|
|
|
|
|
|
|
|
New coriolis launcher. Configuration files cleanup.
* Change: In CRL Core, simplify the loading sequence. The technology,
both symbolic and real is now loaded directly from coriolisInit.py
and not through the Alliance loader. This was a leftover from the
time configuration was in XML. Remove others traces of XML loading.
Remove SYMB_TECHNO_NAME, REAL_TECHNO_NAME & DISPLAY from the Alliance
environement, as they was no longer used.
Note that technology *still* need to be loader *after* Alliance
framework has been initialized.
Gauge information is moved from <alliance.conf> to <kite.conf>.
* Bug: In Coloquinte, in optimization_subproblems.cxx static variables
must not be inlined. Generate a problem when linking in debug mode
(seems the symbol gets optimised out).
* Bug: In Katabatic, in Grid::getGCell(), when the coordinate is *outside*
the area, do not try to find a GCell, directly return NULL.
* New: In Unicorn, create a generic command launcher named "coriolis" which
automatically take cares of all environement setup, then run a command
by default, it's <cgt>, but it can be anything. For example: <zsh>.
2015-04-13 11:54:09 -05:00
|
|
|
def loadTechnoConfig ( technoConfig, confFile ):
|
|
|
|
realFile = confFile
|
|
|
|
technology = DataBase.getDB().getTechnology()
|
|
|
|
|
2012-11-16 06:49:47 -06:00
|
|
|
gridValue = 1
|
|
|
|
gridUnit = DbU.UnitPowerMicro
|
|
|
|
for key in [ 'gridUnit', 'gridValue', 'gridsPerLambda' ]:
|
|
|
|
try:
|
|
|
|
if key == 'gridUnit':
|
|
|
|
if technoConfig.has_key(key):
|
|
|
|
gridUnit = technoConfig[key]
|
|
|
|
if gridUnit != DbU.UnitPowerPico and \
|
|
|
|
gridUnit != DbU.UnitPowerNano and \
|
|
|
|
gridUnit != DbU.UnitPowerMicro and \
|
|
|
|
gridUnit != DbU.UnitPowerMilli and \
|
|
|
|
gridUnit != DbU.UnitPowerUnity and \
|
|
|
|
gridUnit != DbU.UnitPowerKilo:
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,'In <technoConfig>, invalid DbU unit power for gridUnit, reseting to Micro.')
|
2012-11-16 06:49:47 -06:00
|
|
|
else:
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,'<technoConfig> has no <gridUnit> defined, assuming Micro.')
|
2012-11-16 06:49:47 -06:00
|
|
|
|
|
|
|
elif key == 'gridValue':
|
|
|
|
if technoConfig.has_key('gridValue'):
|
|
|
|
gridValue = technoConfig['gridValue']
|
|
|
|
if not isinstance(gridUnit,float) and not isinstance(gridUnit,int):
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,['In <technoConfig>, <gridValue> must be of type float (and not: %s).'
|
|
|
|
% helpers.stype(gridValue)
|
|
|
|
])
|
2012-11-16 06:49:47 -06:00
|
|
|
DbU.setPhysicalsPerGrid(gridValue,gridUnit)
|
|
|
|
else:
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,'<technoConfig> has no <gridValue> defined.')
|
2012-11-16 06:49:47 -06:00
|
|
|
|
|
|
|
elif key == 'gridsPerLambda':
|
|
|
|
if technoConfig.has_key('gridsPerLambda'):
|
|
|
|
gridsPerLambda = technoConfig['gridsPerLambda']
|
|
|
|
if not isinstance(gridsPerLambda,int):
|
2012-12-03 02:27:41 -06:00
|
|
|
raise ErrorMessage(1,['In <technoConfig>, <gridsPerLambda> must be of type int (and not: %s).'
|
2012-11-16 06:49:47 -06:00
|
|
|
% helpers.stype(gridsPerLambda)
|
|
|
|
])
|
|
|
|
DbU.setGridsPerLambda(gridsPerLambda)
|
|
|
|
|
|
|
|
except Exception, e:
|
|
|
|
ErrorMessage.wrapPrint(e)
|
|
|
|
return
|