Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Tool Startup, Startup Routine

011_03: What initial settings are required regarding the object code in order to setup CoverageMaster?

Question:

What initial settings are required regarding the object code in order to setup CoverageMaster?

Answer:

In order to perform unit tests using the object code, the following initial settings are required.

1. OMF convert the object file

In order to perform unit tests using CoverageMaster, the compiled and linked executable object code is required. In addition, the object code must include debug information. Enable the output debug information setting in your development environment. Other compiler options such as optimizations can be set the same as when compiling for the actual target device.

When using a compiler other than GAIO's compiler, the object file must be converted to '*.xlo' format loadable into CoverageMaster. CoverageMaster includes an "OMF (Object Module Format) Conversion" feature for use in converting the object file (*.abs for Renesas, *.out for PM+, etc.) to *.xlo format. The OMF converter settings can be found in the "Converter Settings" screen.

Related FAQ link: Object File, OMF Conversion

2. Execute the startup routine

The MPU simulator has the same instruction set, registers and memory area as the actual MPU. So in order to execute the object code using the MPU simulator, the stack pointer, registers, etc. must be initialized in the MPU simulator the same as the actual MPU.

In order to set up the initial state of the MPU simulator, CoverageMaster executes the startup routine included in the object code. This is done by setting the reset vector to the PC (program counter) register when the MPU simulator starts. This setting is performed by entering a script (macro) command in the startup command file.

Note: The startup command file is set in the "Target Settings" screen.

The "@reset" command is used to set the reset address to the PC register. The "@reset" command is entered in the default startup command file. However, in some cases such as when using an operating system or using custom settings with the MPU, the "@reset" command may not set the correct reset address. In this case, the following command is entered into the startup command file to directly set the PC register.

set reg pc = 0x********    ; reset address value

A symbol name can be used instead of an address value. Example:

set reg pc = PowerON_Reset   ; when PowerON_Reset() is the reset function

Note: If the reset address is not valid, the following error may occur just after starting the simulator.
Invalid Operation code found [code = 16] (pc=********)


Startup Command File Example: "@reset" is commented out and "set reg pc" command is used

3. Set the Initialization End Address

When the target object code is executed on an actual target device, the main() function will start after the startup routine is executed. However, when performing an unit test using CoverageMaster, the function to be tested (target function) will be executed directly after the startup routine is executed.

The "Initialization End Address" setting in the Test Settings screen is used to specify the end point (address) of the startup routine. If the main function is named "main()", the default setting "main+0x0" can be used. If the main function name is not "main", the correct main function name must be specified.

If there is a H/W check or initialization which waits for a signal from H/W included in the startup routine, the simulation may get stuck in a loop and not run up to the main() function. In this case, the initialization end address should be set to the address before the H/W check.

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: Startup Routine | Initialization End Address
Technical Tips Google Search


Information Links