Using the Simulator in Code Composer 2

The simulator is a good tool for debugging errors in the ROD code without dangerous output statements or the disadvantages of being several levels removed from the action when testing code on the ROD in a crate. Here are the basics of simulation as I have received them from Joe Virzi.

This tutorial assumes a default installation of CCS2 on Windows XP. It is mostly adapted to the new (Joe Virzi) code base, but me apply somewhat to the old one as well.

Steps to set up the environment:

  1. Run "Setup CCS2" from the desktop.
  2. Depending on the DSP (master or slave) you are coding form you will use a 6201 Device Simulator, little-endian (Master) or a 6713 Functional Simulator, little-endian (Slave). Once the choice is made, click Import, then Save and Quit. The environment is now set up.
  3. Open the workspace you have been using to code and go to File->Load Program. For the master DSP, select projects/pixelRod/MASTER/master.out, and for slave, projects/pixelRod/SLAVE/slave.out. For the master DSP, one should also go to File->Data->Load and select project/pixelRod/MASTER/master.dat.
  4. You are now presented with the init sequence for the simulator. Click the Source-Step-Into button (F8) a dozen or so times to make sure that CCS2 starts with the state you want it to. Set a breakpoint in main.c at the sys->proc() function to make sure you stop in the right place, then press the Run Target button (F5), and sit back a minute to relax. When the yellow arrow shows up at your breakpoint, you are ready to begin.
  5. At this point, you are ready to debug your code. There are several useful watches and quick watches available. In some cases (though not usually for the data in structs) you can mouse over a variable in the code to see its value. Others can be watched by selecting the variable and right-clicking it, and selecting Add to Watch Window. Changing values in the watch window will change the values of the variables as they are running.
  6. Memory can be viewed directly using the View->Memory option - and changes made to the memory in that window are made in the memory itself.
  7. All the other normal debugging tools are available as well - Step Out, Step Over - and there are a few others as well, like the Debug->Multiple Operation, which lets you do a predefined number of steps at a shot, and can be added to your menu bar.
  8. After running, you realize you need to recompile and rerun. Make sure to Debug->Reset CPU and reload the data to return to the original state.
  9. If you are in a fast build-simulate cycle, you can turn on automatic program loading after build in the Option->Customize... menu under the Program Load Options tab.
-- AldenStradling - 19 Oct 2005
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2005-10-28 - AldenStradling
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback