Products & Services Solutions Academia Support User Community Company

Introduction

HDL Applications for the Embedded MATLAB Function Block

The Embedded MATLAB Function block contains a MATLAB function in a model. The function's inputs and outputs are represented by ports on the block, which allow you to interface your model to the function code. When you generate HDL code for an Embedded MATLAB Function block, the coder generates two main HDL code files:

The structure of these code files is analogous to the structure of the model, in which a subsystem provides an interface between the root model and the function in the Embedded MATLAB Function block.

The Embedded MATLAB Function block supports a powerful subset of the MATLAB language that is well-suited to HDL implementation of various DSP and telecommunications algorithms, such as:

Related Documentation and Demos

The following documentation and demos provide further information on the Embedded MATLAB Function block.

Related Documentation

For general documentation on the Embedded MATLAB Function block, see:

The coder supports most of the fixed-point runtime library functions supported by the Embedded MATLAB Function block. See Working with the Fixed-Point Embedded MATLAB Subset in the Fixed-Point Toolbox documentation for a complete list of these functions, and general information on limitations that apply to the use of Fixed-Point Toolbox with the Embedded MATLAB function block.

Demos

The hdlcoderviterbi2.mdl demo models a Viterbi decoder, incorporating an Embedded MATLAB Function block for use in simulation and HDL code generation. To open the model, type the following command at the MATLAB command prompt:

hdlcoderviterbi2

The hdlcodercpu_eml.mdl demo models a CPU with a Harvard RISC architecture, incorporating many Embedded MATLAB Function blocks to simulate and generate code for CPU and memory elements. To open the model, type the following command at the MATLAB command prompt:

hdlcodercpu_eml
  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS