cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
benedetto73
Adventurer
Adventurer
261 Views
Registered: ‎09-30-2019

top level function dependencies not honored (or not specified?)

I am writing c++ kernels targeting Alveo (Vitis on Linux Ubuntu).  HW Emulation.

 

I have a big kernel (pseudo code below) that computes several arrays (each array is on a different HBM bank/port) in a hierchical fashion.

Now... assuming that I got all the banks right (and SW EMU gives me that certainty)... what I observe is that the scond process4 starts before its process2 end.
Depending on how I rearrange the code I can also have that broken dependency between Process1 and Process2. 
All Process functions have DATAFLOW inside, but the top level function is plain and simple.

 

Question: am I missing something?
How do I enforce the dependencies?


void process1FromTo(B512 *in, B512* out, uint32 size)
{
...
}

typedef ap_uint<512> B512;
void kernel(B512 *hbm0, B521 *hbm1, ....   B512 *hbm15, uint32 size)
{
     // reads from hbm0... processes data... writes to hbm8
     process1FromTo(hbm0, hbm8, size);
     process1FromTo(hbm1, hbm9, size);
     process1FromTo(hbm2, hbm10, size);
     process1FromTo(hbm3, hbm11, size);
     process1FromTo(hbm4, hbm12, size);
     process1FromTo(hbm5, hbm13, size);
     process1FromTo(hbm6, hbm14, size);
     process1FromTo(hbm7, hbm15, size);

     // reads from hbm8 and hbm9... processes data... writes to hbm0 and hbm1
     process2FromTo(hbm8, hbm9, hbm0, hbm1, size*2);
     process2FromTo(hbm10, hbm11, hbm2, hbm3, size*2);
     process2FromTo(hbm12
, hbm13, hbm4, hbm5, size*2);
     process2FromTo(hbm14, hbm15, hbm6, hbm7, size*2);

     // reads from hbm0-3 ... processes data... writes to hbm8-11
     process4FromTo(hbm0, hbm1, hbm2, hbm3, hbm8, hbm9, hbm10, hbm11, size*4);
     process4FromTo(hbm4, hbm5, hbm6, hbm7, hbm12, hbm13, hbm14, hbm15, size*4);

     // reads from hbm8-15 ... processes data... writes to hbm0-7
     process8FromTo(hbm8, hbm9, hbm10, hbm11, hbm12, hbm13, hbm14, hbm15,
                    hbm0, hbm1, hbm2, hbm3, hbm4, hbm5, hbm6, hbm7,
                    size*8);
}

 

Tags (3)
bad order.png
0 Kudos
0 Replies