{'fraction_non_alphanumeric': 0.019400352733686066, 'fraction_numerical': 0.0, 'mean_word_length': 4.973684210526316, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
High-Level Synthesis Oriented Restructuring of Functions with While Loops

The usage of high-level synthesis (HLS) tools for FPGAs has increased significantly over the last years since they matured and allow software programmers to take advantage of reconfigurable hardware technology. Most HLS tools employ methods to optimize for loops, e. g. by unrolling or pipelining them. But there is hardly any work on the optimization of while loops. This comes at no surprise since most while loops have loop-carried dependences involving the loop condition which result in large recurrence cycles in the dataflow graphs. Therefore typical while loops cannot be parallelized or pipelined. We propose a novel transformation which allows to optimize while loops nested within a for loop. By interchanging the two loops, it is possible to pipeline (and thereby parallelize) the inner loop, resulting in a reduced execution time. We present two case studies on different hardware platforms and show the speedup factors - compared to a host processor and to an unoptimized hardware implementation - achieved by our while loop optimization method.