HOME       UP       PREV       NEXT (Overcoming Structural Hazards using Holding Registers)  

Array Hazards in RTL Continued

Expanding blocking assignments can lead to name alias hazards:
Suppose we know nothing about xx and yy, then consider:
 begin
   ... 
   if (g) Foo[xx] = e1;
   r2 = Foo[yy];
To avoid name alias problems, this must be compiled to non-blocking pure RTL as:
 begin
   ...
   Foo[xx] <= (g) ? e1: Foo[xx];
   r2 <= (xx==yy) ? ((g) ? e1:  Foo[xx]): Foo[yy];
Quite commonly we do know something about the subscript expressions.

If they are compile-time constants, we can decidedly check the equality at compile time.

Suppose that at ... or elsewhere beforehand we had the line `yy = xx+1;' or equivalent knowledge? Then with sufficient rules we can realise at compile time they will never alias. However, no set of rules will be complete (decidability).


41: (C) 2008-13, DJ Greaves, University of Cambridge, Computer Laboratory. Flash Player Upgrade Needed   PLAY/PAUSE  READY    STOP DOWNLOAD