Forum Discussion
Altera_Forum
Honored Contributor
8 years agohow to share DSP correctly ?
16bit or 8bit multiply should only use 0.5 DSP. I have try to implement two char type MAC, and the result will be store into int type. The DSP usage should be 64x16/2=1024/2=512 and in repo...
Altera_Forum
Honored Contributor
8 years agoThanks HRZ
Did you mean I have to change code like this ? and do you know why report.html tells that my DSP usage is 512 when I use 64x16 unroll MAC ? __kernel __attribute__((task)) void mul(){# pragma unroll for(int i=0 ; i<64 ; i++){ # pragma unroll for(int j=0 ; j<8; j++){ partial_sum += (short) ((w_in[j] * d_in[j]) + (w_in[j+8] * d_in[j+8])); } }