Commit ed3bdbe4 authored by Luke Leighton's avatar Luke Leighton
Browse files

un-messed-up IoSpecs.loadFromPinmux, add new function for

making a pad Analog
parent ac3e78c5
...@@ -67,6 +67,9 @@ class IoPadSpec ( object ): ...@@ -67,6 +67,9 @@ class IoPadSpec ( object ):
self._id = IoPadSpec.id self._id = IoPadSpec.id
IoPadSpec.id += 1 IoPadSpec.id += 1
def setAnalog ( self ):
self.side |= IoPin.ANALOG
def addNets ( self, nets ): def addNets ( self, nets ):
self.nets += nets self.nets += nets
...@@ -128,12 +131,10 @@ class IoSpecs ( object ): ...@@ -128,12 +131,10 @@ class IoSpecs ( object ):
with open(fileName) as fd: with open(fileName) as fd:
datas = utf8toStr( json.loads( fd.read(), object_hook=utf8toStr ) datas = utf8toStr( json.loads( fd.read(), object_hook=utf8toStr )
, ignoreDicts=True ) , ignoreDicts=True )
# check if pad is analog or not: last spec item starts with "A" self.addIoPadSpecs(datas['pads.east' ], IoPin.EAST )
analog = IoPin.ANALOG if padDatas[-1][0] == 'A' else 0 self.addIoPadSpecs(datas['pads.west' ], IoPin.WEST )
self.addIoPadSpecs(datas['pads.east' ], IoPin.EAST | analog ) self.addIoPadSpecs(datas['pads.north'], IoPin.NORTH )
self.addIoPadSpecs(datas['pads.west' ], IoPin.WEST | analog ) self.addIoPadSpecs(datas['pads.south'], IoPin.SOUTH )
self.addIoPadSpecs(datas['pads.north'], IoPin.NORTH | analog )
self.addIoPadSpecs(datas['pads.south'], IoPin.SOUTH | analog )
for padDatas in datas['pads.instances']: for padDatas in datas['pads.instances']:
padName = padDatas[0] padName = padDatas[0]
...@@ -145,6 +146,10 @@ class IoSpecs ( object ): ...@@ -145,6 +146,10 @@ class IoSpecs ( object ):
end = None end = None
# remove the direction info: + output - input * bi-directional # remove the direction info: + output - input * bi-directional
if padDatas[-1][-1] in '+-*': end = -1 if padDatas[-1][-1] in '+-*': end = -1
# check if pad is analog or not: last spec item starts with "A"
if padDatas[-1][0] == 'A':
self._ioPadsLUT[padName].setAnalog()
# add the nets to the pad
self._ioPadsLUT[padName].addNets( padDatas[1:end] ) self._ioPadsLUT[padName].addNets( padDatas[1:end] )
trace( 560, '-' ) trace( 560, '-' )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment