Patent ID: 8516432

Claim:
A structural reconstruction method for reconstructing a plurality of scan chains, the method comprising: setting up a first preference sequence for a plurality of scanning elements in each of the plurality of scan chains respectively; setting up a secondary preference sequence for the plurality of scan chains in each of the plurality of scanning elements respectively; and executing, using a computer, two-way selection between the plurality of scan chains and the plurality of scanning elements based on the corresponding first preference sequence and the second preference sequence, at least some of the plurality of scanning elements redistributable to the plurality of scan chains, the two-way selection further comprising: selecting an available scanning element from a set of available scanning elements; locating, from the plurality of scan chains, a scan chain with a top priority of preference based on the second preference sequence of the available scanning element; determining whether the scan chain has undergone full distribution; distributing the available scanning element to the scan chain and removing it from the set of the available scanning elements in response to a determination that the scan chain has not undergone full distribution; and determining whether there is a scanning element in the scan chain with a preference priority lower than the available scanning element in response to a determination that the scan chain has undergone full distribution.