Per Prog
Per Prog
TRACE32 Directory
TRACE32 Index
History ...................................................................................................................................... 3
Introduction ............................................................................................................................. 3
Peripheral File General Description 3
Passing Arguments 8
Memory Classes 10
Comma-Separated-Values (CSV) File Format for *.per Files 11
Editing a *.per File in CSV Format in a Spreadsheet Editor 12
Mixing Regular and CSV Formats 15
Functions ................................................................................................................................. 73
History ...................................................................................................................................... 74
Version 21-Feb-2020
History
17-Jul-18 Added section “Comma-Separated-Values (CSV) File Format for *.per Files” to describe the
use of the commands CSV and PERCMD by way of an example.
11-Jul-18 Added description and screenshot examples for the new command CSV and description for
the new command PERCMD.
29-Jun-18 Added description and examples for the new statement AUTOINDENT.
Introduction
This document describes the commands which are used to write peripheral files. This allows to
display/manipulate configuration registers and the on-chip peripheral registers at a logical level. Registers
and their contents are visible and accessible in the PER.view window.
Peripherals in MCU can be displayed and manipulated with the PER commands. TRACE32 offers
configurable window for displaying memory or I/O structures. Displaying the state of peripheral components
or memory based structures is very comfortable.
User can define 'chip macros' and put them together to generate 'project files'. These files describe the port
structure for a specific hardware system.
To start writing the peripheral file, please create a file with extension *.per.
“.per” is the TRACE32 standard extension for peripheral files.
The syntax of a peripheral file is line oriented. Blanks and empty lines can be inserted to define the
structure of the program. Comment lines start with semicolon.
; GROUP definition
GROUP.LONG 0x00++0x3
; register definition
LINE.LONG 0x00 "REG0,Register 0"
TREE.OPEN "PWM"
TREE "PWM1"
BASE ad:0xfffe1000
GROUP.LONG 0x00++0x3
LINE.LONG 0x00 "REG1,Register 1"
BITFLD.LONG 0x00 19. " BIT19 ,Bit 19" "0,1"
BITFLD.LONG 0x00 14.--15. " BIT15_14 ,Bits 15 to 14" "0,1,2,3"
TREE.END
TREE "PWM2"
BASE ad:0xfffe2000
GROUP.LONG 0x00++0x3
LINE.LONG 0x00 "REG2,Register 2"
BITFLD.LONG 0x00 8. " BIT8 ,Bit 8" "0,1"
BITFLD.LONG 0x00 5.--6. " BIT6_5 ,Bits 6 to 5" "0,1,2,3"
TREE.END
TREE.END
TREE "I2c Registers"
BASE ad:0xfffe3000
GROUP.LONG 0x00++0x3
LINE.LONG 0x00 "REG3,Register 3"
BITFLD.LONG 0x00 31. " BIT31 ,Bit 31" "0,1"
BITFLD.LONG 0x00 30. " BIT30 ,Bit 30" "0,1"
BITFLD.LONG 0x00 29. " BIT29 ,Bit 29" "0,1"
TEXTLINE " "
BITFLD.LONG 0x00 28. " BIT28 ,Bit 28" "0,1"
BITFLD.LONG 0x00 27. " BIT27 ,Bit 27" "0,1"
BITFLD.LONG 0x00 26. " BIT26 ,Bit 26" "0,1"
TEXTLINE " "
BITFLD.LONG 0x00 25. " BIT25 ,Bit 25" "0,1"
BITFLD.LONG 0x00 24. " BIT24 ,Bit 24" "0,1"
BITFLD.LONG 0x00 23. " BIT23 ,Bit 23" "0,1"
TREE "Transmit/Receive Registers"
GROUP.LONG 0x10++0x17
LINE.LONG 0x00 "REG4,Register 4"
LINE.LONG 0x04 "REG5,Register 5"
LINE.LONG 0x08 "REG6,Register 6"
LINE.LONG 0x0c "REG7,Register 7"
LINE.LONG 0x10 "REG8,Register 8"
LINE.LONG 0x14 "REG9,Register 9"
TREE.END
TREE.END
You can pass arguments from a PRACTICE script to a PER file (peripheral file). These arguments can be
strings, hex and decimal values. See below for an example and an illustration and explanation of the
example.
Example
PRACTICE script (*.cmm) - Bold and red are used to highlight the information flow:
;Declare four PRACTICE macros and assign values to the PRACTICE macros
LOCAL &addr ®64bit &name &idx
The above PRACTICE script (*.cmm) calls this PER file (*.per):
CONFIG 16. 8.
WIDTH 10.
;The PER.view command arguments are passed to the ENTRY command arguments
ENTRY &baseaddr=0x0 ®64bit=0. &modulename="foo" &index=1.
BASE D:&baseaddr
SIF (®64bit==1.)
TREE "64bit Register Group &modulename"
GROUP.QUAD (0x8*&index)++0x07
LINE.QUAD 0x00 "CTL&index,Control Register &index"
TREE.END
ELSE
TREE "32bit Register Group &modulename"
GROUP.LONG (0x4*&index)++0x07
LINE.LONG 0x00 "CTL&index,Control Register &index"
TREE.END
ENDIF
NOTE: Although the ENTRY command arguments may look like PRACTICE macros, they
are not PRACTICE macros and do not behave like PRACTICE marcos:
• When you try to create PRACTICE macros with the LOCAL command
inside a PER file and compile it, you receive the error message “unknown
command”.
• When you try to assign an ENTRY command argument to another
ENTRY command argument (&arg2=&arg1) inside a PER file and com-
pile it, you also receive the error message “unknown command”.
B
A
C
A The four values passed to the PER file are displayed in the window caption.
C Result of the information flow highlighted in bold and red in the above example (see &name).
NOTE: In the PER file, valid default values must be assigned to each ENTRY command
argument. See highlighted values in the ENTRY line.
The default values in the ENTRY line ensure that no “syntax error” is reported when
a PER file is compiled in the built-in TRACE32 editor PER.Program.
When the PRACTICE macro values are passed to the same PER file, the passed values override the
default values in the ENTRY line of the PER file.
Format: <class>:<base_address>
<class> Appropriate access method to memory class (D, SD, A, AD, AP, ANC,DC, IC,
NC, ED, EAD, VM, P, etc.)
Peripheral files can be formatted as comma-separated values, i.e. the same format as in *.csv files.
However, the file extension for peripheral files remains *.per, as usual. The CSV format extends the regular
peripheral command set and offers you an alternative way to create and maintain peripheral files more easily
in a spreadsheet. Therefore it usually offers better readability. Peripheral files in CSV format can also be
generated more easily from binary files (such as netlists, etc.) by automated tools.
The same register definitions in CSV format and displayed in a spreadsheet editor (excerpt from
~~/demo/per/percsv_simple.per):
Whenever necessary, you can still mix the regular and CSV file format.
- Open/Import an existing *.per file. Make sure comma is selected as separator and the single
quote as text delimiter:
2. The first command in the *.per file (except comments) must enable CSV capabilities:
CSV.ON
- The column name arguments of the PERCMD command will serve as column headers in your
spreadsheet, see [X] below.
- To freeze the headers, choose View menu > Freeze Rows and Columns.
- If you omit the PERCMD command: The first column must always contain peripheral file
commands only and must be kept empty otherwise!
A
B
C
Rules:
• A new register [A] will be created if at least one of the following conditions applies:
• A new customized bit description [B] will be created if the following conditions are all true:
• A new bit or bit range [C] is displayed as hexadecimal if the following conditions are all true:
In order to simplify matters, peripheral files in CSV format do not offer the full functional range of regular *.per
files. However, you can easily include regular *per commands in the first column:
In above example we utilize the regular peripheral commands TREE, IF and NEWLINE. In all other cases,
the first column must remain empty!
The GROUP commands describe how data is basically read or written to/from memory.
The GROUP commands control the debugger access to the target memory.
If a name is given, the GROUP is separated from the previous lines and the name is used as headline in the
per window. Using numerical values (without memory access class) in address parameter, the address is
calculated by the entered value plus the base address (defined by the last BASE command). The GROUP
can either use normal memory access or fifo access (reads all bytes from the same address). The
whole address range of the GROUP command is read at once. Reading from reserved address range
may cause a bus error.
Example 1:
Example 2:
BASE ad:0x00000000
GROUP.BYTE 0x100 0x8 "Receiver FIFO"
LINE.BYTE 0x0 "F0,FIFO position 0"
LINE.BYTE 0x1 "F1,FIFO position 1"
LINE.BYTE 0x2 "F2,FIFO position 2"
LINE.BYTE 0x3 "F3,FIFO position 3"
LINE.BYTE 0x4 "F4,FIFO position 4"
LINE.BYTE 0x5 "F5,FIFO position 5"
LINE.BYTE 0x6 "F6,FIFO position 6"
LINE.BYTE 0x7 "F7,FIFO position 7"
Similar to GROUP, but this definition is useful for ports which are cleared by a read access. Refer to the
GROUP command description. HGROUP command prevents target memory from the periodic read access
and is useful for 'write-only' ports. In hidden GROUPs only hidden elements e.g. HIDE command should be
used.
Similar to GROUP, but this definition is useful for ‘read-only’ ports. Refer to the GROUP command
description.
WSGROUP is a specific GROUP command, which forces the debugger to access different registers for read
and for write accesses. It is only useful, if the core has write-only registers and their contents are duplicated
in shadow registers, which are read- and writable.
• write access: Data is written to write-only registers (dataGROUP) as well as to the shadow
registers.
Example:
Similar to GROUP command. This definition is useful for 'write-only' ports. The current state of the port is
held in the emulation memory (must be mapped at this location). Refer to the GROUP command
description.
Example:
Usually GROUP commands specify the target memory accesses and the following commands e.g. BITFLD,
HEXMASK, etc. define how the data are displayed in the per window.
With SGROUP data is not accessed with SGROUP itself, but by a sequence of special commands, which
transfer data from memory to the “SGROUP data buffer” or from the “SGROUP data buffer” back to memory.
The size of the buffer is 256 bytes.
Afterwards this sequence of special commands the data in the buffer can be displayed by following
commands e.g. BITFLD, HEXMASK.
To read/write data from/to memory to/from SGROUP buffer you can use the following commands (which are
only allowed in SGROUPs):
Command Function
The given value is written to the target memory at the specified address or at the base address with added
offset. The specified value is written continuously.
<format> Defines specific format (Byte, Word, TByte, Long, Quad, LE, BE).
Example:
A value stored in a buffer at the given buffer offset is written to the target memory at the specified address or
base address with added offset. The value is written only once.
Example:.
CONFIG 16. 8.
WIDTH 10.
BASE 0x80000000
TREE "Test Registers"
;write into buffer : 0x1122 at offet [0], 0x3344 at [4], 0x5566 at [8]
SGROUP
CONSTX 0 %l 0x1122
CONSTX 4 %l 0x3344
CONSTX 8 %l 0x5566
LINE.LONG 0x0 "TestR1,Test Register 1"
LINE.LONG 0x4 "TestR2,Test Register 2"
LINE.LONG 0x8 "TestR3,Test Register 3"
GETX command reads data from the memory and puts it to the buffer. The memory contents from the
given address is read using specified access width format. The read data is stored in a buffer at the
defined offset.
Example:
BASE d:0x80000000
TREE "Test Registers"
SGROUP ; define sequence GROUP
SET d:0x80000004 %l 0x18 ; write value 0x18 to target memory
; at d:80000004
GETX 4 %l 0 ; read out target memory at base
; address d:80000000+offset 4 and
; store it at buffer+offset 0
LINE.LONG 0x0 "Test,Test Register" ; display data of buffer[0…3]
TREE.END
CONSTX command writes a constant value to the buffer. This data is not written to the target memory. The
data can be displayed with a following line command.
<format> Defines specific format (Byte, Word, TByte, Long, Quad, LE, BE).
Example:
VARX command writes a variable value to the SGROUP buffer. This data is not written to the target
memory. The data can be displayed with a following line command.
<format> Defines specific format (Byte, Word, TByte, Long, Quad, LE, BE).
The VARX command is very similar to the CONSTX command. However the value, which should be
assigned to the SGROUP buffer may be based on PRACTICE functions, whose values may change during
the display of the PER window.
With VARX you can modify the SGROUP buffer in any way you like by using the following PRACTICE
functions, which access the SGROUP buffer:
Due to performance reasons you should use VARX only, if there is no other solution possible.
Format: WRITEBACK
Separates the write part of a sequence from the read part. Command is only allowed in SGROUP.
Example 1:
SGROUP
SET 0 %l 0x1014
GETX 0 %l 0
WRITEBACK
CONSTX 2 %w 0x2014
SETX 0 %l 0
LINE.LONG 0x0 "LEDCONFIG,LED Configuration Register (20)"
BITFLD.LONG 0x0 31. "RES ,Reset" "No,Yes"
BITFLD.LONG 0x0 30. " LOOP ,Loopback" "No,Yes"
BITFLD.LONG 0x0 29. " SPEED ,Speed" "10,100"
The commands after write back are executed only if PER.Set command is used. For displaying the data in
the PER-window these commands are ignored.
Changing state of the ENABLE bit results also in writing constant value 0x2222 to the register.
With ASSERT you can ensure that your environment meets a certain condition, before TRACE32
should go on with the parsing of the PER file.
If you omit the optional string with an error message, the following message will be shown instead:
Assertion failed: <expression>
Example: This code line ensures that a PER file is only parsed by “TRACE32 for ARM”
ASSERT CPUFAMILY()=="ARM" "Sorry, this PER file is only for ARM cores"
Default: OFF
Switches automatic indentation ON or OFF. Only available for TRACE32 versions >= 97444.
AUTOINDENT ignores all leading and trailing space characters within subsequent definitions and
rearranges the contents according to the specified <alignment> and <type>. It affects all entries within a
TREE and should therefore only be activated or changed outside of a TREE. Otherwise the result may be
undefined.
©1989-2020 Lauterbach GmbH
Peripheral Files Programming Commands 30
<alignment> Alignment of the values in relation to their description: LEFT, RIGHT,
CENTER.
Default: LEFT
For examples, see here.
Sometimes you may want to concatenate bits or include text fragments without switching auto-indentation
OFF. To override auto-indentation in this special case, omit the <name> entry of the HEXMASK or BITFLD.
Let’s illustrate the override effect by comparing two source code snippets, one with <name> and the other
one without <name>. The relevant part in each source code snippet is highlighted in red in the two
PER.Program windows. The results are displayed directly below in the two PER.view windows.
With <name>:
Without <name>:
Code Example
<alignment> Examples
Example 3: AUTOINDENT.ON CENTER TREE moves the values somewhere to the middle so they are
aligned.
Example 1: AUTOINDENT.ON LEFT TREE aligns all description-value pairs within a TREE.
Example 2: AUTOINDENT.ON LEFT LINE aligns all description-value pairs within a LINE.
5 5
Example 4: AUTOINDENT.ON RIGHT GRID 5 16. divides the window into the given number of <columns>
which are <width> characters wide each.
16
A In case a description-value pair does not fit within a column, two (or more) columns will be merged ->
see red box above.
B When defining the <width> of the columns, please take the first 3 separation characters into account.
This command is useful for peripheral files which have been generated automatically and do not contain any
NEWLINE statements. These will be added automatically if a LINE contains more than <columns>
subentries. NEWLINE statements, however, can still be added manually.
This command sets the start address for the peripheral module and refers to simple offset ranges. This
expression is permanently recalculated. If the parameters contain functions or symbols, it reflects later
changes in the parameters. The BASE command specifies memory class which is responsible for setting
appropriate addressing mode. Memory classes are described in Memory Classes section.
<address> Fixed address or expression which evaluates to the start address of the
peripheral groups following the BASE command.
Example:
Like the BASE command BASEOUT defines a start address for the peripheral group definitions following
the BASEOUT command. This address is usually frequently calculated by the given address
expression.
<addr_expr> Expression which evaluates to the start address of the peripheral groups
following the BASEOUT command.
<data> Data which should be send to the specified address before evaluating the
address expression. This could also be a bit-mask.
Please consider: As the display is refreshed permanently the memory at <address> is modified
permanently as well.
Example 1: Write 0x01 to address 0x100 before reading the base address from address 0x104.
The GROUP command will then read the first three lines at that base address.
Example 2: Set the LSB in address 0x200 before reading the base address from 0x202.
Outputs a value before calculating a base address with restore. This command is almost the same like
BASEOUT. However, unlike BASEOUT the data on the specified address gets restored after evaluating
the address expression.
<addr_expr> Expression which evaluates to the start address of the peripheral groups
following the BASESAVEOUT command.
<data> Data which should be send to the specified address before evaluating the
address expression. This could also be a bit-mask.
CONFIG Configure default access width and line break for BIT
[Example]
Configures the default access width used with GROUP.auto, aligns the field description after a LINE
statement, and configures the bits-per-line emitted by the BIT statement.
<access_width> By default the <access_width> is set to 8, which means (a) byte accesses to
the memory by GROUP.auto and (b) no extra white space after any LINE
statement. The access width in bits configures two things:
WIDTH 9. 10.
CONFIG 16. 4.
GROUP.auto D:0x000++1
LINE.BYTE 0x00 "myLine"
BIT 7. "flag7" "-,on"
BIT 6. "flag6" "-,on"
BIT 5. "flag5" "-,on"
BIT 4. "flag4" "-,on"
BIT 3. "flag3" "-,on"
BIT 2. "flag2" "-,on"
BIT 1. "flag1" "-,on"
BIT 0. "flag0" "-,on"
NEWLINE
BITFLD.BYTE 0x00 0--1 "myBitFieldName " "john,paul,george,ringo"
C B
A D
A Display width of the hex value emitted by the LINE statement. This width is the first parameter of
the CONFIG statement.
In this example, <access_width> is 16 bits, i.e. (<access_width> + 3) / 4 + 1 = 5 characters.
B Number of BIT items in one single line before an automatic line break. This is configured with the
second parameter of the CONFIG statement. (here: 4 BIT in one line).
C Width of the register name emitted by the LINE statement. This width is configured with the first
parameter of the WIDTH statement. (here: 9 characters)
D Width of a bit displayed by the BIT statement. This width is configured with second parameter of the
WIDTH statement. (here: 10 characters)
Enables or disables the new CSV file format for *.per files. For more information, see “Comma-Separated-
Values (CSV) File Format for *.per Files”, page 11.
With DEF parameter the endianness is set due to the configuration of the debugger. With this command the
debugger accesses the target data with the specified endianness. This is done independent of the target
and the system endianness settings.
Example:
Assign parameters used to open the peripheral file to macros, to parametrize the peripheral view (similar to
the PRACTICE ENTRY command).
Defines a button in the last GROUP header or tree control. HELP.Online calls the TRACE32 online manual.
HELP.Winhelp calls a windows help file (available on Windows only).
Format: IF <condition>
ELIF <condition>
ELSE
ENDIF
GROUPs defined in different IF and ELIF statements are overlaid at the same place in the window.
Only GROUPs which reside within the fulfilled condition are displayed. The ELSE part is displayed only
when no other condition is true. All conditions are dynamically recalculated to reflect the current state of the
peripheral.
NOTE: The IF command cannot be used inside a GROUP. (Please use IF always
before a new GROUP.).
NOTE: Unlike in the C programming language, the IF statement always evaluates all
expressions also for logical operators && and ||.
IF (((Data.Long(d:0x00))&0xf)==0x0)
GROUP.LONG d:0x0++0x7
LINE.LONG 0x0 "CR,Control register"
BITFLD.LONG 0x0 0.--1. " REGSEL ,Register select" "RegA,RegB,RegC,RegD"
LINE.LONG 0x4 "REG_A,Register A"
ELIF (((Data.Long(d:0x00))&0xf)==0x1)
GROUP.LONG d:0x0++0x7
LINE.LONG 0x0 "CR,Control register"
BITFLD.LONG 0x0 0.--1. " REGSEL ,Register select" "RegA,RegB,RegC,RegD"
LINE.LONG 0x4 "REG_B,Register B"
ELIF (((Data.Long(d:0x00))&0xf)==0x2)
GROUP.LONG d:0x0++0x7
LINE.LONG 0x0 "CR,Control register"
BITFLD.LONG 0x0 0.--1. " REGSEL ,Register select" "RegA,RegB,RegC,RegD"
LINE.LONG 0x4 "REG_C,Register C"
ELSE
GROUP.LONG d:0x0++0x7
LINE.LONG 0x0 "CR,Control register"
BITFLD.LONG 0x0 0.--1. " REGSEL ,Register select" "RegA,RegB,RegC,RegD"
LINE.LONG 0x4 "REG_D,Register D"
ENDIF
Register REG_A is selected if the value of the REGSEL bit field equals 0.
Register REG_B is selected if the value of the REGSEL bit field equals 1.
Register REG_C is selected if the value of the REGSEL bit field equals 2.
Register REG_D is selected if the value of the REGSEL bit field equals 3.
Format: PERCMD,<column_list>
<column_ Address,AccessWidth,Name,Tooltip,From,To,Choices[,RW][,Ignore]
list>:
• Default: If the PERCMD command is omitted in the CSV-formatted *.per file, then the sequence
of columns must be: Address,AccessWidth,Name,Tooltip,From,To,Choices
• If the PERCMD command is included in a CSV-formatted *.per file, then <column_list> must
contain all column names that are flagged as mandatory in the table below. Column names are
case sensitive!
NOTE: With the PERCMD command included in the CSV-formatted *.per file, you are free
to arrange the mandatory and optional columns in any order.
Please also refer to “Comma-Separated-Values (CSV) File Format for *.per Files”, page 11.
Address Absolute address of a register consisting of access class and value, or the
(mandatory) offset from a previously defined BASE command.
If empty, the value is assumed to be the same as the last known one.
An address different from the previous one corresponds to the LINE
command.
AccessWidth Access width of the register. Valid values are: 8. 16. 32. and 64.
(mandatory) If empty, the value is assumed to be the same as the last known one.
An access width different from the previous one corresponds to the LINE
command.
Tooltip Tooltip or more meaningful name of the register, e.g. the long form of the
(mandatory) register name.
• Empty:
Corresponds to the HEXMASK command.
• Empty:
Defines a HEXMASK, BITFLD or EVENTFLD command, see
ClearFrom.
• Empty:
Corresponds to HEXMASK or BITFLD command.
• Empty:
Corresponds to HEXMASK or BITFLD command.
• Empty:
Corresponds to HEXMASK or BITFLD command.
Ignore • Ignores a column that is irrelevant for a *.per file, e.g. redundant
(optional) columns extracted from binaries.
PERCMD,Address,AccessWidth,Name,Tooltip,From,To,Choices,Ignore,myCol1
According to the condition a block between SIF and ENDIF (or SIF and ELSE) will be interpreted when the
peripheral file is opened or reparsed. The SIF command can be used also inside the GROUPs.
Example:
SIF (cpu()=="MIPS4KC")
GROUP.LONG CP0:16.++0.
LINE.LONG 0x0 "Config,Configuration Register"
BITFLD.LONG 0x00 31. " M ,Config1 register is implemented" "no,yes"
...
ELIF (cpu()=="MIPS4KEC")
GROUP.LONG 0x0 "Config,Configuration Register"
BITFLD.LONG 0x00 31. " M ,Config1 register is implemented" "no,yes"
...
ELSE
GROUP.LONG 0x0 "Config,Configuration Register"
BITFLD.LONG 0x00 31. " M ,Config1 register is implemented" "no,yes"
...
ELSE
ENDIF
Conventions :
SIF is only to be used to distinguish between CPUs, memory accesses should be avoided (not possible in
system.mode down).
Using once a GROUP command inside a SIF block, all trees of the SIF block must contain GROUP
commands. Also the next command after a finished SIF block must be a GROUP command then.
Defines a “Treeview” of peripheral modules. The tree can be displayed/hidden by a tree control (+/-). It is
possible to nest trees.
Example:
<register_name> Sets the width of the register name emitted by the LINE statement.
(default: 6.)
<bit_width> Sets the width reserved for the output of a BIT statement. This setting
(default: 9.) affects only the BIT statement, but not the BITFLD statement (or others).
The WAIT command is available for all architectures and PER files, but it should only be used when required
(i.e. SIF with target-dependent values). Most architectures will probably not require WAIT. But if there is a
need to use WAIT, then the recommendation is to use WAIT at the beginning of a PER file.
There are four ways to use the WAIT command, see examples 1 to 4.
Example 1: Wait with compilation until the target is up and regular memory can be accessed (this usually
means that the target is stopped).
WAIT
Example 2: Wait with compilation until the target is up and the given memory address can be accessed (it is
never really accessed).
WAIT ETM:0
Example 3: Wait with compilation until the target is up and the expression can be evaluated (the result does
not matter).
WAIT Data.Long(D:0)
Example 4: Wait with compilation until the target is up and the boolean expression evaluates to true.
WAIT Data.Long(D:0)!=0
These commands are only useful inside a GROUP (GROUP, RGROUP, WGROUP, HGROUP, SGROUP).
Beside the commands INDEX, SAVEINDEX and BUTTON, which extend the memory access by a GROUP,
the commands define how the data fetched by a GROUP command should be displayed and/or modified.
Format: ASCII
Example:
These fields are in fixed positions in the per window. The bit numbers must be entered from MSB to LSB.
The size of a field depends on the number of bits and the size of the name header.
<bit> | Defines bit’s number and range. LSB is defined as the first, MSB as the
<bitrange> second character.
<choices> Indicates states with bit field may take. LSB is defined as the first, MSB as
the last one. Each state is separated by a comma.
Example:
BITFLD is used to display the bit field name and its contents in a free format. The fields are chained together
in a line. A new line can be created by a TEXTLINE command.
<offset> The bit field offset refers to the start address of the GROUP command.
<bit_range1> Defines a range of bits (or a single bit) that belong to a bit field. The lower
bit number has to come before the higher bit number, e.g. 3.--7.
<bit_range2> For disjunct bit fields (= where not all bits are in one block), you can define
a second range of bits (or a single bit). Please see examples.
<choices> Defines the possible values (in words) which the bit field may take. LSB is
defined as the first, MSB as the last one. Each state is separated by a
comma.
If you define fewer <choices> than required for the <bit_range>, then
append %x...
%x... Placeholder for reserved/unused values at the end of <choices>. The val-
ues will be formatted as hexadecimal numbers when displayed in the
PER.view window.
The field width is defined by the <choices>. If the hex value is too large to
fit into the field, a question mark is displayed.
<string>... Placeholder for reserved/unused values at the end of <choices>. The val-
ues will be displayed as strings in the PER.view window.
BASE d:0x00000000
GROUP 0x00++0x03
LINE.LONG 0x00 "CR,Control Register"
BITFLD.LONG 0x00 31. " CONV ,Conversion Bit" "No effect,Conv"
BITFLD.LONG 0x00 24. " TR ,Transfer" "No effect,Transferred"
BITFLD.LONG 0x00 16.--19. " CS ,Chip Select"
"CS0,CS1,CS2,CS3,CS4,CS5,CS6,CS7,CS8,CS9,CS10,CS11,CS12,CS13,CS14,CS15"
BITFLD.LONG 0x00 5. " ONCHIP ,On chip trace implemented" "Not
implemented,Implemented"
TEXTLINE " "
BITFLD.LONG 0x00 1. 3. " DETM ,Detection mode"
"Rising,Falling,High level,Low level"
BITFLD.LONG 0x00 0. " RST ,Reset mode" "No reset,Reset"
Example 2: 31 ... 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Example 3: 31 ... 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Example 4: 31 ... 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Example 5: 31 ... 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Example 6: 31 ... 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
;Example 1 <bit_range1>
BITFLD.<size> 0x00 2.
;Example 2 <bit_range1>
BITFLD.<size> 0x00 2.--8.
Clicking an input field (button) executes the defined command line. This field can be used to execute
input/output commands or open different views (e.g. memory dumps).
GROUP.LONG 0x00++0x3
LINE.LONG 0x00 "MEM,Memory Array"
BUTTON "MEM " "Data.dump ad:0x5C000000--ad:0x5C01FFFF /Long"
GROUP.LONG D:0x00++0xFF
LINE.LONG 0x00 "RST_VEC,Reset Vector"
BUTTON "Clear Vector Table"
(
Data.dump 0x00++0xFF /Long
Data.set %Long ad:0x5C000000++01FFFF 0
)
Copies the last defined GROUP to the current GROUP. The optional argument defines which GROUP
should be copied. Number of the GROUP is calculated backward form the current one. The command is
used to duplicate the definition of GROUPs, e.g. for devices with many equal channels.
Example 1:
GROUP.WORD sd:0x80008034--0x80008035
LINE.WORD 0x0 "SWI,Segment Width"
GROUP.WORD sd:0x80008036--0x80008037
LINE.WORD 0x0 "SPR,Segment Priority"
GROUP.WORD sd:0x80008038--0x8000803f "MMU Descriptor 0"
LINE.WORD 0x0 "SL,Segment Length"
LINE.WORD 0x2 "SNR,Segment Number"
bit 5 " FN, Flush" "Inv.,Valid"
LINE.WORD 0x4 "SB,Segment Base Address"
GROUP.WORD sd:0x80008048--0x8000804f "MMU Descriptor 1"
COPY 2
GROUP.WORD sd:0x80008050--0x80008057 "MMU Descriptor 2"
COPY 4
While the similar command HEXMASK displays bits as a hexadecimal value, DECMASK displays bits as
decimal value.
DECMASK defines a set of bits, which should be displayed as decimal value. The bits are extracted from
the current buffer at location defined in the bitrange. The result of this extract is multiplied by <scale> and
increased by the optional <add> value.
<display_length> Length of displayed field (Byte, Word, TByte, Long, PByte, HByte,
SByte, Quad).
<bit_range> Defines range of the DECMASK field. LSB is defined as the first, MSB as
the second character.
While the similar command DECMASK displays bits only as a decimal value without positions after decimal
point, FLOATMASK displays bits as decimal value with positions after decimal point.
FLOATMASK defines a set of bits, which should be displayed as decimal value. The bits are extracted from
the current buffer at location defined in the bitrange. The result of this extract is multiplied by <scale> and
increased by the optional <add> value.
<offset> The FLOATMASK field offset refers to the start address of the GROUP
command.
<bit_range> Defines range of the FLOATMASK field. LSB is defined as the first, MSB
as the second character.
Defines an event bit display in a free format. An event bit can be cleared by writing a ’1’. Writing '0' does not
affect event bit. The fields are chained together in a line. A new line can be created by a TEXTLINE
command. The implementation format is the same as a BITFLD format.
<offset> The event bit offset refers to the start address of the GROUP command.
<bit_range> Defines range of the bit field. LSB is defined as the first, MSB as the sec-
ond character. Optionally the third character is bit (or bit range), used if
two bit fields are conjuncted.
<choices> Indicates states with bit field may take. LSB is defined as the first, MSB
as the last one. Each state is separated by a comma.
Example:
Defines HEX value in a free format. The fields are chained together in a line. A new line can be created
using TEXTLINE command. If not the whole value should be displayed. The output size can be limited by
the “length” parameter.
<offset> The HEX field offset refers to the start address of the GROUP command.
Example:
Defines set of bits using HEX value. The bits are extracted from the current buffer at location defined in the
bitrange. The result of this extract is multiplied by scale. The <add> value is optional.
<display_length> Length of displayed field (Byte, Word, TByte, Long, PByte, HByte,
SByte, Quad).
<offset> The HEX mask field offset refers to the start address of the GROUP
command.
<bit_range> Defines range of the HEX mask field. LSB is defined as the first, MSB as
the second character.
Example:
CONFIG 16. 8.
BASE 0x0
WIDTH 6.
GROUP.LONG 0x00++0xb
LINE.LONG 0x00 " REG0,register 0"
HEXMASK.LONG 0x00 0.--29. 1. 1. " EX_HEX1 ,Example Hex mask 1"
LINE.LONG 0x04 " REG1,Register 1"
HEXMASK.LONG.BYTE 0x04 23.--30. 1. 2. " EX_HEX2 ,Example Hex mask 2"
TEXTLINE " "
HEXMASK.LONG.WORD 0x04 4.--15. 8. " EX_HEX3 ,Example Hex mask 3"
LINE.LONG 0x8 " REG2,Register 2"
HEXMASK.LONG.TBYTE 0x08 0.--23. 1. 6. " EX_HEX4 ,Example Hex mask 4"
This field is used for write-only ports like USART transmitters data registers. HIDE command should be
used together with HGROUP command.
<offset> The register offset refers to the start address of the HGROUP command.
Example:
HGROUP.LONG 0x00++0x3
HIDE.LONG 0x00 "WR,Write only Register"
Format: IN
An input-field (key) is displayed for the previously defined byte. Clicking that field results in reading data from
previously defined location. To execute a read cycle IN command must be used along with a HIDE definition.
It is used for destructive-read ports (i.e. data port of serial interface).
Example:
BASE d:0xA00F0000
HGROUP.LONG 0x00++0x3
HIDE.LONG 0x00 "RFR,Receive FIFO Register"
IN
Sends specified data to the port. INDEX command must be placed after a GROUP definition. The data is
sent to the port prior to the port access or modification. If two bytes are defined, the second byte is used for
writing to the specified port (different indices for reading and writing). It is useful for ports which must be
selected first.
Please consider: As the display is refreshed permanently the index register is modified as well.
<dataread> Data send to the specified address before fetching the data shown by the group
definition.
<datawrite> Data send to the specified address before executing a write to a member of the
group definition.
Example 1:
Example 2:
The LINE command defines registers short name and its long name. The value of the offset is added to the
address defined in the previous GROUP command. The CONFIG command affects the displayed format
of the LINE command.
<format> Display register content as floating point number. Currently the following
formats are supported:
<offset> The register offset refers to the start address of the GROUP command.
Example:
BASE 0x0
WIDTH 6.
GROUP.QUAD 0x00++0x7
LINE.QUAD 0x00 " REG0,Register 0"
GROUP.LONG 0x08++0x3
LINE.LONG 0x00 " REG1,Register 1"
GROUP.TBYTE 0x0c++0x2
LINE.TBYTE 0x00 " REG2,Register 2"
GROUP.WORD 0x10++0x1
LINE.WORD 0x00 " REG3,Register 3"
GROUP.BYTE 0x14++0x0
LINE.BYTE 0x00 " REG4,Register 4"
Usually byte ordering is either little endian or big endian mode. For PPC additional munging little endian and
munging big endian modes are provided. For a detailed description refer to PPC documentation.
MUNGING.LE
Format: NEWLINE
Creates a line break for the detailed description of the fields of a peripheral register. The indentation of the
new line can be configured with the first parameter of WIDTH and CONFIG.
CONFIG 32.
WIDTH 10.
GROUP.LONG D:0x100++3
LINE.LONG 0x00 "STATUS,Status Register"
BITFLD.LONG 0x00 31. " Z ,Zero Flag" "off,on"
BITFLD.LONG 0x00 30. " N ,Negative Flag" "off,on"
NEWLINE
BITFLD.LONG 0x00 29. " C ,Carry Flag" "off,on"
BITFLD.LONG 0x00 28. " V ,Overflow Flag" "off,on"
NEWLINE
BITFLD.LONG 0x00 27. " E ,Interrupt Mask" "off,on"
HEXMASK.LONG.TBYTE 0x00 0.--23. 4 " PC ,Program Counter"
RBITFLD is identical to BITFLD with the difference that the defined bits are read-only. It can be used to
visualize that certain settings within a read-write register are read-only.
<offset> The bit field offset refers to the start address of the GROUP command.
<bit_range> Defines range of the bit field. LSB is defined as the first, MSB as the sec-
ond character. Optionally the third character is bit (or bit range), used if
two bit fields are conjuncted.
<choices> Defines the possible values (in words) which the bit field may take. LSB is
defined as the first, MSB as the last one. Each state is separated by a
comma.
BASE D:0xF0001234
GROUP 0x00++0x03
LINE.LONG 0x00 "CSR,Control and Status Register"
RBITFLD.LONG 0x00 1. " RSTST ,Reset status" "Reset inactive, Reset
active"
BITFLD.LONG 0x00 0. " RST ,Reset" "No reset,Reset"
Sends the specified data to the port. The current values at the port are read before the access is made and
are restored after the access. The byte is sent to the port prior to the port access or modification.
SAVEINDEX command must be placed after a GROUP definition. If two bytes are defined, the second byte
will be used for writing to the specified port (different indices for reading and writing). This is useful for ports
which are selected by another port when the index register can be read back.
<dataread> Data send to the specified address before fetching the data shown by the
group definition.
<datawrite> Data send to the specified address before executing a write to a member of
the group definition.
Defines a bit display in a free format. The fields are chained together in a line. A new line can be created by
a TEXTLINE command.
<choices> Indicates states with bit field may take. The first state is responsible for
clearing, the second one for setting corresponding set/clear bits. Each
state is separated by a comma.
The command is an extension of the BITFLD command. Additionally to the BITFLD command two further
locations must be entered. The first parameter pair offset1 - bit1 is the location where the data is read from.
The second parameter pair offset2 - bit2 is the set location. The third parameter pair offset3 - bit3 is the clear
location.
Usually the SETCLRFLD-command is used if the read location is a status register, which shows the status
of I/O ports and other (not static) registers exist to enable and disable ports. If the port is enabled, the value
of '1' is set to the corresponding bit in the register addressed by location 2 (other bits are cleared). If the port
is disabled, the value of '1' is set at the corresponding bit position in the register addressed by location 3 (the
other bits are cleared).
BASE sd:0xffec0000
GROUP.LONG 0x00++0x3
LINE.LONG 0x00 "Int_0,Interrupt Register 0"
SETCLRFLD.LONG 0x0 0. 0x4 0. 0x8 0. " B_0 ,Bit 0"
"No Interrupt,Interrupt"
Defines a field to display an ASCII encoded string, which is saved in target memory.
Format: SYSCON
The text can either be used as general comment or as a header to BITFLD or HEXFLD fields. TEXTLINE
creates a new line.
The table below shows an extract of functions useful for writing PER files.
For information about the availability of certain commands, refer to the build numbers.
Build 97778 New command AUTOINDENT to automatically indent names and values.
19. Jun. 2018
Build 88576 New command NEWLINE to get a line break with indentation inside a detailed
08. Sep. 2017 register description.
Build 72790 New command STRING to view strings from target memory.
04. May. 2016
Build 53657 New command INCLUDE to include one peripheral file in another one.
16. May. 2014 New command ENTRY to allow parameterization.
Build 20627 Enhanced SGROUP commands SET and CONSTX to accept also bitmasks
24. Nov. 2009 and hexmasks for <value>.