## 5 Adaptive Core Distribution Optimization Algorithm
### Example of Topology Reconfiguration in REmesh NoC  
To delve deeper into the study of physical topology reconfiguration processes and to explore suitable algorithms for topology reconfiguration, this section provides an analysis and demonstration of a topology reconfiguration example for a 2D REmesh-based NoC network. The following figures present a feasible solution for an example of 2D REmesh topology reconfiguration.  
Figure 4a presents an \(8\times 8\) REmesh architecture that includes one column of redundant cores. Initially, the \(8\times 8\) routing frame in the upper left corner serves as the default working frame, with each router individually connected to its corresponding lower right core. The cores in the rightmost column remain dormant. When a processor core failure occurs, the system identifies it as non-operational, disrupting the original regular \(8\times 8\) physical topology and affecting the system's virtual topology. To reconfigure the system's physical  
topology, the NoC activates redundant resources and broadcasts a topology reconfiguration message, enabling the REmesh to reestablish an \(8\times 8\) 2D REmesh physical topology.  
Figure 4: Example of topology reconfiguration in REmesh NoC: (**a**) initial topology, (**b**) upper left search for reconfigured topology, (**c**) upper right search for reconfigured topology, (**d**) lower left search for reconfigured topology, (**e**) lower right search for reconfigured topology, and (**f**) target topology.  
As shown in the figure above, cores 15, 23, 31, 36, 37, 51, 59, and 72 have experienced failures and are unable to connect to their respective routers. In this example, we use different colors to represent successfully connected routers and processor cores, as well as routers and processor cores with failed or redundant connections, and the red dashed box outlines the primary area where the failed cores are concentrated. The detailed procedure for topology reconfiguration is shown below:  
**Step 1:** Initialize the sliding window size to 8\(\times\)8, position it initially in the upper left corner of the entire NoC network topology. Search within this region and determine that the faulty cores are concentrated in the middle. Then, search forward and reverse directions in a clockwise direction until the entire region of the sliding window has been explored. The results are shown in Figure 4b.  
**Step 2:** Move the sliding window to the right, position it in the upper right corner, and search within this region. Here, the faulty cores are concentrated in the upper half. Search the forward direction in an anticlockwise direction and the reverse direction in a clockwise direction. Update the connections between the routers and cores at this point. The results are shown in Figure 4c.  
**Step 3:** Shift the sliding window downward to the lower left corner and search within this area. The faulty cores are now concentrated in the right half of the area. Search the forward direction in a clockwise direction and the reverse direction in an anticlockwise direction. Update the topology and connections accordingly. The results are shown in Figure 4d.  
**Step 4:** Move the sliding window to the right, position it in the lower right corner, and repeat the previous operations. The faulty cores are concentrated in the upper half. Search the forward direction in an anticlockwise direction and the reverse direction in a clockwise direction. The results are shown in Figure 4e.  
**Step 5:** Continue moving the sliding window to cover the top left, top right, bottom left, and bottom right positions until the entire NoC network has been traversed. The final updated results are shown in Figure 4f. At this point, the traversal is complete, and the area marked in green represents the correctly reconfigured 8 \(\times\) 8 physical topology.