On Identifying Patterns in Code Repositories to Assist the Generation of Hardware Templates
Adriano K. Sanches, João M. P. Cardoso · 2010
The identification of patterns on large repositories of code can be of paramount importance to guide the design of new hardware accelerators, to acquire the suitability of a certain hardware accelerator, and to generate application-specific architectures that maximize hardware reuse. This work intends to research and develop methods to both acquire the presence of a given pattern (map-suitability) and to identify common and highly similar patterns in code repositories (design-suggestions). The approach being proposed is based on a number of identification layers that refine the selections at each stage. We analyze two possible complementary options for a high-level layer. A first option is based on the representation of programs as a sequence of symbols and string matching and clustering algorithms are then used to expose similar patterns. A second option is based on tree matching techniques for identifying the presence of user's input patterns in the programs under inspection. We are evaluating our approach using the MiBench, MediaBench, UTDSP, and SNU code repositories. The results show the potential of our approach to identify approximate patterns that can be implemented by merging highly similar structures.