User Guide
DSP Code Component
Debugging
Using Syntax Colouring
We’ve already seen that the first indication you’ll have that your code is incorrect will be a discontinuity in the syntax colouring. The following
example shows this.
You can see that the colouring stops with the sin function. This indicates that there is something wrong with the expression. Sure enough we
forgot the ‘1’, the line should read:
a = sin1(in);
If we make this correction everything becomes coloured correctly.
Checking the Assembler
The code component converts the high-level language that it uses into x86 assembler prior to compiling. You can look at this assembler code
by connecting a Text component to the String output of the code component.
If you understand assembler (and even if you don’t) it can be useful to examine this code to make sure that nothing out of place is
happening.
When there is a syntax error the assembler code will only be generated up to the point at which the syntax broke down.
If the syntax is correct then the other possible problem could be the limitation on expressions discussed earlier. This is much more difficult to
spot in the code because the colouring will indicate correct syntax. However, a quick look at the assembler code can identify this type of
problem.
The example below shows exactly this. The way to spot the problem is to look for xmm999 in the code. If this happens then you know to look
at your expressions to make sure that the 8 consecutive operator limit has not been exceeded.
181 of 212