HP (Hewlett-Packard) HP 16500C Computer Accessories User Manual


 
To trigger on the nth iteration of a loop
Traditional debugging requires print statements around the area of interest.
This is not possible in most embedded systems designs. But, the analyzer
allows you to view the system’s behavior when a particular event occurs.
Suppose that your system behaves incorrectly on the last iteration of a loop,
which, in this instance, happens to be the 10th iteration. You can use the
analyzer’s triggering capabilities to capture that iteration and subsequent
processor activity.
1
Select the state analyzer Trigger menu.
2 Define the terms LP_START and LP_END to represent the start and
end addresses of statements in the loop, and LP_EXIT to represent
the first statement executed after the loop terminates.
3 Under State Sequence Levels, enter the following sequence
specification:
While storing “no state” Find LP_END 1 time
While storing “anystate” TRIGGER on LP_START 9 times; Else on
“LP_EXIT” go to level 1
Store “anystate”
The above sequence specification has some advantages and a potential
problem. The advantages are that a pipelined processor won’t trigger until it
has executed the loop 10 times. Requiring LP_END to be seen at least once
first ensures that the processor actually entered the loop; then, 9 more
iterations of LP_START is really the 10th iteration of the loop. Also, no
trigger occurs if the loop executes less than 10 times: the analyzer sees
LP_EXIT and restarts the trigger sequence. The potential problem is that
LP_EXIT may be too near LP_END and thus appear on the bus during a
prefetch. The analyzer will constantly restart the sequence and will never
trigger. The solution to this problem depends on the structure of your code.
You may need to experiment with different trigger sequences to find one that
captures only the data you wish to view.
Triggering
To trigger on the nth iteration of a loop
1–5