How can I generate VHDL code with fixed point values from matlab code?
1 次查看(过去 30 天)
显示 更早的评论
Hello all,
I am trying to generate a matlab file into vhdl code. It generates correctly, however, I need to use only fixed point values. The matlab code has some mathematical functions that when vhdl code is generated, some "real" signals are created, so I cannot synthesize the vhdl code.
Do you how can I generate vhdl code without creating "real" datatype?
Thanks in advance,
0 个评论
回答(1 个)
Tim McBrayer
2013-5-24
Are you generating code from a MATLAB Function block in Simulink, or from MATLAB code directly? If you are generating HDL directly from MATLAB code (available first in HDL Coder 3.0), the flow has a guided float-to-fixed data type conversion step, documented at http://www.mathworks.com/help/hdlcoder/floating-point-to-fixed-point-conversion.html. For successful conversion you need to use only functions that are both supported by HDL Coder and have fixed-point implementations. More information on these functions is available at http://www.mathworks.com/help/hdlcoder/ug/fixed-point-run-time-library-support.html.
If you are generating your HDL code from Simulink, the conversion from float to fixed is not automated. You can used the Fixed-Point Advisor (if you have it) to help guide you in your data type choices. Successful conversion also relies on any funtions you call having a fixed-point version, just like when generating code from MATLAB.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 HDL Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!