diff --git a/crlcore/python/helpers/__init__.py b/crlcore/python/helpers/__init__.py index c8cbd5df..16243a53 100644 --- a/crlcore/python/helpers/__init__.py +++ b/crlcore/python/helpers/__init__.py @@ -316,3 +316,23 @@ def staticInitialization ( quiet=False ): if not quiet: print ' - <%s>' % sysConfDir initTechno( quiet ) return + + +def netDirectionToStr ( netDir ): + flags = [ '-', '-', '-', '-', '-' ] + if netDir & Hurricane.Net.Direction.DirIn: flags[0] = 'i' + if netDir & Hurricane.Net.Direction.DirOut: flags[1] = 'o' + if netDir & Hurricane.Net.Direction.ConnTristate: flags[2] = 't' + if netDir & Hurricane.Net.Direction.ConnWiredOr: flags[3] = 'w' + + s = flags[0]+flags[1]+flags[2]+flags[3]+' ' + if netDir == Hurricane.Net.Direction.UNDEFINED: s += '(UNDEFINED)' + elif netDir == Hurricane.Net.Direction.IN: s += '(IN)' + elif netDir == Hurricane.Net.Direction.OUT: s += '(OUT)' + elif netDir == Hurricane.Net.Direction.INOUT: s += '(INOUT)' + elif netDir == Hurricane.Net.Direction.TRISTATE: s += '(TRISTATE)' + elif netDir == Hurricane.Net.Direction.TRANSCV: s += '(TRANSCV)' + elif netDir == Hurricane.Net.Direction.WOR_OUT: s += '(WOR_OUT)' + elif netDir == Hurricane.Net.Direction.WOR_INOUT: s += '(WOR_INOUT)' + else: s += '(UNKNOWN)' + return s diff --git a/cumulus/src/plugins/core2chip/CoreToChip.py b/cumulus/src/plugins/core2chip/CoreToChip.py index a87e1492..a4667b4b 100644 --- a/cumulus/src/plugins/core2chip/CoreToChip.py +++ b/cumulus/src/plugins/core2chip/CoreToChip.py @@ -20,6 +20,7 @@ from Hurricane import Net from Hurricane import Instance from CRL import Catalog from CRL import AllianceFramework +from helpers import netDirectionToStr from helpers.io import ErrorMessage @@ -180,7 +181,8 @@ class CoreToChip ( object ): def _buildStandardPad ( self, ioNet ): if not self.ioPads.has_key(ioNet.coreNet.getDirection()): raise ErrorMessage( 1, 'CoreToChip._buildStandardPad(): Unsupported direction %d for core net "%s".' \ - % ioNet.coreNet.getName() ) + % (netDirectionToStr(ioNet.coreNet.getDirection()) + ,ioNet.coreNet.getName()) ) padInfo = self.ioPads[ ioNet.coreNet.getDirection() ] diff --git a/hurricane/src/isobar/PyNetDirection.cpp b/hurricane/src/isobar/PyNetDirection.cpp index b940bd7b..85468bcd 100644 --- a/hurricane/src/isobar/PyNetDirection.cpp +++ b/hurricane/src/isobar/PyNetDirection.cpp @@ -93,11 +93,18 @@ extern "C" { { PyObject* constant; - LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::UNDEFINED,"UNDEFINED"); - LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::IN ,"IN"); - LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::OUT ,"OUT"); - LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::INOUT ,"INOUT"); - LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::TRISTATE ,"TRISTATE"); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::DirIn ,"DirIn" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::DirOut ,"DirOut" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::ConnTristate,"ConnTristate"); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::ConnWiredOr ,"ConnWiredOr" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::UNDEFINED ,"UNDEFINED" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::IN ,"IN" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::OUT ,"OUT" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::INOUT ,"INOUT" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::TRISTATE ,"TRISTATE" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::TRANSCV ,"TRANSCV" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::WOR_OUT ,"WOR_OUT" ); + LoadObjectConstant(PyTypeNetDirection.tp_dict,Net::Direction::WOR_INOUT ,"WOR_INOUT" ); }