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 ):
self._id = IoPadSpec.id
IoPadSpec.id += 1
def setAnalog ( self ):
self.side |= IoPin.ANALOG
def addNets ( self, nets ):
self.nets += nets
......@@ -128,12 +131,10 @@ class IoSpecs ( object ):
with open(fileName) as fd:
datas = utf8toStr( json.loads( fd.read(), object_hook=utf8toStr )
, ignoreDicts=True )
# check if pad is analog or not: last spec item starts with "A"
analog = IoPin.ANALOG if padDatas[-1][0] == 'A' else 0
self.addIoPadSpecs(datas['pads.east' ], IoPin.EAST | analog )
self.addIoPadSpecs(datas['pads.west' ], IoPin.WEST | analog )
self.addIoPadSpecs(datas['pads.north'], IoPin.NORTH | analog )
self.addIoPadSpecs(datas['pads.south'], IoPin.SOUTH | analog )
self.addIoPadSpecs(datas['pads.east' ], IoPin.EAST )
self.addIoPadSpecs(datas['pads.west' ], IoPin.WEST )
self.addIoPadSpecs(datas['pads.north'], IoPin.NORTH )
self.addIoPadSpecs(datas['pads.south'], IoPin.SOUTH )
for padDatas in datas['pads.instances']:
padName = padDatas[0]
......@@ -145,6 +146,10 @@ class IoSpecs ( object ):
end = None
# remove the direction info: + output - input * bi-directional
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] )
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