Take a non-rentrant function:
int multiply(int A, int B) // A simple long multiplier with variable latency. { RA=A; // Not RTL: The while loop trip count is data-dependent. RB=B; // RC=0; // while(RA>0) // Let's make a naive HLS of this program... { if odd(RA) RC = RC + RB; RA = RA >> 1; RB = RB << 1; } return RC; }
This simple example has no multi-cycle primitives and a 1-to-1 mapping of ALUs to the source code text, so no schedulling was needed from the HLS tool.
Each register has a multiplexor that ranges over all the places it is loaded from.
We followed a syntax-directed approach (also known as a constructive approach) with no search in the solution space for minimum clock cycles or minium area or maximum clock frequency.
The resulting block could serve as a primitive to be instantiated by an HLS tool. This example is not fully-pipelined and so typically would not be used for that purpose.
12: (C) 2008-18, DJ Greaves, University of Cambridge, Computer Laboratory. |