Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Tool Startup, Startup Routine

011_01: What is the "Offset" setting of the "Initialization End Address"?

Question:

I already understand that if I specify "main+0x0" as the Initialization End Address, the MPU simulator will change its program counter (PC) register to the test function's starting address just after the PC reaches main. Is the return address after executing the test function fixed? Also, what does the "0x0" offset mean?

Answer:

The PC returns to the address specified as the Initialization End Address after executing the test function. With the default "main+0x0" setting this is set to the starting address of the main function plus an offset of 0.

CoverageMaster winAMS recognizes that the execution of the test function has ended by detecting that the stack pointer and execution address have returned to their original state. Due to the compiler expansion, if there is an instruction that changes the stack pointer at the start of the main function, the instruction will be executed after returning from the test function causing the stack pointer to not return to its original state and the test execution not ending. In such as case, specify the main function start address + a few bytes in the offset as the initialization end address to avoid returning to the instruction that changes the stack pointer.

The offset value entered depends on the code generated by the cross compiler. If the execution of the test function does not work with the offset value used, contact GAIO user support including the assembly code of the main function.

Related FAQ: 011_02: What is the "Initialization End Address" setting in the Test Setting screen?


Related Technical Tips Search

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

Search key word link: Initialization End Address
Technical Tips Google Search


Information Links