Merge pull request #164 from mithro/global-fix

Fix spelling and io_X/GLOBAL_OUTPUT_NETWORK
This commit is contained in:
Clifford Wolf 2018-07-10 21:20:20 +02:00 committed by GitHub
commit 2d1f1f6258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -293,7 +293,7 @@ def revert_to_fabout(x, y, net):
for i, xy in enumerate(GLB_NETWK_INTERNAL_TILES): for i, xy in enumerate(GLB_NETWK_INTERNAL_TILES):
if net == 'glb_netwk_%d' % i and (x, y) == xy: if net == 'glb_netwk_%d' % i and (x, y) == xy:
return 'fabout' return 'fabout'
raise ParseError("{} is a global netowrk, but not at an expectd location {} {}".format(net, x, y)) raise ParseError("{} is a global network, but not at an expected location {} {}".format(net, x, y))
return net return net
@ -956,7 +956,7 @@ class IOTile(Tile):
if fields == ['io_1'] and self.blocks[1] is None: if fields == ['io_1'] and self.blocks[1] is None:
self.blocks[1] = IOBlock(self, 1) self.blocks[1] = IOBlock(self, 1)
return self.blocks[1] return self.blocks[1]
raise ParseError("Unepxected new block in {}".format(type(self).__name__)) raise ParseError("Unexpected new block in {}".format(type(self).__name__))
class IOBlock: class IOBlock:
def __init__(self, tile, index): def __init__(self, tile, index):
@ -1006,7 +1006,9 @@ class IOBlock:
self.enable_input = True self.enable_input = True
elif fields == ['disable_pull_up'] and not self.disable_pull_up: elif fields == ['disable_pull_up'] and not self.disable_pull_up:
self.disable_pull_up = True self.disable_pull_up = True
elif fields[0] == 'GLOBAL_BUFFER_OUTPUT' and fields[1] == '->' \ elif fields[0] in ('GLOBAL_BUFFER_OUTPUT',
'io_%d/GLOBAL_BUFFER_OUTPUT' % self.index) \
and fields[1] == '->' \
and fields[2].startswith('glb_netwk_'): and fields[2].startswith('glb_netwk_'):
if GLB_NETWK_EXTERNAL_BLOCKS[int(fields[2][10:])] \ if GLB_NETWK_EXTERNAL_BLOCKS[int(fields[2][10:])] \
!= (self.tile.x, self.tile.y, self.index): != (self.tile.x, self.tile.y, self.index):