Error: Cast between fixpt and floating point type is not supported

Hi there,
I got a problem. The program successfully passed the fixed point conversion, but I still got the following while I converting it to HDL code.
Error: Cast between fixpt and floating point type is not supported
"A cast between fixpt and floating point type is not supported, at
Function 'eml_fi_checkforntype' (#14.947.965), line 26, column 25
Function 'fi_impl' (#4.10494.10558), line 274, column 15
Function 'fi_impl' (#4.2380.2450), line 79, column 15
Function 'rgb_fixpt' (#1.2827.2957), line 77, column 23."
But I do not know what Function eml_fi_checkforntype,fi_impl are.
I just converted my code'rgb'.

 Accepted Answer

Somewhere in your code you have a call to double() or single() . That is not permitted in code that is going to be used for HDL, because HDL seldom has floating point cores (floating point takes large die areas.) Your code should be using fi() class not double()

9 Comments

sorry When I changed all double() to fi(),but the problem is still there.
Could you tell how to debug?
Thank you for your help.
This is where I have converted the original code to fixed-point.
I want to use IP core Generation in XILINX Zedboard.
Sorry, I do not see anything obvious.
I set input as a fi (1x16)
The indicated column of code occurs just after the phrase
(sqrt(sum(diag(W'*W)))
I wonder if that is being calculated as floating point?
Try breaking that expression up into parts,
temp1 = W'*W;
temp2 = diag(temp1);
temp3 = sum(temp2);
temp4 = sqrt(temp3);
It looks to me as if that is the first component of the expression on the denominator of the fi_div . By breaking up the expression into parts you might be able to isolate which part is floating point.
My speculation at the moment would be that although W is fi and diag() should not change that, that possibly sum() is converting to double (pay attention to the 'native' option of sum -- though I do not know if it is supported in your context.) But I would more suspect sqrt()
In the end I found that the parameters of the line were wrong.
When I am modified, I can execute
Thank you very much for your help and suggestions
I did wonder about those, but I thought perhaps that since they were output by the fixedpoint advisor that they were okay...

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!