## 3 Theoretical Analysis
### Path Weight  
The timing slack of the path is given by  
\[t_{slack_{i}}=t_{r_{i}}-\sum_{j\in CIP_{i}}(\alpha_{j}*d_{C_{(i,j)}}+d_{N_{(i,j )}})-t_{s_{i}} \tag{3}\]  
where \(t_{slack}\) is the timing slack of the path. When \(t_{slack}\) is not lower than 0, the timing of the path is met, and the opposite is not met.  
Then we propose the concept of repairable timing, which means the total timing gain we can obtain when converting the path from all-HVT to all-LVT. The equation of the repairable timing is given by  
\[t_{repairable_{i}}=\sum_{j\in CIP_{j}}(\alpha_{H_{j}}*d_{CH_{(i,j)}}+d_{NH_{(i,j )}}-\alpha_{L_{j}}*d_{CL_{(i,j)}}-d_{NL_{(i,j)}}) \tag{4}\]  
Figure 4: An example of or-gate timing arcs.  
Figure 3: A path number example.  
where \(t_{repairable}\) is the repairable timing of the path, \(\alpha_{H_{j}}\), \(d_{CH_{(i)}}\), \(d_{NH_{(ij)}}\) is obtained when cell \(j\) is in HVT state, \(\alpha_{L_{j}}\), \(d_{CL_{(i)}}\), \(d_{NL_{(i)}}\) is obtained when cell \(j\) is in LVT state.  
Before distributing the threshold voltage, the circuit meets the timing at a given frequency. It means that the timing of the path will meet the constraint if the path is all-LVT. Thus, the sum of \(t_{repairable}\) and \(t_{slack}\) will not exceed 0. The path weight \(R_{i}\) is then given by  
\[R_{i}=-\frac{t_{slack_{i}}}{t_{repairable_{i}}},R_{i}\leq 1 \tag{5}\]  
When \(R_{i}\) is less than 0, it indicates that path \(i\) meets the timing. The closer \(R_{i}\) is to 1, the higher the proportion of LVT required within the path.  
When a cell is replaced, the path weight will be updated. The equation is given by  
\[\begin{split} U_{i}=-\frac{t_{slack_{i}}+(\alpha_{H_{u}}*d_{CH_{( j,\mu)}}+d_{NH_{(\mu)}}-\alpha_{L_{u}}*d_{CL_{(\mu)}}-d_{NL_{(\mu)}})}{t_{ repairable_{i}}-(\alpha_{H_{u}}*d_{CH_{(\mu)}}+d_{NH_{(\mu)}}-\alpha_{L_{u}}*d_{CL_{( \mu)}}-d_{NL_{(\mu)}})}\\ R_{i}^{{}^{\prime}}=\begin{cases}0&\text{if }U_{i}<\ 0\\ U_{i}&\text{if }U_{i}\geq 0\end{cases}\end{split} \tag{6}\]  
where \(n\) refers to the cell swapped from HVT to LVT. The value of \(R_{i}^{{}^{\prime}}\) becomes smaller after the update, which indicates that the probability of the remaining unreplaced cells being replaced with LVT decreases. When all paths' weight \(R\) does not exceed 0, all paths in the path collection have met the timing.  
The larger the value of \(R\), the more significant the proportion of LVT cells required by this path and the higher the probability of cells being replaced by LVT cells. If the low-probability cell is swapped first, the high-probability cell may still need to be swapped because the path timing constraint where it is located is tight. It can cause redundant replacements. Conversely, replacing high-probability cells will make many low-probability cells no longer need to be swapped. Therefore, it is necessary to prioritize the replacement of cells on paths with larger weights. Thus, in this paper, the algorithm prioritizes traversing the paths with larger \(R\) and then selects a cell on it for replacement and subsequent update \(t_{slack}\), \(t_{repairable}\), and \(R\), after which the above operation is iterated until all paths meet timing constraints.