HP 16500C manual To trigger on the nth iteration of a loop, Select the state analyzer Trigger menu

Models: 16500C 16501A LOGIC

1 130
Download 130 pages 6.88 Kb
Page 15
Image 15

Triggering

To trigger on the nth iteration of a loop

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.

1Select the state analyzer Trigger menu.

2Define 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.

3Under 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.

1–5

Page 15
Image 15
HP 16500C, 16501A LOGIC manual To trigger on the nth iteration of a loop, Select the state analyzer Trigger menu