From 3858461beb420184ef99305185f4b4b1e66e3ed1 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 22 May 2021 15:22:40 +0200 Subject: [PATCH] Added support for analog pad in Core2Chip & libresocio. --- .../src/plugins/alpha/block/configuration.py | 7 ++- .../src/plugins/alpha/core2chip/core2chip.py | 50 +++++++++++++------ .../src/plugins/alpha/core2chip/libresocio.py | 4 ++ 3 files changed, 44 insertions(+), 17 deletions(-) diff --git a/cumulus/src/plugins/alpha/block/configuration.py b/cumulus/src/plugins/alpha/block/configuration.py index 07804291..f1d6d896 100644 --- a/cumulus/src/plugins/alpha/block/configuration.py +++ b/cumulus/src/plugins/alpha/block/configuration.py @@ -1,4 +1,4 @@ -# + # This file is part of the Coriolis Software. # Copyright (c) SU 2020-2020, All Rights Reserved # @@ -629,6 +629,7 @@ class IoPadConf ( object ): def isClock ( self ): return self.flags & IoPadConf.CLOCK def isTristate ( self ): return self.flags & IoPadConf.TRISTATE def isBidir ( self ): return self.flags & IoPadConf.BIDIR + def isAnalog ( self ): return self._datas[0] & IoPin.ANALOG def __repr__ ( self ): s = '[^(]*)\((?P[\d]+)\)$' ) @@ -116,6 +117,7 @@ class IoNet ( object ): def isElem ( self ): return self._flags & IoNet.IsElem def isEnable ( self ): return self._flags & IoNet.IsEnable + def isAnalog ( self ): return self._flags & IoNet.IsAnalog def isGlobal ( self ): return self.isGlobal( self._name ) def isSpecial ( self ): return self._type != Net.Type.LOGICAL def setFlags ( self, flags ): self._flags |= flags @@ -137,9 +139,9 @@ class IoNet ( object ): def coronaNetName ( self ): s = self._name if self.coreNet.getDirection() & Net.Direction.IN: - s += '_from_pad' + s += '_from_pad' elif self.coreNet.getDirection() & Net.Direction.OUT: - s += '_to_pad' + s += '_to_pad' if self._flags & IoNet.IsElem: s += '({})'.format(self._index) return s @@ -169,6 +171,10 @@ class IoNet ( object ): if state == True: self._flags |= IoNet.IsEnable else: self._flags &= ~IoNet.IsEnable + def setAnalog ( self, state ): + if state == True: self._flags |= IoNet.IsAnalog + else: self._flags &= ~IoNet.IsAnalog + def buildNets ( self ): """ Creates the signals in corona and chip Cells, then connect them @@ -189,13 +195,15 @@ class IoNet ( object ): self.coreToChip.icore.getPlug( self.coreNet ).setNet( self.coronaNet ) # Chip "internal" net, connect Corona instance net to I/O inside the chip. if not self.chipIntNet: - internal_net = "internal_" + self.coronaNetName - self.chipIntNet = Net.create( self.coreToChip.chip, internal_net ) + chipIntNetName = "internal_" + self.coronaNetName + if self._flags & IoNet.IsAnalog: + chipIntNetName = self.coronaNetName + self.chipIntNet = Net.create( self.coreToChip.chip, chipIntNetName ) if netType != Net.Type.LOGICAL: self.chipIntNet.setType( netType ) self.coreToChip.icorona.getPlug( self.coronaNet ).setNet( self.chipIntNet ) # Chip "external" net, connected to the pad I/O to the outside world. - if self._flags & IoNet.PadPassthrough: + if self._flags & (IoNet.PadPassthrough | IoNet.IsAnalog): self.chipExtNet = self.chipIntNet elif not self.chipExtNet and (self._flags & IoNet.DoExtNet): self.chipExtNet = self.coreToChip.chip.getNet( self.chipExtNetName ) @@ -225,7 +233,8 @@ class IoPad ( object ): OUT = 0x0002 BIDIR = 0x0004 TRI_OUT = 0x0008 - UNSUPPORTED = 0x0010 + ANALOG = 0x0010 + UNSUPPORTED = 0x0020 @staticmethod def directionToStr ( direction ): @@ -233,6 +242,7 @@ class IoPad ( object ): if direction == IoPad.OUT: return "OUT" if direction == IoPad.BIDIR: return "BIDIR" if direction == IoPad.TRI_OUT: return "TRI_OUT" + if direction == IoPad.ANALOG: return "ANALOG" if direction == IoPad.UNSUPPORTED: return "UNSUPPORTED" return "Invalid value" @@ -254,6 +264,7 @@ class IoPad ( object ): s = '