problem found in hdl coder

3 visualizzazioni (ultimi 30 giorni)
Found an unsupported unbounded loop structure. This loop may be user written or automatically generated due to the use of specific vector expressions or functions. For more information on unsupported loop structures, please refer to the documentation
the matlab code is as follows:
function a=poly123() s1=[zeros(1,3),pi]; % xcorr(x) x=cos(s1)+1i*sin(s1); n=length(x); r1=zeros(1,n)+1i*zeros(1,n); for m=0:1:n-1 r=0+1i*0; for n1=1:1:n-m r=r+x(n1+m)*x(n1); end r1(m+1)=r; end a=r1;
end
what to do with this kind of problem

Risposta accettata

Tim McBrayer
Tim McBrayer il 2 Apr 2014
You have a loop from 1:n-1 , where n is length(x) . You also have an inner loop from 1:(n-m) , where m is the current index of the outer loop. This inner loop does not have a well-defined upper bound. It's not generally possible to determine how many loops you need with code like this. Since the number of loops dictates what sort of hardware gets created, HDL Coder cannot generate synthesizable HDL from such a design.
The most obvious rewrite of the inner loop, to give it a static bound, is:
for n1 = 1:n
if n1 <= (n-m)
<...>
end
end
In software, you'll execute the loop m extra times. In hardware, the loop will be unrolled (in general) and the extra empty loops will cause no hardware to be created.
You may run into the same issue with the outer loop, if length(x) is not statically determinable.
  1 Commento
Gnaneswar Nadh satapathi
Gnaneswar Nadh satapathi il 3 Apr 2014
Thank you Mr. Tim McBrayer for your valuable information

Accedi per commentare.

Più risposte (0)

Tag

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by