We present a formulation of retiming to minimize the number of registers in a design by iterating a maximum network flow problem. The retiming returned will be the optimum one which involves the minimum amount of register movement. Because all flows are unitary, the problem can be simplified to binary marking. Existing methods solve this problem as an instance of minimum cost network flow, an algorithmically and practically more difficult problem than maximum flow. Our algorithm has a worst-case bound of O(R2 E). We demonstrate on a set of circuits that our formulation is 5x faster than minimum cost-based methods. Delay constraints, which are problematic in the existing methods, are actually a simplifying assumption in our variant, albeit at the loss of optimality in register count.
Aaron P. Hurst, Alan Mishchenko, Robert K. Brayton