| Motorola DSP Developer's Kit | ![]() |
Instantiating the Motorola DSP Simulator
A simulator library and executable exist for each supported Motorola DSP family.
The simulator is run in the background by instantiating a MOTDSP_IssCustom class object or run interactively with the full simulator graphical user interface (GUI) by using the MOTDSP_IssStandAlone class. First, you must use the CREATE_SIMS macro outside of the try block to create the required simulator class. To switch between the two modes rebuild your MEX-file by using compiler directives. For example, the templates and supplied functions use STANDALONE.
The constructors for each class are identical and take four string arguments:
The MEX_FUNC_NAME or S_MEX_FUNC_NAME user-defined macros would normally be used here, since they must be defined in the MEX-file.
"max-1r.cld"This argument can simply be a string literal, but the MEX-file template examples provided also show the use of macros to help readability.
"56309"This argument represents a particular Motorola DSP device. If not specified (via an empty string, ""), the simulator defaults to the DSP56301 device or the DSP56602 device depending on the DSP family chosen.
"mot_mult.cmd"The name of the command file must be in lowercase and have a .cmd extension. If not specified for the MOTDSP_IssCustom object, the commands
break #1 END go #1
are inserted automatically by the Motorola DSP Developer's Kit and executed during simulation startup.
For example, use the INSTANCE_SIMS macro
INSTANCE_SIMS( // name of assembly (or C) object file "function.cld", // DSP part name (eg, "56309") "56309", // simulator startup file (not compulsory) "my_setup.cmd");
or the C++ style instantiation
sim = new MOTDSP_IssCustom( /* MEX function name (the only additional parameter) */ "MEX_FUNC_NAME", "function.cld", "56309", "my_setup.cmd");
When the simulator is instantiated, it loads the assembly or C-code binary and reads its symbol information.
| Instantiating Input and Output Objects | Running the Simulation | ![]() |