We are performing translation and migration steps for a customer. We have a file containing information about the connectivity before translation and migration. This files tells us the name of nets as well as which Ref and pin number was connected to the net. This information is read into an association table. Similarly, we have found the nets of the translated board, and generated a similar table, containing also the name of nets and their connected Refs and pin numbers. This information is also stored in an association table.
The goal is to verify that the same nets exist, even if they have a different name now, and to verify that there have been no changes to connectivity. for this purpose, I am iterating on the current table in the outer loop, and iterating the legacy information in the inner loop. Due to performance concerns I wish to stop the inner iteration as soon as I have found a match and are thus using while-loops, rather than for/foreach.
My issue is that when I find a matching connectivity, I can't figure out how to get the key (netname) of the table entry. As seen below in the provided sample code, I am accessing the table entries with an index, rather than a key. How do I get the key associated with a particular table entry, found by index?
;Get an association table of all nets in the design, as well as the pins and referendes that are connected to it
netlist = GetBoardNetlist()
;Read the legacy file containing connectivity information.
LegConList = ReadLegacyConnections()
LegNetName = ""
foreach(netname netlist
j = 0
while(LegNetName == "" && j < length(LegConList)
boardConnections = netlist[netname]
legConnections = LegConList[j]
i = 0
while(LegNetName == "" && i < length(legConnections)
; IF the connections match, set LegNetName to the name of the table entry
)
)
)