Motorola DSP Developer's Kit    

Data Snapshots

Snapshots provide access to DSP memory and/or DSP register data from within the MATLAB engine session. This allows debugging of the algorithm within the MEX function when running in the INTERACTIVE mode. Access means you are able to monitor and process a copy of any DSP memory data and DSP registers in the simulator without altering the contents.

Two types of snapshots are available: Instant and Continuous snapshots.

Instant Snapshot

The instant snapshot represents the data at the current point of simulator execution, i.e., at the time the snapshot command is issued. You must issue the instant snapshot command from the GUI simulator command window. Some examples include

After the execution of these commands, observe the workspace of the MATLAB engine session that was created by the MEX function. There should be two structure variables, one is the snapshot of the DSP register R4, and the other is the snapshot of the DSP X memory block from $0000 to $0010. For accessing structure variables, refer to the "Programming with MATLAB" section in the MATLAB documentation. Each structure contains attribute information and the actual value as seen by the simulator.

Continuous Snapshot

Data from a continuous snapshot is updated after each DSP instruction is executed by the simulator. You must declare continuous snapshots in the MEX-file at compile time. The following source lines added to the MEX-file <matlab>toolbox/motdsp/motdsp/56300/mot563_mean.cpp set up continuous snapshots.

or using C++

Continuous snapshots for the DSP register X1, and DSP X memory block from address $0 to address CUR_DIM_SIZE (see the MEX-file for the definition of this block size macro) are created when you run MOT563_MEAN. Step through the DSP assembly or C-code and observe the contents of the snapshot variables updating in the MATLAB engine session.

System Analysis Return Data (SARD)

This feature returns information about the execution of the DSP assembly program within the simulator to the MATLAB environment. Both the INTERACTIVE and NON_INTERACTIVE modes support this feature. The data contains:

The creation and return of SARD data is optional. To enable this feature, set a MATLAB variable named <FUNCTION_NAME>_SARDflag. When you run the corresponding MEX function, a MATLAB struct array with the name <FUNCTION_NAME>_SARD appears in the workspace. Be aware that the variable <FUNCTION_NAME> is case-sensitive.

The following example shows the use of SARD with the MOT563_MAX function.

The SARD is updated each time a function of the same name executes.


 callMatlab Reference