Calling/Conversion of image processing in M-file to Simulink

Dear all expert,
For information, I purchased a Spartan6 LX9 FPGA Microboard and I found out that the 'system generator' software that come along with my product allow me to program the microboard with Simulink.
However, i can't convert or call the M-file that i wrote, into the simulink. So, i wish to ask how to convert the M-file to Simulink? Or, any other method to program my microboard with the existing M-file coding? Attachment of the tutorials with steps will be kindly appreciated. Thanks

 Accepted Answer

As far as I know, the System Generator software can generate HDL code only from the Simulink blocks in their custom library. I'm sure you can find examples in their documentation, but since it is a product from Xilinx (and not MathWorks), you should find more information on the Xilinx support website.
However, if you have the Simulink HDL Coder product, you can bring your MATLAB code into Simulink using the (Embedded) MATLAB Function block and then generate code from it. Note however that you can only use functions that are supported for code generation.

More Answers (1)

Thanks Kaustubha Govind for replying :)
Ya, the system generator can generate HDL code only from the Simulink Blocks. That's why i trying hard to convert the m-file coding to simulink. Sadly, i'm not able to find this vital step in the Xilinx support website. Really need some help here badly.
For the (Embedded)Matlab Function block, it's limited for some codes. Thus, some commands in image processing toolbox(eg:graythresh,bwtraceboundary)and the 'find' command are not accepted too. This quite inconvenient due to its constraint and this leads many problems for me.
Is there any other method/block/command allow me like 'calling' the M-file's code in simulink? Attachment of the tutorials with steps will be highly appreciated.
Thanks

1 Comment

Anson: Unfortunately, there is no way to generate HDL code for unsupported functions (like graythresh or bwtraceboundary), unless you can find corresponding Simulink blocks supported by Simulink HDL Coder - you can run "hdllib" at the MATLAB prompt if you have Simulink HDL Coder to see all the blocks supported for HDL code generation.
Note that you can call _any_ MATLAB function from the Embedded MATLAB Function block as long as you declare them using eml.extrinsic (now coder.extrinsic - http://www.mathworks.com/help/toolbox/eml/ug/bq1h2z9-38.html#bq1h2z9-40). However, you _cannot_ generate HDL code from them.
Regarding System Generator - sorry, but I don't know much about this software. The best you could probably do is try writing to Xilinx support?

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!