Hallo,
I am using the HDLcoder in Matlab2016a to implement a neural network on an FPGA. To control the resource consumption it would be perfect to individually control which loops are streamed and which ones are unrolled. Here is a short example:
function [ out ] = Layer( in, fak, neurons )F = fimath('RoundingMethod','Floor','OverflowAction','Wrap','ProductMode','KeepMSB');temp = fi(zeros(neurons,1),0,in.WordLength,in.WordLength/2,F);for jj = 1:neurons for ii = 1:length(in) temp(jj) = fi(temp(jj)+in(ii)*fak(ii),0,in.WordLength,in.WordLength/2,F); endendout = temp;end
Is it possible to stream the inner loop(index ii) and unroll the outer loop(index jj) in order to end up with 3 DSPs working parallel generating the output? Or is it possible to influence the arrangement of the hardware implementation in any way?
Thanks Roland
Best Answer