HOME       UP       PREV       NEXT (HLS Compiler Operational Phases)  

A Simple Worked Example: Classical HLS of Multiply

Take a non-rentrant function:

that achieves the same behaviour.
int multiply(int A, int B)
{ RA=A   // This is our source code
  RB=B
  RC=0
  while(RA>0)
  {
    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 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-17, DJ Greaves, University of Cambridge, Computer Laboratory.