Regarding arf example run on Bambu

34 views
Skip to first unread message

Rafid Muttaki

unread,
Oct 13, 2021, 9:43:42 AM10/13/21
to PandA project discussions and questions
Hi,

I was trying to run the a simple array case in Bambu and generate a testbench. The code is given below:

#include <stdio.h>
#include <stdlib.h>


int fct(unsigned char array1[12], unsigned char array2[12], int size) {
    int result1 = 0;
    int array3[12];
    int i,j;
    //int a, b, c;
    for (i = 0; i < size; i++) {
         array3[i] = array1[i]*array2[i];
result1 = result1 + array3[i];
    }
    return result1;
}

However, in the testbench the array size was not as defined in the c code. It also said that the simulation failed. Can you please let me know if we have made any errors from my side?
bambu.png
I have attached the values.txt with this mail.


values.txt

Fabrizio Ferrandi

unread,
Oct 13, 2021, 10:01:09 AM10/13/21
to PandA project discussions and questions
Hi,
Have you specified the test.xml file? In case arrays are passed there is no automatic way to infer the array size. The 12 you put in the parameter signature is not actually used by the compiler. So, in all the cases where a pointer or an array is used, you need to write the test.xml. 
Check, for example, the test.xml file defined for the matrix multiplication: link

Cheers,
Fabrizio

Reply all
Reply to author
Forward
0 new messages