winIDEA SFR Specification Format

Debug ›› Debug Menu ›› Debug Options ›› SFRs ››
Parent Previous Next

winIDEA SFR specification format


This is a specification of text type symbol tables that can be read by winIDEA.

winIDEA provides a specialized window to display CPU's on-chip special function registers. In order to correctly display the name of the SFR, the text symbol tables must be correctly written. This specification is provided for adding the SFR symbol tables for components not yet supported by winIDEA.

The SFR's are organized into levels of groups (groups and possibly sub-groups) and levels of registers (registers and possibly sub-registers). A group is a collection of registers that serve a module on the CPU.

Master definition file (.sfm)

The various processor families are defined in a single file named "SFR Families.sfm". All families supported are listed in this file; every line represents one family. Every line has two fields:

<family> <flag string>

Example:

8051 sX

180  B

For each family there must be a sub-directory present with the same name, where the CPU definitions are stored.

The flags depend highly from the family of the CPU.  

General flags

a        The register can be used to pre-initialize the CPU and will be visible in the initialization
       sequence window

S        Add to symbol table

I        Independently accessible

8051 CPU Family

s        stack point register

X        XMAP0 bit in SYSCON register must be set to 0

Z80 Family

B        BBR register

Special Function Register definition file (.sfr)


SFR definition files are used to identify each processor supported and its special function registers. Each CPU has a unique set of SFRs, which are grouped by creating SFR groups, as discussed later. The RGCPU.EXE utility will process all SFR files in the directory and add them to the database.


File Extension

The extension of the definition file must be '.SFR'.

File Tags

HEADER tag

The Header tag identifies the CPU.

HEADER <Company> <Family> <CPU>

<Company> is the name of the manufacturer

<Family> is the family of the CPU, is one of the families listed in the '.SFM' file

<CPU> is the universal CPU name, which identifies the CPU

Note: tag arguments are separated by blanks. If an argument contains a blank, it must be enclosed in double quotation marks.

Example:

HEADER Intel 8051 8031

INFO tag

The Info tag toggles little or big endian.

INFO   <high first>

<high first> has value 0 for little or 1 for big endian.

Example:

INFO  1

RESET tag

Identifies the CPU behavior at reset.  

RESET  <reset mode> <reset position> <vector size>

<reset mode> has value 1 for a fixed reset position or 2, if at reset the CPU points to a vector

<reset position> defines the fixed reset position or the vector location

<vector size> is the size of the reset vector in MAUs

Example:

RESET 2 FFFE 2

FLASH tag

This tag defines that the CPU has FLASH memory, of which info is read from the file named  <SFR file name>.flash

Note: The flash specification is not covered by this specification

GROUP tag

The Group tag is used for grouping similar special function registers. A group is a collection of registers that serve a module on the CPU. Groups are discussed in detail later.

GROUP  <file name> <multiplier> <address offset> <parameter>

<file name> is the path to the group definition file

<multiplier> 0, if the group has no subgroups, 1 if the group has subgroups

<address offset> value to be added to every address occurring in the .sfg file, optional

<parameter> parameter to be passed to the .sfg file (e.g. to enumerate peripheral instances - parameter will replace all instances of %1 in the sfg file), optional

Note: tag arguments are separated by blanks. If an argument contains a blank, it must be enclosed in double quotation marks.


Examples:

GROUP "Miscellaneous 8031" 0


GROUP "eSCI" 1

{

GROUP "SPC564A80 eSCI" 0 FFFB0000 0

GROUP "SPC564A80 eSCI" 0 FFFB4000 1

GROUP "SPC564A80 eSCI" 0 FFFB8000 2

}

SVD tag

The SVD tag is used for specifying an external System View Description (.svd) file. A .svd file is typically provided by the silicon vendor.

SVD  <file name>

<file name> is the filename of the System View Description file


Example:

SVD "LPC4357.svd"

Special Function Register groups (.sfg)

The SFR groups are stored separately in SFG files.

File Extension

The extension of the group file must be '.SFG'.

File Structure

The SFG file lists all special function registers of the module it describes.

GROUP  <name>

<reg name> <access method> <hex address> <dec bit size> <dec bit offset> <R|W|RW> <flags> (<text value>)

{

       <sub reg name> -||-

       <sub reg name> -||-

       {

               <sub sub reg name> -||-

       }

       <sub reg name> -||-

}

<reg name> <dec access method> <hex address> <dec bit size> <dec bit offset> <R|W|RW> <flags> (<text value>)

...


<name> is the group name, which is the name as it will appear in the SFR window of winIDEA

<reg name> is the name of the special function register

<dec access method> is the access method of how the bits can be addressed. The access methods are CPU group specific and are defined separately for each CPU group

<hex address> is the address of the SFR (hexadecimal)

<dec bit size> is the bit size of the SFR (decimal)

<dec bit offset> is the bit offset (decimal)

<R|W|RW> are the flags which represent how the SFR can be accessed.

R        Read Only

W        Write Only

RW        Read-Write

<flags> define special options for each CPU and are defined for each CPU family separately. If no flag is used, it must be set to '0'.

There are a few global, CPU independent flags:

a        The register can be used to pre-initialize the CPU and will be visible in the initialization
       sequence window

S        Add to symbol table

I        Independently accessible

<text value> is an optional field, with which strings can be associated with individual register values. The syntax of this field will be defined later.

Note: tag arguments are separated by blanks. If an argument contains a blank, it must be enclosed in double quotation marks.

Sub-SFRs

<sub reg name> is the name of the sub-SFR.

Sub-SFRs have the same syntax as main SFRs. If the access method of the Sub-SFR is the same as that of the main SFR, the access mode and address fields can be replaced with the symbol 'p'. This means that the access mode and the address will be used from the parent SFR.


Examples

The first file described here is the SFR file, the special register definition file.


(Intel 8052.sfr)


HEADER Intel 8031 8052


GROUP  "Intel 8031 TimerCounter" 0


The first line describes the header of the SFR file. The CPU manufacturer's company name is Intel, the CPU family is 8031 and the CPU model is 8052. The processor has one SFR group, the timer and counter group. The 0 at the end of the Group definition tells that this group has no subgroups.  The Group definition line points to a group file, named "Intel 8031 TimerCounter.SFG".


(Intel 8031 TimerCounter.sfg)


GROUP  "Timer/Counter"




"TMOD"        0 89 8 0 RW S

{

 "GateT1"    p    1 7 RW 0

 "C/T_T1"    0 89 1 6 RW 0

}

"TL0"         0 8A 8 0 RW S

...


The SFG file contains definitions of SFR functions in the Timer/Counter module of this CPU. The first line contains the name of the SFR group, as it will appear in the SFR window of winIDEA. The second line defines the first SFR, the "TMOD". The “TMOD” SFR has two sub-SFRs, the “GateT1” and the “C/T_T1”.