C REGISTER MANAGER

This appendix contains the following sections:

Introduction

Invocation

Syntax of a Register File

Fixed Register Set

DSP56xxx Family Derivatives

DSP56xxx Register Set

1 Introduction

CrossView Pro uses a so-called "register definition file" (regcpu.dat) that specifies the register name to register number mapping for CrossView Pro. In case a register is a memory mapped register, the register number specifies the register's memory address.

Register definition files for the DSP56xxx family derivatives are included in the package.

If you use another derivative you can use the register manager to create new register definition files.

2 Invocation

CrossView Pro has a user definable set of special function registers (SFRs). The registers are read by CrossView Pro from a binary file (regcpu.dat) specified by the cpu_type field in xvw.ini or a target configuration file (*.cfg):

cpu is 563xx by default for the DSP563xx/DSP566xx, but you can overrule the CPU type (and thus the regcpu.dat file) to be used by CrossView Pro with the -C option. The tool for generating this binary file from a text file is the Register Manager rm56 for the DSP5600x or rm563 for the DSP563xx/DSP566xx. In this appendix rm563 refers to both rm56 and rm563 unless explicitly stated otherwise.

The invocation syntax for rm56 and rm563 is the same:

When you use a UNIX shell (Bourne shell, C-shell), arguments containing special characters (such as '()' and '?') must be enclosed with " " or escaped. The -? option in the C-shell becomes: "-?" or -\?.

The optional register-file (or several files) contains the user definition of SFRs (Special Function Registers). The syntax of this text file is described in the next section. The rm563 tool always generates a fixed set of registers in the binary output file. If no register-file is supplied, only this set is generated. A list of the fixed set can be found in the section Fixed Register Set.

The -o outfile option lets you specify the name of the generated binary register definition file. If this option is omitted, the default outfile name is reg.dat.

The -? option causes rm563 to print a tiny manual, and the -V option prints the version header only.

3 Syntax of a Register File

The syntax of a register file is quite simple. Comments start with a semi-colon (;) and end at the end of the line. The only directive allowed in the register file is EQU.

Register file syntax:

name equ address [; Comments]

Field Values:

name A unique register name. If a name is multiply defined an error is issued. If a fixed name is redefined, a warning is issued and the redefinition is ignored.

address A DSP56xxx address

Examples:

BCR  equ  x:$FFFE    ;  Port A Bus Control Register
RX   equ  x:$FFEF    ;  Serial Receive Data Register

4 Fixed Register Set

The following registers are always defined by rm563. Redefinition results in a warning, and the redefinition is ignored.

Name Number Remarks
PC 0 16-bit program counter
SR 1 16-bit status register
MR 2 mode register
CCR 3 condition code register
OMR 4 operation mode register
SP 5 stack pointer register (hardware)
LA 6 loop address register
LC 7 loop counter register
SSL 8 low order 16 bits of stack data
SSH 9 high order 16 bits of stack data
X 10
X0, X1 11, 12
Y 13
Y0, Y1 14, 15
A 16
A0 ... A2 17 ... 19
B 20
B0 ... B2 21 ... 23
R0 ... R7 24 ... 31
R7 31 USP
N0 ... N7 32 ... 39
M0 ... M7 40 ... 47
FP -
UFP -
USP 31
EP 52 563xx/566xx DSP family
EMR 53 563xx DSP family
VBA 54 563xx/566xx DSP family
SC 55 563xx/566xx DSP family
SZ 56 563xx/566xx DSP family
CCNT -
ICNT -
FAST_MODE - 563xx/566xx DSP family

Table C-1: Fixed Register Set

PC, OMR, SP, LA, LC, SSL, SSH
The standard DSP56xxx PCU registers.

SR, CCR, MR
The status register, condition code register and mode register.

EMR DSP563xx extended mode register (part of SR).

VBA The vector base address register (DSP563xx/DSP566xx).

X ... X1, Y ... Y1, A ... A2, B ... B2
The standard DSP56xxx ALU registers.

R0 ... R7, N0 ... N7, M0 ... M7
The standard DSP56xxx AGU registers.

EP, SC, SZ DSP563xx/DSP566xx stack extension registers.

FP, USP, UFP The frame pointer, user stack pointer and user frame pointer. All debugger pseudo registers for walking the system stack or accessing the user stack used by reentrant functions of the c56 compiler.

CCNT The CycleCouNT register. The number of execution cycles is recorded in the CCNT register. The cyclecount register is not an on-chip register, nor a memory location on the target system, but a CrossView Pro internal data structure that can be accessed as if it is an ordinary register. The CCNT register is 32 bits wide.

ICNT The Instruction CouNT register. The number of instructions executed is recorded in the ICNT register. This register is a CrossView Pro internal data structure that can be accessed as if it is an ordinary register. The ICNT register is 32 bits wide.

FAST_MODE A pseudo-register to switch the accuracy of the DSP563xx and DSP566xx simulators and achieve a much higher simulation speed.

5 DSP56xxx Family Derivatives

The CrossView Pro package for the DSP56xxx family contains a number of register files (reg*.def) and the corresponding binary register definition files (reg*.dat) in the etc directory. You can create your own version of an existing file or build a new one for a derivative which is not (yet) supported.

For instance, to create a binary version for a DSP56302 , type:

Then start CrossView using -C 56302, or enter 56302 in the CPU type field of the Target | Settings dialog.

The following rules are used to find the reg*.dat files:

1. Look if the files are present in the current directory

2. Look in the etc subdirectory of your product tree.

6 DSP56xxx Register Set

For the DSP5600x CrossView uses reg5600x.dat by default, for the DSP563xx/DSP566xx this is reg563xx.dat. These default files are generated by the register manager when no input file is specified.

Examples:

or you can rename the default output name reg.dat.


Copyright © 2002 Altium BV