Generating VHDL

2 次查看(过去 30 天)
Carlos
Carlos 2012-3-5
Hi! When I try to generate a VHDL from a Simulink model I get this error *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* which says it`s reported by Stateflow. It appears when I try to use the Fixed-Point 'min(array)' function into a Matlab Function Block to get the index of an array. 'array'type is fixed point, but the index returned by the function is 'double'. Since the VHDL generation doesn't support double data types, I think it could be the problem. But I can't fix it. Could anyone please tell me what I'm doing wrong? THANKS

回答(1 个)

Carlos
Carlos 2012-3-5
This is the code belonging to the Matlab Function Block:
function k = pure_p_I(u)
persistent K_ANT;
if isempty(K_ANT)
% zero the counter on first call only
K_ANT = uint16(1);
k = uint16(0);
end
long = uint16(1551); % +1 en long para garantizar el 2º for
x_camino = u(1:long);
y_camino = u(long+1:2*long);
x_vehiculo = u(2*long+1);
y_vehiculo = u(2*long+2);
L = u(2*long+3);
dist=sqrt( (x_camino-x_vehiculo).^2+(y_camino-y_vehiculo).^2 );
dif = abs(dist-L);
dif_delante = dif;
k = K_ANT;
for i = k:long-1
dif_delante(i-k+1)=dif(i);
end
for i = 1:k
dif_delante(long-i+1) = 700;
end
How to fix this??
[valor,indice] = min(dif_delante); %indice returned as 'double'
k = indice + k -1;
K_ANT = k;
end
  1 个评论
Kiran Kintali
Kiran Kintali 2012-3-24
Hi Carlos,
If you can send me the example input for 'u', I can see what is going on with the compilation issue.
Also please check out the new MATLAB to HDL workflow in HDL Coder.
http://www.mathworks.com/products/hdl-coder/?s_cid=HP_FP_SL_simhdl
Thank you.
-Kiran
kiran.kintali@mathworks.com

请先登录,再进行评论。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by