SourcePoint AMD Help

Table of Contents

drscan

Scan the data registers of devices on the JTAG chain.

Syntax

drscan(device, bitCount, readArray [, writeArray])

drscan(device, writeArray)

Where:

device

is an int4 that specifies the position of the device to access. Device positions are displayed by the devicelist command.

bitCount

is an expression that evaluates to the number of bits to scan to or from the data register of the designated device as selected by the current instruction register value.

readArray

is a debug array you have defined that is large enough to hold the scanned data register. This array must be equal to or larger than the number of bits specified to scan from the data register. Array elements that are not used are unchanged.

writeArray

is a debug array you have defined that holds the value you want to scan into the data register. If this array is smaller than the number of bits to be scanned into the data register, an error occurs.

Description

Use drscan to read or write the data registers of devices on the JTAG chain. The device specification determines which device in the chain is scanned. All other devices are in bypass.

The instruction current in the instruction register of the specified device determines the data register that is scanned. Use the irscan command to write an instruction to the instruction register.

The bitCount value determines the number of bits that will be scanned. A debug array that will read these scanned bits must contain at least as many bits as are to be scanned. A debug array that will write the scanned bits also must have at least as many bits as the number of bits to be scanned in. The drscan command will only use array types for parameters, you cannot use a signed or unsigned value (e.g., ord8) even though it may contain enough bits.

The drscan command can be used to either read a data register, write a data register, or both read and write a data register. When writing only from a device data register you must use the extra comma ( , ) placeholder to specify the write-array parameter position. The following are acceptable forms for the drscan command:

drscan(0, 1, ReadArray)

drscan(0, 1, , WriteArray)

drscan(0, 1, ReadArray, WriteArray)

Example 1

To write instruction and data to device 0 and ignore return data:

Command input:

irscan(0, 1)

define ord1 a_o1WriteToDeviceArray[0n20] ย ย // big enough to hold 159 bits

drscan(0, 0n159, , a_o1WriteToDeviceArray)

Example 2

To write instruction and data to device 5 and save return data:

Command Input:

irscan(5, 0x10)

define ord1 ReadFromDeviceArray[0n17] ย ย ย ย ย // enough to hold 0x82 bits

define ord1 WriteToDeviceArray[0n17] ย ย ย ย ย ย // filled with 0's to write

drscan(5, 0x82, ReadFromDeviceArray, WriteToDeviceArray)

Example 3

To write instruction and data to device 0 and save return (note that write data is not specified and will default to all 0's):

Command Input:

irscan(5, 2)

define ord4 ReadFromDeviceArray[1] ย ย ย ย ย ย ย ย ย // enough to hold 32 bits

drscan(5, 0x20, ReadFromDeviceArray)

ReadFromDeviceArray[0]

Result:

182C1013

Related Topics