coriolis/oroshi/python/dtr.py

223 lines
8.1 KiB
Python
Raw Permalink Normal View History

# -*- coding: utf-8 -*-
Comprehensive reorganisation of the Python part of Coriolis. * Move all Python stuff under a common Python namespace "coriolis". * Instead of having a series subtrees for each tool, integrate everything in one common tree. So now, all components can be located either with an absolute path from "coriolis" or, inside cross-reference themselves through relatives imports. * As a consequence, we only need to add ".../site-packages/coriolis/" to the PYTHONPATH, and not a whole bunch of subdirectories. And nothing, if installed in-system. * The tree of free technologies configuration files is also moved below "coriolis/technos" instead of "/etc". * Supressed "cumulus" level for the plugins. * All python modules are rewritten using relative imports except for the configuration files that uses absolute import as they can be cloned outside of the tree to serve as templates. * Change: In boostrap/FindPythonSitePackages, include "/coriolis" in Python_CORIOLISARCH and Python_CORIOLISLIB. Provide a Python_SITELIB *without* "/coriolis" appended. * Change: In cumulus/plugins/__init__.loadPlugins(), must prefix modules read in the plugins directory by "coriolis.plugins.". No longer need to add their path to sys.path. * Change: In crlcore/python/technos/nodeX/*/devices.py, the scripts of the layouts generators must be prefixed by "coriolis.oroshi.". * Change: In CRL::System CTOR, no longer add the pathes of the various plugins to sys.path. Only "site-packages/coriolis/". * New: In Utilities::Path::toPyModePath(), new method to convert a filesystem path into a python module path. Examples: "coriolis/plugins/block" --> "coriolis.plugins.block". "coriolis/plugins/rsave.py" --> "coriolis.plugins.rsave". * Change: In katanaEngine::_runKatanaEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In BoraEngine::_runBoraEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In UnicornGui::_runUnicornInit(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In cumulus.plugins.chip.constants, put the constants outside __init__.py to avoid a loop at initialization.
2023-02-27 15:14:32 -06:00
from ..Hurricane import DbU, DataBase
from ..helpers import trace
from ..helpers.io import ErrorMessage as Error
class Rules ( object ):
"""
The Rules object provides an easier access to the design rules stored
in the Technology databse. Instead of having to perform a function call
like:
.. code:: Python
tech = DataBase.getDB().getTechnology()
value = tech.getPhysicalRule( 'minEnclosure', 'pImplant', 'active' )
We can write access the rule as an attribute of the ``rule`` object.
.. code:: Python
import oroshi
value = oroshi.rules.minEnclosure_pImplant_active
Only the rules defined in the Rules.ruleSet list will be loaded.
"""
ruleSet = [ 'minSpacing_nWell'
, 'minWidth_pImplant'
, 'minSpacing_pImplant'
, 'minSpacing_rpolyh_pImplant'
, 'minEnclosure_pImplant_poly2con'
, 'minEnclosure_nImplant_active'
, 'minEnclosure_pImplant_active'
, 'minSpacing_nImplant_pImplant'
, 'minSpacing_cut0'
, 'minWidth_cut0'
, 'minWidth_active'
, 'minEnclosure_active_cut0'
, 'transistorMinL'
, 'transistorMinW'
, 'minSpacing_poly'
, 'minGateSpacing_poly'
, 'minSpacing_poly_active'
, 'minExtension_active_poly'
, 'minExtension_poly_active'
, 'minEnclosure_poly_cut0'
, 'minSpacing_cut0_poly'
, 'minWidth_cut0'
, 'minSpacing_cut0_active'
, 'minWidth_metal1'
, 'minSpacing_metal1'
, 'minEnclosure_metal1_cut0'
, 'minEnclosure_metal1_cut1'
, 'minWidth_cut1'
, 'minSpacing_cut1'
, 'minWidth_metal2'
, 'minSpacing_metal2'
, 'minEnclosure_metal2_cut1'
, 'minEnclosure_metal2_cut2'
, 'minWidth_cut2'
, 'minSpacing_cut2'
, 'minWidth_cut1'
, 'minSpacing_cut1'
, 'minWidth_metal3'
, 'minSpacing_metal3'
, 'minSpacingWide1_metal3'
, 'minEnclosure_metal3_cut2'
, 'minSpacingOnMetBot_cut2'
, 'minSpacingOnMetCap_cut2'
, 'maxWidth_metcap'
, 'minSpacing_metbot'
, 'minSpacing_cut1_metcap'
, 'minSpacing_cut2_metcap'
, 'minEnclosure_metbot_metcap'
, 'minEnclosure_metbot_cut1'
, 'minEnclosure_metbot_cut2'
, 'minEnclosure_metcap_cut2'
, 'minWidth_metcap'
, 'minWidth_metcapdum'
, 'minWidth_cpoly'
, 'minWidth_poly2'
, 'minWidth_rpolyh'
, 'minWidthHighPrec_rpolyh'
, 'minSpacing_cpoly'
, 'minSpacing_poly2'
, 'minSpacing_rpolyh'
, 'minSpacing_cut0_cpoly'
, 'minSpacing_diff_poly2'
, 'minSpacing_poly_poly2'
, 'minEnclosure_poly_cpoly'
, 'minEnclosure_cpoly_cut0'
, 'minEnclosure_poly2_cut0'
, 'MIMCap'
, 'PIPCap'
, 'MIMPerimeterCap'
, 'PIPPerimeterCap'
, 'RPOLYHSheetRes'
, 'RPOLY2PHSheetRes'
, 'MET1RPOLYHContRes'
, 'minWidth_hres'
, 'minSpacing_hres'
, 'minEnclosure_hres_poly2'
, 'minSpacing_hres_poly1'
, 'minSpacing_hres_poly2'
, 'minSpacing_hres_active'
, 'corrFactor90'
, 'corrFactor135'
, 'minRpolyhSquares'
]
Comprehensive reorganisation of the Python part of Coriolis. * Move all Python stuff under a common Python namespace "coriolis". * Instead of having a series subtrees for each tool, integrate everything in one common tree. So now, all components can be located either with an absolute path from "coriolis" or, inside cross-reference themselves through relatives imports. * As a consequence, we only need to add ".../site-packages/coriolis/" to the PYTHONPATH, and not a whole bunch of subdirectories. And nothing, if installed in-system. * The tree of free technologies configuration files is also moved below "coriolis/technos" instead of "/etc". * Supressed "cumulus" level for the plugins. * All python modules are rewritten using relative imports except for the configuration files that uses absolute import as they can be cloned outside of the tree to serve as templates. * Change: In boostrap/FindPythonSitePackages, include "/coriolis" in Python_CORIOLISARCH and Python_CORIOLISLIB. Provide a Python_SITELIB *without* "/coriolis" appended. * Change: In cumulus/plugins/__init__.loadPlugins(), must prefix modules read in the plugins directory by "coriolis.plugins.". No longer need to add their path to sys.path. * Change: In crlcore/python/technos/nodeX/*/devices.py, the scripts of the layouts generators must be prefixed by "coriolis.oroshi.". * Change: In CRL::System CTOR, no longer add the pathes of the various plugins to sys.path. Only "site-packages/coriolis/". * New: In Utilities::Path::toPyModePath(), new method to convert a filesystem path into a python module path. Examples: "coriolis/plugins/block" --> "coriolis.plugins.block". "coriolis/plugins/rsave.py" --> "coriolis.plugins.rsave". * Change: In katanaEngine::_runKatanaEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In BoraEngine::_runBoraEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In UnicornGui::_runUnicornInit(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In cumulus.plugins.chip.constants, put the constants outside __init__.py to avoid a loop at initialization.
2023-02-27 15:14:32 -06:00
def __init__ ( self ):
"""
Create an empty rule set. The rules must be loaded afterwards by calling
``Rules.load()``.
"""
trace( 100, '\tRules.__init__()\n' )
self.dtr = None
def isLoaded ( self ):
"""Tells if the rules have already been loaded."""
return self.dtr is not None
def load ( self, dtr ):
"""
Load the rule set from the technology into the Rules object.
Comprehensive reorganisation of the Python part of Coriolis. * Move all Python stuff under a common Python namespace "coriolis". * Instead of having a series subtrees for each tool, integrate everything in one common tree. So now, all components can be located either with an absolute path from "coriolis" or, inside cross-reference themselves through relatives imports. * As a consequence, we only need to add ".../site-packages/coriolis/" to the PYTHONPATH, and not a whole bunch of subdirectories. And nothing, if installed in-system. * The tree of free technologies configuration files is also moved below "coriolis/technos" instead of "/etc". * Supressed "cumulus" level for the plugins. * All python modules are rewritten using relative imports except for the configuration files that uses absolute import as they can be cloned outside of the tree to serve as templates. * Change: In boostrap/FindPythonSitePackages, include "/coriolis" in Python_CORIOLISARCH and Python_CORIOLISLIB. Provide a Python_SITELIB *without* "/coriolis" appended. * Change: In cumulus/plugins/__init__.loadPlugins(), must prefix modules read in the plugins directory by "coriolis.plugins.". No longer need to add their path to sys.path. * Change: In crlcore/python/technos/nodeX/*/devices.py, the scripts of the layouts generators must be prefixed by "coriolis.oroshi.". * Change: In CRL::System CTOR, no longer add the pathes of the various plugins to sys.path. Only "site-packages/coriolis/". * New: In Utilities::Path::toPyModePath(), new method to convert a filesystem path into a python module path. Examples: "coriolis/plugins/block" --> "coriolis.plugins.block". "coriolis/plugins/rsave.py" --> "coriolis.plugins.rsave". * Change: In katanaEngine::_runKatanaEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In BoraEngine::_runBoraEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In UnicornGui::_runUnicornInit(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In cumulus.plugins.chip.constants, put the constants outside __init__.py to avoid a loop at initialization.
2023-02-27 15:14:32 -06:00
.. note:: The ``dtr`` parameter is just another name for the currently
used Hurricane::Technology.
"""
Comprehensive reorganisation of the Python part of Coriolis. * Move all Python stuff under a common Python namespace "coriolis". * Instead of having a series subtrees for each tool, integrate everything in one common tree. So now, all components can be located either with an absolute path from "coriolis" or, inside cross-reference themselves through relatives imports. * As a consequence, we only need to add ".../site-packages/coriolis/" to the PYTHONPATH, and not a whole bunch of subdirectories. And nothing, if installed in-system. * The tree of free technologies configuration files is also moved below "coriolis/technos" instead of "/etc". * Supressed "cumulus" level for the plugins. * All python modules are rewritten using relative imports except for the configuration files that uses absolute import as they can be cloned outside of the tree to serve as templates. * Change: In boostrap/FindPythonSitePackages, include "/coriolis" in Python_CORIOLISARCH and Python_CORIOLISLIB. Provide a Python_SITELIB *without* "/coriolis" appended. * Change: In cumulus/plugins/__init__.loadPlugins(), must prefix modules read in the plugins directory by "coriolis.plugins.". No longer need to add their path to sys.path. * Change: In crlcore/python/technos/nodeX/*/devices.py, the scripts of the layouts generators must be prefixed by "coriolis.oroshi.". * Change: In CRL::System CTOR, no longer add the pathes of the various plugins to sys.path. Only "site-packages/coriolis/". * New: In Utilities::Path::toPyModePath(), new method to convert a filesystem path into a python module path. Examples: "coriolis/plugins/block" --> "coriolis.plugins.block". "coriolis/plugins/rsave.py" --> "coriolis.plugins.rsave". * Change: In katanaEngine::_runKatanaEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In BoraEngine::_runBoraEngine(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In UnicornGui::_runUnicornInit(), rename the hook script initHook.py. No longer need to modify sys.path. * Change: In cumulus.plugins.chip.constants, put the constants outside __init__.py to avoid a loop at initialization.
2023-02-27 15:14:32 -06:00
trace( 100, '\tRules.load()\n' )
if self.dtr:
print( Error( 1, 'Rules.load(): Attempt to load rules from DTR a second time (ignored).' ))
return
self.dtr = dtr
Enhanced techno rule support. Inspector support bug fix. * Bug: In Hurricane/Commons.h, modify the getRecord<>() templates so that for both vector<Element> and vector<Element*>, the individual record created for each element are donne with pointers. That is, for the vector<Element> case, we take a pointer. As a general policy, except for the POD types, always use pointers or references to data in the records/inspector. Never uses values that can call the copy constructor. Suppress INSPECTOR_PV_SUPPORT() macro, keep only INSPECTOR_PR_SUPPORT(). Provide value support only for getString<>() template. This value & copy constructor problem was causing a crash when trying to inspect Hurricane::AnalogCellExtension. * New: In Hurricane::Technology, change the API of the PhysicalRule, now we can only create/get PhysicalRule, but setting the value of the rule itself must be done on the rule. Enhance PhysicalRule to provide for stepped rules, non isotropic and ratio rules. Merge TwoLayersPhysicalrule in PhysicalRule, much simpler to suppress the management of derived classes. That means that we loose a little memory as some fields are mutually exclusive. Not a problem considering that there will not be so many of thoses objects. * New: In CRL/helpers.analogtechno.py, enhanced DTR support for rules like: ('minSpacing' , 'metal1', ((0.4,20.0), (0.8,1000.0)), Length, 'REF.1') ('minEnclosure', 'metal1', 'cut1', (0.2,0.3) , Length, 'REF.2') ('minDensity' , 'metal1', 0.30 , Unit , 'REF.3') The DTR parser has been updated, but not the oroshi.dtr Rule cache for analog components. Given a rule name, the value used will be the horizontal one of the first step. * Change: In hurricane/doc/hurricane, re-generate the documentation with updated support for Technology & PhysicalRule.
2020-07-21 04:22:04 -05:00
for rule in Rules.ruleSet: self.addAttr(rule)
def getRealLayer ( self, stdName ):
"""
Get a Layer object by it's name. The alias translation from generic
names is used to return the real technology name.
For example:
================== ===================
Generic Layer Name SkyWater 130nm Name
================== ===================
nWell nwm
active difftap
pImplant psdm
cut0 licon
metal1 li
cut1 via
metal2 metal1
================== ===================
"""
return self.dtr.getLayer( stdName )
def attrTranslate ( self, attribute ):
"""
Translate a rule complete name, given in ``attribute``, using the *generic*
layer names into another string, using the target technology layer names.
For example, for SkyWater 130nm: ::
minEnclosure_pImplant_active => minSpacing_psdm_difftap
"""
words = attribute.split( '_' )
translateds = [ words[0] ]
for word in words[1:]:
realLayer = self.getRealLayer( word )
if realLayer is None:
print( Error( 1, 'rules.attrTranslate(): Unable to translate generic layer "{}".' \
.format( word )))
realLayerName = word
else:
realLayerName = realLayer.getName()
translateds.append( realLayerName )
return '_'.join( translateds )
Enhanced techno rule support. Inspector support bug fix. * Bug: In Hurricane/Commons.h, modify the getRecord<>() templates so that for both vector<Element> and vector<Element*>, the individual record created for each element are donne with pointers. That is, for the vector<Element> case, we take a pointer. As a general policy, except for the POD types, always use pointers or references to data in the records/inspector. Never uses values that can call the copy constructor. Suppress INSPECTOR_PV_SUPPORT() macro, keep only INSPECTOR_PR_SUPPORT(). Provide value support only for getString<>() template. This value & copy constructor problem was causing a crash when trying to inspect Hurricane::AnalogCellExtension. * New: In Hurricane::Technology, change the API of the PhysicalRule, now we can only create/get PhysicalRule, but setting the value of the rule itself must be done on the rule. Enhance PhysicalRule to provide for stepped rules, non isotropic and ratio rules. Merge TwoLayersPhysicalrule in PhysicalRule, much simpler to suppress the management of derived classes. That means that we loose a little memory as some fields are mutually exclusive. Not a problem considering that there will not be so many of thoses objects. * New: In CRL/helpers.analogtechno.py, enhanced DTR support for rules like: ('minSpacing' , 'metal1', ((0.4,20.0), (0.8,1000.0)), Length, 'REF.1') ('minEnclosure', 'metal1', 'cut1', (0.2,0.3) , Length, 'REF.2') ('minDensity' , 'metal1', 0.30 , Unit , 'REF.3') The DTR parser has been updated, but not the oroshi.dtr Rule cache for analog components. Given a rule name, the value used will be the horizontal one of the first step. * Change: In hurricane/doc/hurricane, re-generate the documentation with updated support for Technology & PhysicalRule.
2020-07-21 04:22:04 -05:00
def addAttr ( self, attribute ):
"""
Add a new attribute into the dictionnary of rule set. The attribute fields,
separated by '_' are broken down to get the corresponding rule in the
technology and be set as value of said attribute.
The attribute is the concatenation of the rule name and the various layers
it applies on. For example: ::
(minEnclosure, pImplant, active) => 'minEnclosure_pImplant_active'
"""
techAttribute = self.attrTranslate( attribute )
Migration towards Python3, first stage: still based on C-Macros. * New: Python/C++ API level: * Write a new C++/template wrapper to get rid of boost::python * The int & long Python type are now merged. So a C/C++ level, it became "PyLong_X" (remove "PyInt_X") and at Python code level, it became "int" (remove "long"). * Change: VLSISAPD finally defunct. * Configuration is now integrated as a Hurricane component, makes use of the new C++/template wrapper. * vlsisapd is now defunct. Keep it in the source for now as some remaining non essential code may have to be ported in the future. * Note: Python code (copy of the migration howto): * New print function syntax print(). * Changed "dict.has_key(k)" for "k" in dict. * Changed "except Exception, e" for "except Exception as e". * The division "/" is now the floating point division, even if both operand are integers. So 3/2 now gives 1.5 and no longer 1. The integer division is now "//" : 1 = 3//2. So have to carefully review the code to update. Most of the time we want to use "//". We must never change to float for long that, in fact, represents DbU (exposed as Python int type). * execfile() must be replaced by exec(open("file").read()). * iter().__next__() becomes iter(x).__next__(). * __getslice__() has been removed, integrated to __getitem__(). * The formating used for str(type(o)) has changed, so In Stratus, have to update them ("<class 'MyClass'>" instead of "MyClass"). * the "types" module no longer supply values for default types like str (types.StringType) or list (types.StringType). Must use "isinstance()" where they were occuring. * Remove the 'L' to indicate "long integer" (like "12L"), now all Python integer are long. * Change in bootstrap: * Ported Coriolis builder (ccb) to Python3. * Ported Coriolis socInstaller.py to Python3. * Note: In PyQt4+Python3, QVariant no longer exists. Use None or directly convert using the python syntax: bool(x), int(x), ... By default, it is a string (str). * Note: PyQt4 bindings & Python3 under SL7. * In order to compile user's must upgrade to my own rebuild of PyQt 4 & 5 bindings 4.19.21-1.el7.soc. * Bug: In cumulus/plugins.block.htree.HTree.splitNet(), set the root buffer of the H-Tree to the original signal (mainly: top clock). Strangely, it was only done when working in full chip mode.
2021-09-19 12:41:24 -05:00
if attribute in self.__dict__: return
Enhanced techno rule support. Inspector support bug fix. * Bug: In Hurricane/Commons.h, modify the getRecord<>() templates so that for both vector<Element> and vector<Element*>, the individual record created for each element are donne with pointers. That is, for the vector<Element> case, we take a pointer. As a general policy, except for the POD types, always use pointers or references to data in the records/inspector. Never uses values that can call the copy constructor. Suppress INSPECTOR_PV_SUPPORT() macro, keep only INSPECTOR_PR_SUPPORT(). Provide value support only for getString<>() template. This value & copy constructor problem was causing a crash when trying to inspect Hurricane::AnalogCellExtension. * New: In Hurricane::Technology, change the API of the PhysicalRule, now we can only create/get PhysicalRule, but setting the value of the rule itself must be done on the rule. Enhance PhysicalRule to provide for stepped rules, non isotropic and ratio rules. Merge TwoLayersPhysicalrule in PhysicalRule, much simpler to suppress the management of derived classes. That means that we loose a little memory as some fields are mutually exclusive. Not a problem considering that there will not be so many of thoses objects. * New: In CRL/helpers.analogtechno.py, enhanced DTR support for rules like: ('minSpacing' , 'metal1', ((0.4,20.0), (0.8,1000.0)), Length, 'REF.1') ('minEnclosure', 'metal1', 'cut1', (0.2,0.3) , Length, 'REF.2') ('minDensity' , 'metal1', 0.30 , Unit , 'REF.3') The DTR parser has been updated, but not the oroshi.dtr Rule cache for analog components. Given a rule name, the value used will be the horizontal one of the first step. * Change: In hurricane/doc/hurricane, re-generate the documentation with updated support for Technology & PhysicalRule.
2020-07-21 04:22:04 -05:00
#print( 'Rules.addAttr(): {} -> {}'.format( attribute, techAttribute ))
Enhanced techno rule support. Inspector support bug fix. * Bug: In Hurricane/Commons.h, modify the getRecord<>() templates so that for both vector<Element> and vector<Element*>, the individual record created for each element are donne with pointers. That is, for the vector<Element> case, we take a pointer. As a general policy, except for the POD types, always use pointers or references to data in the records/inspector. Never uses values that can call the copy constructor. Suppress INSPECTOR_PV_SUPPORT() macro, keep only INSPECTOR_PR_SUPPORT(). Provide value support only for getString<>() template. This value & copy constructor problem was causing a crash when trying to inspect Hurricane::AnalogCellExtension. * New: In Hurricane::Technology, change the API of the PhysicalRule, now we can only create/get PhysicalRule, but setting the value of the rule itself must be done on the rule. Enhance PhysicalRule to provide for stepped rules, non isotropic and ratio rules. Merge TwoLayersPhysicalrule in PhysicalRule, much simpler to suppress the management of derived classes. That means that we loose a little memory as some fields are mutually exclusive. Not a problem considering that there will not be so many of thoses objects. * New: In CRL/helpers.analogtechno.py, enhanced DTR support for rules like: ('minSpacing' , 'metal1', ((0.4,20.0), (0.8,1000.0)), Length, 'REF.1') ('minEnclosure', 'metal1', 'cut1', (0.2,0.3) , Length, 'REF.2') ('minDensity' , 'metal1', 0.30 , Unit , 'REF.3') The DTR parser has been updated, but not the oroshi.dtr Rule cache for analog components. Given a rule name, the value used will be the horizontal one of the first step. * Change: In hurricane/doc/hurricane, re-generate the documentation with updated support for Technology & PhysicalRule.
2020-07-21 04:22:04 -05:00
value = None
words = techAttribute.split( '_' )
Enhanced techno rule support. Inspector support bug fix. * Bug: In Hurricane/Commons.h, modify the getRecord<>() templates so that for both vector<Element> and vector<Element*>, the individual record created for each element are donne with pointers. That is, for the vector<Element> case, we take a pointer. As a general policy, except for the POD types, always use pointers or references to data in the records/inspector. Never uses values that can call the copy constructor. Suppress INSPECTOR_PV_SUPPORT() macro, keep only INSPECTOR_PR_SUPPORT(). Provide value support only for getString<>() template. This value & copy constructor problem was causing a crash when trying to inspect Hurricane::AnalogCellExtension. * New: In Hurricane::Technology, change the API of the PhysicalRule, now we can only create/get PhysicalRule, but setting the value of the rule itself must be done on the rule. Enhance PhysicalRule to provide for stepped rules, non isotropic and ratio rules. Merge TwoLayersPhysicalrule in PhysicalRule, much simpler to suppress the management of derived classes. That means that we loose a little memory as some fields are mutually exclusive. Not a problem considering that there will not be so many of thoses objects. * New: In CRL/helpers.analogtechno.py, enhanced DTR support for rules like: ('minSpacing' , 'metal1', ((0.4,20.0), (0.8,1000.0)), Length, 'REF.1') ('minEnclosure', 'metal1', 'cut1', (0.2,0.3) , Length, 'REF.2') ('minDensity' , 'metal1', 0.30 , Unit , 'REF.3') The DTR parser has been updated, but not the oroshi.dtr Rule cache for analog components. Given a rule name, the value used will be the horizontal one of the first step. * Change: In hurricane/doc/hurricane, re-generate the documentation with updated support for Technology & PhysicalRule.
2020-07-21 04:22:04 -05:00
try:
if len(words) == 1:
if words[0].endswith('Cap' ): value = self.dtr.getUnitRule( words[0] ).getDoubleValue()
elif words[0].endswith('ContRes' ): value = self.dtr.getUnitRule( words[0] ).getDoubleValue()
elif words[0].endswith('Res' ): value = self.dtr.getUnitRule( words[0] ).getDoubleValue()
elif words[0].endswith('ctor90' ): value = self.dtr.getUnitRule( words[0] ).getDoubleValue()
elif words[0].endswith('ctor135' ): value = self.dtr.getUnitRule( words[0] ).getDoubleValue()
elif words[0].endswith('quares' ): value = self.dtr.getUnitRule( words[0] ).getDoubleValue()
if (value is None) and len(words) < 4:
rule = self.dtr.getPhysicalRule( *tuple(words) )
if rule.isDouble():
value = rule.getDoubleValue()
#print( 'Accessed value (Unit):{}'.format(value) )
else:
value = rule.getValue()
#print( 'Accessed value (DbU):{}'.format(DbU.getValueString(value)) )
Migration towards Python3, first stage: still based on C-Macros. * New: Python/C++ API level: * Write a new C++/template wrapper to get rid of boost::python * The int & long Python type are now merged. So a C/C++ level, it became "PyLong_X" (remove "PyInt_X") and at Python code level, it became "int" (remove "long"). * Change: VLSISAPD finally defunct. * Configuration is now integrated as a Hurricane component, makes use of the new C++/template wrapper. * vlsisapd is now defunct. Keep it in the source for now as some remaining non essential code may have to be ported in the future. * Note: Python code (copy of the migration howto): * New print function syntax print(). * Changed "dict.has_key(k)" for "k" in dict. * Changed "except Exception, e" for "except Exception as e". * The division "/" is now the floating point division, even if both operand are integers. So 3/2 now gives 1.5 and no longer 1. The integer division is now "//" : 1 = 3//2. So have to carefully review the code to update. Most of the time we want to use "//". We must never change to float for long that, in fact, represents DbU (exposed as Python int type). * execfile() must be replaced by exec(open("file").read()). * iter().__next__() becomes iter(x).__next__(). * __getslice__() has been removed, integrated to __getitem__(). * The formating used for str(type(o)) has changed, so In Stratus, have to update them ("<class 'MyClass'>" instead of "MyClass"). * the "types" module no longer supply values for default types like str (types.StringType) or list (types.StringType). Must use "isinstance()" where they were occuring. * Remove the 'L' to indicate "long integer" (like "12L"), now all Python integer are long. * Change in bootstrap: * Ported Coriolis builder (ccb) to Python3. * Ported Coriolis socInstaller.py to Python3. * Note: In PyQt4+Python3, QVariant no longer exists. Use None or directly convert using the python syntax: bool(x), int(x), ... By default, it is a string (str). * Note: PyQt4 bindings & Python3 under SL7. * In order to compile user's must upgrade to my own rebuild of PyQt 4 & 5 bindings 4.19.21-1.el7.soc. * Bug: In cumulus/plugins.block.htree.HTree.splitNet(), set the root buffer of the H-Tree to the original signal (mainly: top clock). Strangely, it was only done when working in full chip mode.
2021-09-19 12:41:24 -05:00
except Exception as e:
Enhanced techno rule support. Inspector support bug fix. * Bug: In Hurricane/Commons.h, modify the getRecord<>() templates so that for both vector<Element> and vector<Element*>, the individual record created for each element are donne with pointers. That is, for the vector<Element> case, we take a pointer. As a general policy, except for the POD types, always use pointers or references to data in the records/inspector. Never uses values that can call the copy constructor. Suppress INSPECTOR_PV_SUPPORT() macro, keep only INSPECTOR_PR_SUPPORT(). Provide value support only for getString<>() template. This value & copy constructor problem was causing a crash when trying to inspect Hurricane::AnalogCellExtension. * New: In Hurricane::Technology, change the API of the PhysicalRule, now we can only create/get PhysicalRule, but setting the value of the rule itself must be done on the rule. Enhance PhysicalRule to provide for stepped rules, non isotropic and ratio rules. Merge TwoLayersPhysicalrule in PhysicalRule, much simpler to suppress the management of derived classes. That means that we loose a little memory as some fields are mutually exclusive. Not a problem considering that there will not be so many of thoses objects. * New: In CRL/helpers.analogtechno.py, enhanced DTR support for rules like: ('minSpacing' , 'metal1', ((0.4,20.0), (0.8,1000.0)), Length, 'REF.1') ('minEnclosure', 'metal1', 'cut1', (0.2,0.3) , Length, 'REF.2') ('minDensity' , 'metal1', 0.30 , Unit , 'REF.3') The DTR parser has been updated, but not the oroshi.dtr Rule cache for analog components. Given a rule name, the value used will be the horizontal one of the first step. * Change: In hurricane/doc/hurricane, re-generate the documentation with updated support for Technology & PhysicalRule.
2020-07-21 04:22:04 -05:00
print( e )
if not value is None:
self.__dict__[attribute] = value
return