A method for scan chain wirelength optimization includes: obtaining root nodes details from the root nodes 302; optimizing a connectivity of the root nodes 304; identifying a best start node and a best end node for each of the root nodes 306; optimizing child nodes in each of the root nodes 308; determining that a wirelength of a full tour is shorter or longer than a nearest neighbour 310; and applying 312 or skipping 314 a solution. A Q-table may be initialised by setting its values to zero or a uniform value, the total wirelength of a root node tour may be measured and the Q-table updated. Nodes which have not been visited in a current exploration may be selected, a likelihood of success based on a current Q value and wirelength may be calculated, and a node chosen based on the likelihood of success.
Scan chain wirelength optimization using Q-learning based reinforcement learning