SourcePoint AMD Help

Table of Contents

msgdr

Add a DR scan into an existing JTAG message.

Syntax

[result =] msgdr(msg-handle, dr-length, readwrite[drscan-option])

Where drscan-option is one of the following:

[drscan-option] = [, write-array, [scan-chain, [0, [stop-state[, 0]]]]]

[drscan-option] = [, write-value, [scan-chain, [0, [stop-state[, 0]]]]]

Where:

result

is a boolean variable that contains the return value of this command. TRUE ย indicates the DR scan was successfully added to the JTAG message. FALSE indicates an error occurred, such as the JTAG message was not found.

msg-handle

is the name of a previously defined debug variable of type handle. This is the variable that was passed in to msgopen when the JTAG message was created.

dr-length

is an ord4 that contains the number of bits to be scanned to a data register (DR).

readwrite

is an ord1 that specifies the type of DR scan. See valid readwrite values below.

write-array

is an array of type ord1, ord2, or ord4, of bits to scan to the data register. If no write-array is specified, then zeros are scanned.

write-value

is an ord1, ord2, or ord4 value to scan to the data register. If no write-value is specified, then zeros are scanned.

scan-chain

is an ord1 that specifies which scan chain to select on the debug port. This may only be either 0 or 1. If scan-chain is not specified, then scan chain 0 is used.

stop-state

is an ord1 that specifies the TAP state in which to stop at the end of the scan. If stop-state is not specified, then 0 (RTI) is used.

Discussion

Use the msgdr command to add a data register (DR) scan to the open JTAG message. The DR length must be specified. The additional section of parameters, drscan-option, is optional. This command returns an error if the JTAG message has been closed.

The legal readwrite values for DR scans are:

0

write-only

1

readwrite

2

read0 (read by writing 0s to DR)

3

read1 (by writing 1s to DR)

The legal stop-state values are:

0

RTI : default

1

CAPTURE-PAUSE: stop in the DR pause state, no data are shifted

2

PAUSE: stop in the DR pause state

3

CAPTURE-RTI: force through the DR capture state, no data are shifted and stop in RTI

4

RTI-DUAL: go to RTI from the DR PAUSE, clocks both time bases, no data are shifted

5

CAPTURE-PAUSE-DUAL: stop in the DR pause state, clocks both time bases, no data are shifted

Example

Command input:

// Read JTAG ID from processor
define handle h
define ord2 device = 0
msgopen(h)
msgir(h, 8, 2) ย ย ย ย // 8=ir length, 2=idcode
msgdr(h, 0n32, 2)

msgclose(h)
msgscan(h, device)
define ord4 count = 0
msgreturndatasize(h, count, device)
define ord1 data[count]
msgdata(h, data)
data
msgdelete(h)

Related Topics: