fix shortcut generate error

This commit is contained in:
yyc12345 2020-04-14 10:18:01 +08:00
parent 73b7d96795
commit bbd3ba2e3a

View File

@ -395,21 +395,23 @@ def buildCell(exDb, deDb, target, currentGraphBlockCell):
# query all links(don't need to consider export pIO, due to it will not add # query all links(don't need to consider export pIO, due to it will not add
# any shortcut) # any shortcut)
createdShortcut = set()
exCur.execute("SELECT * FROM pLink WHERE [belong_to] == ?", (target,)) exCur.execute("SELECT * FROM pLink WHERE [belong_to] == ?", (target,))
for i in exCur.fetchall(): for i in exCur.fetchall():
# check export pIO. # check export pIO.
if ((i[2] == target) and (i[0] in graphPIO) or (i[6] == target) and (i[1] in graphPIO)): if (((i[2] == target) and (i[0] in graphPIO)) or ((i[6] == target) and (i[1] in graphPIO))):
# fuck export param # fuck export param
continue continue
# analyse 5 chancee one by one # analyse 5 chancee one by one
if (i[7] == dcv.dbPLinkInputOutputType.PTARGET or i[7] == dcv.dbPLinkInputOutputType.PIN): if (i[7] == dcv.dbPLinkInputOutputType.PTARGET or i[7] == dcv.dbPLinkInputOutputType.PIN):
if (i[3] == dcv.dbPLinkInputOutputType.PLOCAL): if (i[3] == dcv.dbPLinkInputOutputType.PLOCAL):
if i[2] in allLocal: if i[2] in allLocal or i[2] in createdShortcut:
cache = localUsageCounter[i[2]] cache = localUsageCounter[i[2]]
else: else:
cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.PLOCAL) cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.PLOCAL)
localUsageCounter[i[2]] = cache localUsageCounter[i[2]] = cache
createdShortcut.add(i[2])
cache.count += 1 cache.count += 1
cache.lastUse = i[6] cache.lastUse = i[6]
@ -418,8 +420,12 @@ def buildCell(exDb, deDb, target, currentGraphBlockCell):
elif (i[3] == dcv.dbPLinkInputOutputType.PIN): elif (i[3] == dcv.dbPLinkInputOutputType.PIN):
if i[2] not in blockSet: if i[2] not in blockSet:
cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.PIN) if i[0] not in createdShortcut:
localUsageCounter[i[0]] = cache cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.PIN)
localUsageCounter[i[0]] = cache
createdShortcut.add(i[0])
else:
cache = localUsageCounter[i[0]]
cache.count+=1 cache.count+=1
cache.lastUse = i[6] cache.lastUse = i[6]
@ -427,8 +433,12 @@ def buildCell(exDb, deDb, target, currentGraphBlockCell):
cache.lastIndex = i[9] cache.lastIndex = i[9]
else: else:
if i[2] not in blockSet: if i[2] not in blockSet:
cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.POUT) if i[0] not in createdShortcut:
localUsageCounter[i[0]] = cache cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.POUT)
localUsageCounter[i[0]] = cache
createdShortcut.add(i[0])
else:
cache = localUsageCounter[i[0]]
cache.count+=1 cache.count+=1
cache.lastUse = i[6] cache.lastUse = i[6]
@ -436,11 +446,12 @@ def buildCell(exDb, deDb, target, currentGraphBlockCell):
cache.lastIndex = i[9] cache.lastIndex = i[9]
else: else:
if (i[7] == dcv.dbPLinkInputOutputType.PLOCAL): if (i[7] == dcv.dbPLinkInputOutputType.PLOCAL):
if i[6] in allLocal: if i[6] in allLocal or i[6] in createdShortcut:
cache = localUsageCounter[i[6]] cache = localUsageCounter[i[6]]
else: else:
cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.PLOCAL) cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.PLOCAL)
localUsageCounter[i[6]] = cache localUsageCounter[i[6]] = cache
createdShortcut.add(i[6])
cache.count += 1 cache.count += 1
cache.lastUse = i[2] cache.lastUse = i[2]
@ -448,8 +459,12 @@ def buildCell(exDb, deDb, target, currentGraphBlockCell):
cache.lastIndex = i[5] cache.lastIndex = i[5]
else: else:
if i[6] not in blockSet: if i[6] not in blockSet:
cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.POUT) if i[1] not in createdShortcut:
localUsageCounter[i[1]] = cache cache = dcv.LocalUsageItem(0, True, dcv.LocalUsageType.POUT)
localUsageCounter[i[1]] = cache
createdShortcut.add(i[1])
else:
cache = localUsageCounter[i[1]]
cache.count += 1 cache.count += 1
cache.lastUse = i[2] cache.lastUse = i[2]