Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates 2.0.4 issue 154 #165

Open
wants to merge 6 commits into
base: updates-2.0.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 43 additions & 25 deletions fragmentCodeAndTransport.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,29 @@ line 56. The least significant byte is output first, this means 32 is
byte 0, 04 is byte 1 and and the final value 02 is byte 4.

==== Siemens transport

The packet format is given in
<<fig:packet-format>>. So this means the packet
will be packed as follows:
The packet is encapsulated according to the https://github.com/riscv-non-isa/e-trace-encap/releases/latest/[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes:

* Header - 1 byte
* Index - N bits. As an example use 6 bits and the value of 1.
* Optional Siemens timestamp - 2 bytes. This example has no timestamp
* A type field for the packet of 2 bits ’01’ meaning instruction trace
* Payload - [32 04 00 00 02]
* SrcID - N bits. As an example use 6 bits and the value of 1.
* This example has no timestamp
* A 2-bit type field with ’10’ meaning instruction trace
* trace_payload - [0x32 0x04 0x00 0x00 0x02]

Since the Siemens transport is byte stream based the data seen will be:

`[0x05][0x41][0x32 0x04 0x00 0x00 0x02]`
`[0x06][0x81][0x32 0x04 0x00 0x00 0x02]`

==== ATB transport

Assuming at 32 bit ATB transport results in the following ATB transfers
The packet is encapsulated according to the https://github.com/riscv-non-isa/e-trace-encap/releases/latest/[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes:

ved-rivos marked this conversation as resolved.
Show resolved Hide resolved
* Header - 1 byte carried via ATDATA bus.
* SrcID - 0 bits as the SrcID is carried via the ATID bus.
* This example has no timestamp
* No type field (encoder has no data trace support)
* trace_payload - [0x32 0x04 0x00 0x00 0x02] carried via ATDATA bus.
ved-rivos marked this conversation as resolved.
Show resolved Hide resolved

Assuming a 32 bit ATB transport results in the following ATB transfers

`[ATID=1] [ATBYTES = 3] [ATDATA = 0x00043205]` +
`[ATID=1] [ATBYTES = 1] [ATDATA = 0x00000200]`
ved-rivos marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -207,20 +212,26 @@ byte 0, 00 is byte 1 and and the final value 20 is byte 9.

==== Siemens transport

The packet format is given in
<<fig:packet-format>>. So this means the packet
will be packed as follows:
The packet is encapsulated according to the https://github.com/riscv-non-isa/e-trace-encap/releases/latest/Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes:

* Header - 1 byte
* Index - N bits. As an example use 6 bits and the value of 0xA
* Optional Siemens timestamp - 2 bytes. This example has no timestamp
* A type field for the packet of 2 bits '01' meaning instruction trace
* Payload - [0xBD 0xAA 0xAA 0x68 0x00 0x00 0x20]
* SrcID - N bits. As an example use 6 bits and the value of A.
* This example has no timestamp
* A 2-bit type field with ’10’ meaning instruction trace
* trace_payload - [0xBD 0xAA 0xAA 0x68 0x00 0x00 0x20]

`[0x7][0x29][0xBD 0xAA 0xAA 0x68 0x00 0x00 0x20]`
`[0x8][0x8A][0xBD 0xAA 0xAA 0x68 0x00 0x00 0x20]`

==== ATB transport

The packet is encapsulated according to the https://github.com/riscv-non-isa/e-trace-encap/releases/latest/[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes:

* Header - 1 byte carried via the ATDATA bus.
* SrcID - 0 bits as the SrcID is carried via the ATID bus.
* This example has no timestamp
* No type field (encoder has no data trace support)
ved-rivos marked this conversation as resolved.
Show resolved Hide resolved
* trace_payload - [0xBD 0xAA 0xAA 0x68 0x00 0x00 0x20] carried via the ATDATA bus

Assuming at 32 bit ATB transport results in the following ATB transfers

`[ATID=0xA] [ATBYTES = 3] [ATDATA = 0xAAAABD07]` +
Expand Down Expand Up @@ -295,19 +306,26 @@ byte 0, 00 is byte 1 and and the final value 10 is byte 8.

==== Siemens transport

The packet format is given in <<fig:packet-format>>. So this means the packet
will be packed as follows:
The packet is encapsulated according to the https://github.com/riscv-non-isa/e-trace-encap/releases/latest/[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes:

* Header - 1 byte
* Index - N bits. As an example use 6 bits and the value of 0x5
* Optional timestamp - 2 bytes. This example has no timestamp
* A type field for the packet of 2 bits '01' meaning instruction trace
* Payload - [0x73 0x00 0x00 0x00 0x00 0x91 0x82 0x00 0x10]
* SrcID - N bits. As an example use 6 bits and the value of 5.
* This example has no timestamp
* A 2-bit type field with ’10’ meaning instruction trace
* trace_payload - [0x73 0x00 0x00 0x00 0x00 0x91 0x82 0x00 0x10]

`[0x9][0x15][0x73 0x00 0x00 0x00 0x00 0x91 0x82 0x00 0x10]`
`[0xA][0x85][0x73 0x00 0x00 0x00 0x00 0x91 0x82 0x00 0x10]`

==== ATB transport

The packet is encapsulated according to the https://github.com/riscv-non-isa/e-trace-encap/releases/latest/[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes:

* Header - 1 byte carried via the ATDATA bus.
* SrcID - 0 bits as the SrcID is carried via the ATID bus.
* This example has no timestamp
* No type field (encoder has no data trace support)
* trace_payload - [0x73 0x00 0x00 0x00 0x00 0x91 0x82 0x00 0x10] carried via the ATDATA bus.

Assuming at 32 bit ATB transport results in the following ATB transfers

`[ATID=0x5] [ATBYTES = 3] [ATDATA = 0x00007309]` +
Expand Down
36 changes: 4 additions & 32 deletions payload.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,15 @@
The bulk of this section describes the payload of packets output from
the Instruction Trace Encoder. The infrastructure used to transport
these packets is outside the scope of this document, and as such the
manner in which packets are encapsulated for transport is not specified.
However, the following information must be provided to the encapsulator:
manner in which packets are encapsulated for transport is not mandated, but the https://github.com/riscv-non-isa/e-trace-encap/releases/latest/[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification] is recommended. Chapter 3 of that document specifically addresses the encapsulation requirements for E-Trace.

Any encapsulation must include the following information:

* The packet type;
* The packet length, in bytes;
* The packet payload.

Two example transport schemes are the Siemens Messaging Infrastructure,
and the Arm Trace Bus. <<fig:packet-format>> shows the
encapsulation used for the Siemens infrastructure:

* The header byte contains a 5-bit field specifying the payload length
in bytes, a 2-bit field indicating the "flow" (destination routing
indicator), and a bit to indicate whether an optional 16-bit timestamp
is present;
* The index field indicates the source of the packet. The number of bits
is system dependent, And the initial value emitted by the trace encoder
is zero (it gets adjusted as it propagates through the infrastructure);
* An optional 2-byte timestamp;
* The packet payload.

[[fig:packet-format]]
.Example encapsulated packet format
image::newPacket.jpg[newPacket,width=340,height=37,align="center"]

Alternatively, for ATB, the source of the packet is indicated by the
*ATID* bus field, and there is no equivalent of "flow", so an example
encapsulation might be:

* A 5-bit field specifying the payload length in bytes
* A bit to indicate whether an optional 16-bit timestamp is present;
* An optional 2-byte timestamp;
* The packet payload.

It may be desirable for packets to start aligned to an ATB word, in
which the *ATBYTES* bus field in the last beat of a packet can be used
to indicate the number of valid bytes.
Two example transport schemes are the Siemens Messaging Infrastructure, and the Arm AMBA Trace Bus. The Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification is well suited to either of these.

The remainder of this section describes the contents of the payload
portion which should be independent of the infrastructure. In each
Expand Down
Loading