MATLAB to VHDL/Verilog conversion using Simulink HDL Coder

I have a project that requires me to implement my MATLAB code into Altera's DE1 board. Thus, I have done some readings on how to use Simulink HDL Coder to obtain VHDL/Verilog. But the generation of HDL can only be obtained through Simulink model or stateflow chart.
Is there any way to obtain HDL code from MATLAB code itself? I can't draw a Simulink model as well as my MATLAB code contains many "for" loops and Simulink HDL coder doesn't support implementation of "for" block as well.
Please help. Many thanks.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 3월 11일

0 개 추천

Why not use the Embedded MATLAB block to insert the portion of the MATLAB code that contains for loops?

댓글 수: 3

That would be a good idea. But the problem now lies on the usage of cosine function in the embedded matlab function block, I've read it somewhere saying it that EML doesn't support converting cosine function to VHDL using Simulink HDL Coder.
According to the Embedded MATLAB Library Reference (http://www.mathworks.com/help/toolbox/eml/ug/bq1h2z7-9.html), COS is one of the supported functions.
For HDL code generation the supported EML subset is limited to Fixed-Point Embedded MATLAB functions.
http://www.mathworks.com/access/helpdesk/help/toolbox/fixedpoint/ug/bq4c8a0-1.html
The COS function is not supported, but the CORDIC function is.
http://www.mathworks.com/help/toolbox/fixedpoint/ref/cordiccos.html

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Code Generation에 대해 자세히 알아보기

질문:

2011년 3월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by