Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Test Data Settings

014_05: I cannot find the I/O ports declared in my code in the [Register Maps] tab or the [Defined Symbols] tab. How can I get them to appear?

Question:

I cannot find the I/O ports declared in my code in the [Register Maps] tab or the [Defined Symbols] tab. How can I get them to appear? I tried to create a register map, but the structure is not displayed in the Structure list. Why?

Answer:

Consider the following example:

struct st_port {
  union {
    unsigned char BYTE;
    struct {
      unsigned char B7:1;
      unsigned char B6:1;
      unsigned char B5:1;
      unsigned char B4:1;
      unsigned char B3:1;
      unsigned char B2:1;
      unsigned char B1:1;
      unsigned char B0:1;
    } BIT;
  } DR;
};

#define PORT (*(volatile struct st_port *)0x10000000)
#define PORT_TEST PORT.DR.BIT.B6

void Test_IO(void)
{
  PORT_TEST = 1;
}

With the sample code above, if the structure's debug information is present in the object file, the I/O port will appear in the [Register Maps] and [Defined Symbols] tabs as show below.


Click to enlarge

 


Click to enlarge

Depending on the compiler, the structure's type information may not be output to the debug information for the structure if:

(1) The tag name of the structure has not been declared (a nameless structure), or
(2) The address of the I/O port is accessed by code cast as a structure type, where the structure declaration is only used for casting and the actual structure entity has not been created.

(The above factors (1) and (2) may both apply in some cases.) If either case applies, the I/O port will not appear in CoverageMaster's register maps or defined symbols list.

As a workaround for the above described (1), specify the structure tag name. As a reference, see below for an example.

typedef struct {
  ...
} st_port;

 (add the following code)

typedef struct st_port{  /* "st_port" will appear in the defined symbols list */
  ...
} t_st_port;

As a workaround for the above described (2), add code to declare a structure pointer to access the structure to the stub source file (AMSTB_SrcFile.c) or other dummy source file. As a reference, see below for an example.

#include "structure definition header file"

#define NULL 0
volatile struct st_port *st_dummy; /* dummy variable */

/* dummy function (assign to dummy variable) */
void dummy(void)
{
  st_dummy -> DR.BIT.B0 = NULL; // Access a member of the struct
}


Related Technical Tips Search

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

Search key word link: Register Map | Definition list | Defined symbols
Technical Tips Google Search


Information Links