
----------------------------------------------------------
High-level Synthesis: Resource Allocation and Scheduling
----------------------------------------------------------

In general, the Averest compiler generates for each expression also a guarded action. Thus, the set of guarded actions may contain hundreds of multipliers, adders etc. Most high-level synthesis tools perform a resource allocation and scheduling phase to reduce the amount of used functional components. Resource allocation and scheduling are currently not performed by the Averest compiler, but can be easily integrated as described below.

Assume the guarded actions were already sorted to equations, one for each writeable variable. Then, this equation system can be seen as a large combinational circuit that can be segmented into stages. This step is the scheduling phase since it is assumed that each segment is computed within one cycle of the hardware circuit, and therefore the segmentation defines a schedule for the computation of the actions of a macro step. Note that each macro step of the synchronous program is now executed in several cycles of the hardware circuit, since in each cycle the hardware circuit will perform the actions of one segment.

Resource allocation consist then in mapping the operations of the identified segments to the available functional units, e.g. addition operations of different segments can be performed by the same adder circuit. Clearly, the maximal number of occurrences of an operation in the segments determines the number of functional units for this operation.

In the extreme case, we could perform one operation per segment which would then lead to sequential code. This is very space efficient, but slow, and clearly, using more functional units allows the definition of larger and thus fewer segments, and therefore fewer hardware cycles per macro step.


Sharing operations can be even done at the level of guarded actions without splitting macro steps into sub-steps as follows: Given two guarded actions (phi1,y1=x11 + x12) and (phi2,y2=x21 + x22), one can share the operation + by replacing these two guarded actions by the following new guarded actions using an abbreviation (local) variable z:

   (phi1 | phi2, z = (phi1?x11:x21) + (phi1?x12:x22))
   (phi1, y1 = z)
   (phi2, y2 = z)

It is however required that ph1 excludes phi2 for the above transformation, and the transformation only makes sense for operations + that are more expensive than two multiplexers.

