Forum Discussion
Altera_Forum
Honored Contributor
8 years agoIntel HLS example reports
Hello, I am new to the concept of HLS. I am using Intel HLS and going to start with the examples that come with the installation of Quartus prime edition. Can anyone of you share the succe...
Altera_Forum
Honored Contributor
8 years agoBased 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; }