Based on this modified code of yours now I am trying to use ac data type fixed . The two inputs are unsigned ac_ufixed<11,1>. The output is unsigned ac_ufixed<28,8>. The accumlator is ac_ufixed<28,8>, a_reg and b_reg as ac_ufixed<11,1> , sub as ac_fixed<12,2>, sub2 as ac_ufixed<21,1> . How can I define the test bench for this particular component ? Can you please help me particularly for the test bench of this component ? Below is my code snippet (component).... Thanks !
void diff_sq_acc( ac_ufixed<11,1> a[N], ac_ufixed<11,1> b[N], ac_ufixed<28,8> *dout)
{
unsigned char i;
ac_ufixed<28,8> acc= 0;
ac_ufixed<11,1> a_reg, b_reg;
ac_fixed<12,2> sub;
ac_ufixed<21,1> sub2 ;
for(i=0; i<N; i++)
{
# pragma HLS PIPELINE II=1
a_reg = a
;
b_reg = b;
sub = a_reg - b_reg;
sub2 = sub*sub;
acc += sub2;
}
*dout = acc;
}