Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

CoverageMaster General Specific Issues

A03_04: Using CoverageMaster General, I get a stack overflow. How can I increase the size of the stack area?

Question:

With CoverageMaster General, when executing a test I get an error message similar to that of the message below.

Invalid address found [code = 18] (pc=xxxxxxxx)
%SYSTEMG-E-SEM, stopped simulation (status code = 12h)
  `MEM::xxxxxxxx'

When step execution was performed and the execution state was examined, I found that the stack overflowed to an address above the upper limit of the stack area (0x00100000 to 0x00110003) at a certain location. How can I increase the size of the stack area?

Answer:

The Stack area can be increased by adding the following command to the startup command file. Please make sure that the increased stack area doesn't overlap with the pointer allocated area set in the "Test Settings" -> "Pointer Area Allocation Settings". If they overlap, adjust the pointer area allocation settings.

To extend the stack area from 64K to 128K, add the following to the startup command file:

;Stack Area Extension
assign 0x100000#0x20000 ; assign the new stack area to 0x100000-0x120000
macro set_sp
set reg sp=0x11fff0 ; initialize the stack pointer (SP) to the new location
mend

set do/exe=0x40000058 set_sp ; execute the macro at the end of the Startup routine

After the above macro has been executed, the memory map allocation is as follows:

0x00100000 - 0x0011fff3  Stack
0x0011fff4 - 0x00FFFFFF  Free (available for pointer area allocation)
0x01000000 - 0x3FFFFFFF  Variable area (by default the heap is here, unless the program break was modified with sbrk())
0x40000000 - 0xFFFFFFFF  Program area

For the default CoverageMaster General memory map, please refer to the FAQ linked below:

 

Related Technical Tips Search

Other technical tips in GAIO's web site can be searched for using the links below.

Search key word link: General | Stack overflow
Technical Tips Google Search


Information Links