2.10.6. Stack tracker

The stack tracker examines the contents of the stack pointer (r13) after each instruction. It keeps a record of the lowest value and from this it can work out the maximum size of the stack. ARMulator runs more slowly with stack tracking enabled.

The StackUse model continually monitors the stack pointer and reports the amount of stack used in $statistics. It must be configured with the location of the stack.

The stack tracker is disabled by default. To enable the stack tracker, edit your copy of default.ami:

  1. Find the line:

    { StackUse=No_StackUse
    
  2. Change it to:

    { StackUse=Default_StackUse
    

Before initialization the stack pointer can contain values outside the stack limits. You must configure the stack limits so that the stack tracker can ignore these pre-initialization values. This configuration is in peripherals.ami:

{ Default_StackUse=StackUse
StackBase=0x80000000
StackLimit=0x70000000
}

StackBase is the address of the top of the stack. StackLimit is a lower limit for the stack. Changing these values does not reposition the stack in memory. To reposition the stack, you must reconfigure the debug monitor model.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI0058D
Non-Confidential