UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
377 Views
Registered: ‎12-12-2018

successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

my code looks something like this:(many for loops )

main
{
   for( 4)
  {
      for (int xShift = 0; xShift < R * 2; xShift = xShift + h)
      {
          for (int yShift = 0; yShift < R * 2; yShift = yShift + h)
          {
           #pragma SDS async(1)
              for (int row = 0;row < rowNum; row++)
             {
                for (int col = 0; col < colNum; col++)
                 {
                   foo1:
                      .......
                 }
             }
             #pragma SDS wait(1)
             foo:,,,,,,
             #pragma SDS async(2)
             for (int row = 0;row < rowNum; row++)
             {
                 for (int col = 0; col < colNum; col++)
                {
                  foo2:
                    .......
                }
             }
             #pragma SDS wait(2)
             ......

  }
}

 many for loops in for loops,

the result my code running  in fpga is :

image.png

 

i think,maybe my code for loop is too much, out of the number of async uses ,but,for loop is must,  how should i modify my code so that my code compiles properly? 

that's noted that my hw function can;t hold any more for loop .

my hw  function ,such as :

void fftshift_adaptive(int dx, int dy,float *l_real,float *l_imag, int rowNum, int colNum, int R)
{

	int start = (dx * colNum + dy) * R * 2 * R * 2;
	for (int ref_row = 0; ref_row< R; ref_row++)
	{
		for (int ref_col = 0; ref_col < R * 2; ref_col++)
		{
			#pragma HLS pipeline
			int dst_col = (ref_col < R) ? ref_col + R : ref_col - R;
			int dst_row = ref_row + R;
			float temp;
			int exchenge1 = start + ref_row * R * 2 + ref_col;
			int exchenge2 = start + dst_row * R * 2 + dst_col;
			temp = l_real[exchenge1];
			l_real[exchenge1] = l_real[exchenge2];
			l_real[exchenge2] = temp;
		}
	}
}

Somebady help me, i'm going crazy :(

0 Kudos
8 Replies
Xilinx Employee
Xilinx Employee
351 Views
Registered: ‎08-20-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

Hi @mu_yu 

First mistake in your code is location of async pragma.

The ASYNC pragma should be specified immediately preceding a call to a hardware function.

https://www.xilinx.com/content/dam/xilinx/support/documentation/sw_manuals/xilinx2018_2/ug1253-sdx-pragma-reference.pdf

Please refer below example.

async_ex.PNGasync_ex1.PNG

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Adventurer
Adventurer
338 Views
Registered: ‎12-12-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

thanks for your reply very much,

 

i tried to comment out all the "#pragma async"comments, and the result was that it would print as normal,but when the 96th iteration,the program terminates.

and there are no nothing errors or prompts.

that's why?

is it because i have applied for hardward functions too many times?

resulting in insufficient memory on the pl side,?

or , maybe, because  i was writing pragma code is wrong?

my hw function .h file such as :

#pragma SDS data zero_copy(l_real[0:rows * cols],l_imag[0:rows * cols],r_real[0:rows * cols],r_imag[0:rows * cols],s_real[0:rows * cols],s_imag[0:rows * cols]) void fpgaCrossPower(float *l_real, float *l_imag,float *r_real, float *r_imag,float *s_real,float *s_imag,int rows,int cols);

 

 have you ever had such a problem??no errors were reported,but the program did not run on the fpga platform(zcu104).

0 Kudos
Xilinx Employee
Xilinx Employee
332 Views
Registered: ‎08-20-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

Hi @mu_yu 

SDSoC will not give errors for pragmas as Pragma is considered as rule.

That's why you did not get any error when it was placed wrong.

1. When you are using zero_copy, it is mandatory to use sds_alloc for memory allocation

Refer this example https://github.com/Xilinx/SDSoC_Examples/tree/master/cpp/getting_started/hello_vadd

 

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Adventurer
Adventurer
239 Views
Registered: ‎12-12-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

of course, that's what i do ,every zero_copy , i use sds_alloc for memory allocation, such as : float * D_leftImage = (float *) sds_alloc (sizeof(float) * height * width); float * D_rightImage = (float *) sds_alloc (sizeof(float) * height * width); //set 0 float * l_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum); float * l_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum); float * r_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum); float * r_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum); float * s_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum); float * s_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum); float * res = (float *) sds_alloc (sizeof(float) * height * width * 2); float * hamming = (float *) sds_alloc (sizeof(float) * 2 * R * 2 * R); if sdsoc doesn't give errors as pragma is considered as rule ,maybe ,it's not because i'm using zero_copy. could it be something else,
0 Kudos
Adventurer
Adventurer
323 Views
Registered: ‎12-12-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

of course, that's what i do ,every zero_copy , i use sds_alloc for memory allocation,

such as :

float * D_leftImage = (float *) sds_alloc (sizeof(float) * height * width);

float * D_rightImage = (float *) sds_alloc (sizeof(float) * height * width);

//set 0

float * l_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

float * l_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

float * r_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

float * r_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

float * s_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

float * s_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

float * res = (float *) sds_alloc (sizeof(float) * height * width * 2);

float * hamming = (float *) sds_alloc (sizeof(float) * 2 * R * 2 * R);

if sdsoc doesn't give errors as pragma is considered as rule

,maybe ,it's not because i'm using zero_copy.

could it be something else,

i wonder if calling hardware function too many times is allowed?

or,is it possible that there isn't enough memory on the pl side?

if the platform encounters these two situations ,will it not give an error?

0 Kudos
Xilinx Employee
Xilinx Employee
302 Views
Registered: ‎08-20-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

Hi @mu_yu 

Can you please tell me the exact error?

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Adventurer
Adventurer
297 Views
Registered: ‎12-12-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

i'm so sorry,maybe,i didn't make myself clear.

now,i try the following scheme: 

 

for (int xShift = 0; xShift < R * 2; xShift = xShift + h)
	{
		for (int yShift = 0; yShift < R * 2; yShift = yShift + h)
		{
			printf("init6 is start !  %d**%d**\n",yShift,xShift);//////slower

			for (int row = 0;row < rowNum; row++)
			{
				for (int col = 0; col < colNum; col++)
				{
					#pragma SDS async(1)
					devMemCopy_adaptive(row,col,D_leftImage,D_rightImage,l_real,l_imag,r_real,r_imag, height, width, rowNum, colNum, R, xShift, yShift, lastLevelRes, hamming);
				}
			}
			for (int i =0; i <rowNum*colNum; i++)
			{
				#pragma SDS wait(1)
			}
			printf("init7 is start !\n");

debug is successful,but running on  the zcu104, the program is stuck,it doesn't work when running the hw function,and no any indications.

 

such as,

image.png

the zcu104 printed "init6...." a long time ago.

but no "init7",and no any indications.

0 Kudos
Xilinx Employee
Xilinx Employee
151 Views
Registered: ‎08-20-2018

Re: successful in sdsoc,but failed in ZCU104 fpga,error: cannot add more entries to request queue associated with id 1

Hi @mu_yu 

Please add some print statements for each for loop after init6

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos