Effacer les filtres
Effacer les filtres

Found unsupported division expression for HDL code generation; Signed input data type is not supported for division with Floor RoundMode.

4 vues (au cours des 30 derniers jours)
Hello There,
I got the following error while I'm converting my Matlab Code to HDL-coder
Error : "Found unsupported division expression for HDL code generation; Signed input data type is not supported for division with Floor RoundMode."
Here is the matlab code :
Gx1(nn)=fi(cos_func(dr(nn)),true,16,16).*fi(call_power_func(2.718281828,double(-(double(t(nn)).*(double(t(nn))))/2)),true,16,16);
Notes:
t= (1x100000) double
max(t)= 0.999999000000000
min(t)= 0
[Merged from duplicate - WDR]
Hello There,
I got the following error while I'm converting my Matlab Code to HDL-coder, Can you please help me to fix this error? I simplified my code as below to trace the error, as it looks the Cos function is not working with HDL, even after I created a cos special func.
"Error: Found unsupported division expression for HDL code generation; Signed input data type is not supported for division with Floor RoundMode."
Here is the code:
dr=[0.26,0.36,0.76,0.5,0.75,0.33,0.67,0.87,0.98,0.21];
dr= fi(dr,true,16,16);
Gx2=zeros(1,10);
Gx2= fi(Gx2,true,16,16);
for nn=1:1:10;
Gx2(nn)=cos_func(dr(nn));
end
% code end
---
where:
function y = cos_func( x ) %#codegen
y=cos(x);
end

Réponse acceptée

Bharath Venkataraman
Bharath Venkataraman le 14 Juil 2015
The cos function is not supported for HDL code generation. You can use a lookup table (predefined array)that stores the cos values and look up the right value based on the input x.

Plus de réponses (0)

Catégories

En savoir plus sur Code Generation dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by