2018 Volume 11 Pages 46-56
High-level synthesis (HLS) significantly reduces hardware design time. Unfortunately, the users of HLS usually have to manually rewrite algorithm C code for satisfactory synthesis results. These manual tunings of C code often cause extra design time and decrease the advantage of HLS. One of such manual tunings is array access optimization. Large arrays are implemented as RAMs in HLS, so reducing array accesses in C code can increase performance of synthesized hardware since access conflicts to the RAMs are reduced. Furthermore, the removal of all accesses to arrays leads to the complete removal of the RAMs corresponding to the arrays. By successful application of scalar replacement to C code, data read from RAMs or written to RAMs are stored in shift registers, and these shift registers are accessed instead of the RAMs when reusing the accessed data, thus array accesses are completely removed. Unfortunately, the most advanced scalar replacement method for nested loops cannot appropriately handle array accesses with constant subscripts. This paper proposes a scalar replacement method to solve the problem. In particular, we target a subset of C code called Static Control Part (SCoP) for which we can build the mathematical representation called the polyhedral model. The proposed method builds elaborate reuse information tables with the polyhedral model. Differently from the previous method, the proposed method replaces each reuse destination that has multiple reuse vectors with scalar variables. These scalar variables are referenced conditionally according to the conditions in the reuse information tables. With the experimental results, we demonstrate that the proposed method decreases the area of synthesized hardware significantly and improves circuit performance compared to the most advanced scalar replacement method for nested loops in the case of C code which contain array accesses with constant subscripts.