25.02.2015 Views

SuperH (SH) 64-bit RISC Series SH-5 System Architecture, Volume ...

SuperH (SH) 64-bit RISC Series SH-5 System Architecture, Volume ...

SuperH (SH) 64-bit RISC Series SH-5 System Architecture, Volume ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PRELIMINARY DATA<br />

120 Debug protocols and interfaces<br />

Each WP channel’s action register allows the type of trace message generated to be<br />

defined. See Section 1.5: Debug event actions on page 48.<br />

Encoding of address offsets<br />

To minimize the sizes of trace messages being sent over the <strong>SH</strong>debug link, program<br />

counter addresses, and bus analyzer addresses are compressed wherever possible.<br />

However, when the trace destination is configured as “DM FIFO trace hold”,<br />

“circular DM FIFO”, “circular trace buffer” or “trace buffer hold” mode, addresses<br />

are always encoded as absolute values. This allows trace to be reconstructed even if<br />

some trace packets are lost, as each message can be interpreted without reference to<br />

other messages.<br />

An encoding method is used whereby either one or two bytes are used to represent<br />

signed address offsets as either a 7-<strong>bit</strong> or a 15-<strong>bit</strong> 2’s complement value. These<br />

offsets are relative to the previous address of the same type. If the address cannot be<br />

expressed as an offset, an absolute 32-<strong>bit</strong> value is encoded instead. Therefore:<br />

• Program counter addresses are stored as effective addresses, and are encoded<br />

either as an 32-<strong>bit</strong> absolute address, or as a 7-<strong>bit</strong> or 15-<strong>bit</strong> 2’s complement value<br />

relative to the previous PC address.<br />

• Bus analyzer addresses are encoded either as absolute 32-<strong>bit</strong> addresses, or as a<br />

7-<strong>bit</strong> or 15-<strong>bit</strong> 2’s complement value relative to the previous bus analyzer<br />

address.<br />

Address offsets are calculated as [NEW_ADDRESS - PREVIOUSLY_SENT_ADDRESS]. As<br />

shown in Figure 5, <strong>bit</strong>-7 of the first byte is used to indicate whether a second byte<br />

follows.<br />

Absolute or relative encoding of an address is indicated by one of the following<br />

header fields:<br />

• PC_ABSOLUTE<br />

• SRC_ABSOLUTE (in branch trace messages only)<br />

D R A FT<br />

• DEST_ABSOLUTE (in branch trace messages only)<br />

• ADDR_ABSOLUTE (in bus analyzer trace messages only)<br />

When debug software is analyzing trace message information, it uses an absolute<br />

address as the reference for reconstructing the addresses in subsequent trace<br />

messages. The reference message (Section 1.8.6: Timestamping and reference<br />

messages on page 93 and Table 47 on page 133) also contains the absolute PC and<br />

<strong>SuperH</strong>, Inc.<br />

<strong>SH</strong>-5 <strong>System</strong> <strong>Architecture</strong>, <strong>Volume</strong> 3: Debug 05-SA-10003 v1.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!