Everything
2.23 Exclusive Control Checking Tool

The exclusive control checking tool checks whether there is any function that accesses global variables (except static variables) outside the exclusive control period. In other words, it is a tool used to check whether any function is directly accessing global variables (except static variables) without using the exclusive control mechanism.

Caution 1.

This tool can be supported when CC-RH V1.04.00 or later is in use.

Caution 2.

This function does not check whether there is a problem with the exclusive control mechanism (mechanism to prohibit variables from being accessed by other functions during the exclusive control period).

 

[How to use]

(1)

Open the Functions and Variables Access Table panel

Open the Solution List panel and then click the [GO] button of Exclusive control checking tool. The Functions and Variables Access Table panel will open.

Figure 2.100

Functions and Variables Access Table Panel

 

(2)

Make preparations for checking of exclusive control

The preparations that have to be made before checking of exclusive control starts are explained below.

(a)

Run a build with the cross reference information set to be output

Click on the toolbar on the Functions and Variables Access Table panel to configure cross reference information on which variables were accessed by the functions.

When building completes successfully, an orthogonal table of the functions accessing global variables (except static variables) is generated.

Figure 2.101

Functions and Variables Access Table Panel

 

(b)

Select the variables to be checked

Select the variables to be checked from the orthogonal table. More than one variable can be selected.

"R" is displayed if the function has read a value from the variable and "W" is displayed if the function has written a value to the variable. The number in parentheses indicates from how many locations the variable was accessed.

(c)

Open the Exclusive Control Checking Tool dialog box

On the Functions and Variables Access Table panel, click the [Check exclusion-control-missing...] button on the toolbar. The Exclusive Control Checking Tool dialog box will open.

Figure 2.102

Exclusive Control Checking Tool Dialog Box

 

(d)

Set an address or symbol where checking will end

Checking is carried out by executing the user program and recording and analyzing information on accesses to variables. Therefore, where to stop checking needs to be specified. An address or symbol can be set.

(e)

Set the functions for controlling accesses to variables

Set the functions (control starting function and control ending function) for controlling accesses to variables. The control starting function is used to disable accesses to variables and the control ending function is used to enable accesses to variables.

(3)

Start checking

Click the [Start Checking] button.

Information on accesses to variables is obtained by embedding a software trace instruction in the program and analyzing how the embedded software trace instruction was executed. Therefore, information on accesses to variables that was acquired with a software trace instruction embedded in the program sometimes does not match access information that was acquired without a software trace instruction embedded in the program, in relation to the timing of program execution. If you wish to make access information match, leave [Hold the build options for software trace (DBTAG) ON after checking] selected.

(4)

Confirm the checking result

After checking has completed, locations where exclusive control did not work have been detected are shown in error color on the Functions and Variables Access Table panel. The relevant location can be opened in an editor by double-clicking or pressing the [Enter] key at that location and the erroneous code can be found immediately.

Figure 2.103

Functions and Variables Access Table Panel

 

Caution

Note the following points when using the build options for software trace (DBTAG).

-

The -Xcref option of the compiler and the -list -show option of the linker are automatically added (does not affect the load module generated as a result of building) when the exclusive control checking tool is used.

-

Since the specified variables are handled as if they were volatile-declared, the optimization result may differ.

-

The DBTAG instruction to be embedded is equivalent to a NOP instruction. Though the memory and register values do not change, there is the slightest difference in the timing related to program execution.

-

When the exclusive control checking tool is used, do not describe a DBTAG instruction in the user program.
In such a case, the tool cannot check whether exclusive control is performed correctly.