To Trigger On The Nth Recursive Call Of A Recursive Function - HP 1660CS-Series User Manual

Logic analyzers
Table of Contents

Advertisement

Single-Machine Trigger Examples

To trigger on the nth recursive call of a recursive function

To trigger on the nth recursive call of a recursive
function
Go to the state analyzer's Trigger menu.
1
Define the terms CALL_ADD, F_START, and F_END to represent the
2
called address of the recursive function, and the start and end
addresses of the function. Define F_EXIT to represent the address of
the first program statement executed after the original recursive call
has terminated.
Typically, CALL_ADD is the address of the code that sets up the activation
record on the stack, F_START is the address of the first statement in the
function, and F_END is the address of the last instruction of the function,
which does not necessarily correspond to the address of the last statement. If
the start of the function and the address called by recursive calls are the
same, or you are not interested in the function initialization code, you can use
F_START for both CALL_ADD and F_START.
Change State Sequence Level 1's macro to "Find event2 n times after
3
event1 before event3 occurs."
In the pop-up, enter the following sequence specification:
4
While storing anystate Find "CALL_ADD" "9" times after "F_START"
before "F_EXIT" occurs.
You should use your value for n-1 instead of "9" in the specification.
Insert another sequence level before the current one. Select the User
5
Level macro and enter the following specification:
While storing "no state" Find "F_END" occurs "1" Else on "no state" go to
level 1.
As with the trigger specification for "To trigger on the nth iteration of a loop,"
this specification helps avoid potential problems on pipelined processors by
requiring that the processor already be in the first recursive call before
advancing the sequencer. Depending on the exact code used for the calls,
you may need to experiment with different trigger sequences to find one that
captures only the data you want to view.
5-8

Hide quick links:

Advertisement

Table of Contents

Troubleshooting

loading

This manual is also suitable for:

1662cs1663cs1660cs1661cs

Table of Contents