ToneCore DSP Developer Kit Guide
- So you want to design your own effects?
- Signal Processing for Dummies
- Assembly Programming
- Program Flow
- Delay Pedal Example
- Debug Interfaces
- Using the Simulator
- Prototyping in Python
- Developing under Linux (or OS X)
- Code Library
What you really need is a JTAG emulator and maybe an ETM. What you have is a GUI that can read four special memory locations and write four others. Good thing we're real men.
For simple unit testing of a routine you can use the writable debug registers ("Debug write to DSP X") to input values and the readable debug registers ("Debug read from DSP X") to output results. This is quite useful for many things. You can also just output interesting things (for example, the input and output values) to the readable registers. You can't really read the data fast enough but it can give you a clue what is going on (you can see if any signal is getting into your device, for example).
There is one more interface you've probably overlooked. The dev kit pedal is a stereo pedal. Unless you're doing a stereo effect you can shove all kinds of data out the 2nd channel. You could then record both channels into your PC and have a pretty nice waveform of the output of your effect plus some debug value. I haven't done this yet but it is possible.
- Start gui56300.exe.
- Configure device (Dv0) to be 56364 processor.
- Load COFF and select your .cld output file.
- Add a working path so that it can find your source code. It didn't work initially for me, but did the 2nd time.
- Do normal debugging things (run, stop, set breakpoint, etc). The Source window is what you want to be looking at.
Because of the difficulty in debugging assembly code on target (and even in the simulator) it makes sense to prototype some things first. I use Python. That way I can get all the kinks worked out of an algorithm and then port it to the native assembly. For more complex things like signal processing I can leverage PyLab to manipulate large amounts of data, graph things, etc.
Here is a simple example of a routine I wrote to do integer multiplication. I first implemented in Python:
Then copied it into my assembly project, commented out all the Python code, and filled in the equivalent assembly code:
Note that the selection of registers is arbitrary in most cases. You're limited to A/B registers when doing multiply/accumulate instructions but otherwise it's mostly up to you, you're the compiler. When everything is done you can rip out the Python comments:
But I usually leave them in. That way if I find bugs I can fix them in the Python version and propagate the change easily.