Matlab C code or VHDL code import?

4 views (last 30 days)
  • Does MATLAB allow imports of existing C code and/or VHDL code so that development/further design work can be done via the MATLAB interface?
  • Can state machines and documentation be generated as part of the import process?
  • How can the above be achieved and if there are any related documentation available?
  • Can Simulink be setup so graphical programming can be done as part of designing and the related code in C or VHDL can be output?
Thanks...

Accepted Answer

Tim McBrayer
Tim McBrayer on 8 Dec 2014
For HDL Coder's side, you can import arbitrary code using the Black Box capability. It is well documented and has examples that ship with the product. See http://www.mathworks.com/matlabcentral/answers/26561-vhdl-code-as-a-black-box-subsystem for further details.
I'm not quite sure what you mean about' generating a state machine or documentation during the import process'; the imported text is whatever it is; there is no generation of anything except the interface to the imported code, into the rest of the generated code.
Your third question's answer is 'of course'. This is the entire purpose of the C and HDL coders that take Simulink models as inputs; it's their reason for existing. You create a design in Simulink with certain tool-specific limitations, and then you can generate C or HDL code from the design.
  1 Comment
Hemant Raman
Hemant Raman on 9 Dec 2014
Thank you Tim for your explanations. My second question maybe vague but I was looking for some feature in Matlab that would output a State machine based on the Simulink input.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!