Motorola DSP Developer's Kit    

What You Provide

DSP56K Assembly or C-code

An associated assembly or C-code binary file you create is loaded into the simulator when the MEX-file is executed. It is possible to select from more than one binary at run-time, based on, for example, function input data types.

The restrictions on the DSP assembly are:

The simulator starts execution of DSP instructions at BEGIN and terminates when it reaches the END address.

The name of any global variable in a C-code source file is translated to a symbol/label. This allows the MEX file to run object code independently, whether compiled from an assembly or a C-language source file.

For example,

may be equivalent to the assembly code

MEX-File

Use the supplied template as the basis for writing your own MEX-files. Simply add details about your particular function, as explained in the remainder of this chapter.

Use all of the standard features provided by the MATLAB API for C MEX-files, including calling any mx and mex routines where appropriate.

Locations in the supplied template files that must be modified for individual functions lie between

and

comment blocks. Code outside these blocks should remain unchanged.

Simulator Command File

You can optionally provide a DSP Simulator command file to control the execution of the simulator itself, just as you would if running the simulator outside the MATLAB environment. Ensure that each simulator command line is followed by a carriage return.

If a command file contains any load and device commands, these take precedence over the assembly or C binary and device type supplied within the MEX-file when the simulator object is created (see Instantiating the Simulink DSP Simulator).


 What the DSP Developer's Kit Provides MATLAB MEX-Files