cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
5,648 Views
Registered: ‎06-26-2016

SDSoC Improving system performance

Hallo,

I am trying to make direct connection between two functions in PL to improve the system (like in ug 1027 14.12.2015).

I tried to do the same thing like mmultadd example, but it didn't work, i didn't use matrices rather i used pointer. The SDSoC shows me warning (implicit-declaration--function) for the two functions, when i put the functions on PL but it don't make any errors when i put the functions on PS.

On PL after Debugging shows me wrong result rather on PS right result.

 

Should i use Pragmas ?

 

add_t(tmp_A, tmp_B, &tmp_C);

mult_t(&tmp_C, &tmp_C, &tmp_D);

 

Can You help me please?

0 Kudos
3 Replies
Highlighted
Xilinx Employee
Xilinx Employee
5,581 Views
Registered: ‎06-29-2015

Hi issam_1987,

 

What you are describing should work (from what I can tell from your initial description). Can you post some code (or some similar form example) so that we can see a little more detail about exactly what you're trying to do?

 

Sam

0 Kudos
Highlighted
Visitor
Visitor
5,493 Views
Registered: ‎06-26-2016

Hi ,

thank you for your answer, here is my code.

 

void add_t(float in_A, float in_B, float  *out_C);          //header

void add_t(float in_A, float in_B, float  *out_C) {        //func1
    (*out_C) = (in_A) + (in_B);
}

void mult_t(float *in_A, float *in_B, float  *out_C);        //header

void mult_t(float *in_A, float *in_B, float  *out_C) {      //func2
    (*out_C) = (*in_A) * (*in_B);
}

// main

bool mmultadd_test(float *A,  float *B, float *C, float *D, float *E) {

  add_t(A, B, C);
  mult_t(C, D, E);

  return 0;
}

int main(int argc, char* argv[]){
      int test_passed = 0;
      float *A, *B, *C, *D, *E;

     A = (float *)sds_alloc( sizeof(float));
     B = (float *)sds_alloc(sizeof(float));
     C = (float *)sds_alloc( sizeof(float));
     D = (float *)sds_alloc( sizeof(float));
     E = (float *)sds_alloc(sizeof(float));
 if (!A || !B || !C || !D ) {
         if (A) sds_free(A);
         if (B) sds_free(B);
         if (C) sds_free(C);
         if (D) sds_free(D);
         if (E) sds_free(D);
         return 2; }

    *A = 10.0;                                 //initialization
    *B = 20.0;
    *C = 0.0;
    *D = 2.0;
    *E = 0.0;

test_passed = mmultadd_test(A, B, C, D, E);

     sds_free(A);
     sds_free(B);
     sds_free(C);
     sds_free(D);

return 0;

}

I dont use any pragma , should i use one ? when yes what one ? and thank you very much

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
5,481 Views
Registered: ‎06-29-2015

Hi,

 

Direct connections are only supported for fifo/bram interfaces (ie. arrays). It is not supported for scalars. When you have a scalar interface on your accelerator, SDSoC inserts a register to hold this scalar and the writes the values from software into this register in hardware. Since there is a register and it can only be written from software, direct connections of scalars between two accelerators isnt currently possible.

 

The Matrix Multiplication and Addition example uses arrays, which is why it achieves a direct connection. If you really want a direct connection with scalars, you can use arrays of size 1.

 

Sam

0 Kudos