assembly: fix AsmElement.make()

Fixes #230
This commit is contained in:
Zheng, Lei 2019-04-13 08:13:33 +08:00
parent cad2e8f86a
commit 49812ba3b5

View File

@ -833,14 +833,15 @@ class AsmElement(AsmBase):
# This give us reference to child assembly's immediate child
# without trailing dot.
prefix = subname[:-len(ret.Subname)+1]
prefix = subname[:-len(ret.Subname)-1]
# Pop the immediate child name, and replace it with child
# assembly's element group name
prefix = prefix[:prefix.rfind('.')+1] + \
resolveAssembly(ret.Assembly).getElementGroup().Name
# Pop the immediate child name
prefix = prefix[:prefix.rfind('.')]
subname = '{}.${}.'.format(prefix,element.Label)
# Finally, generate the subname, by combining the prefix with
# the element group index (i.e. the 1 below) and the linked
# element label
subname = '{}.1.${}.'.format(prefix,element.Label)
else:
raise RuntimeError('Invalid selection {}.{}'.format(