From 863016118faf4bea108a49d986776a5b6ec6158e Mon Sep 17 00:00:00 2001 From: Iain Robertson Date: Mon, 21 Oct 2024 01:51:42 +0100 Subject: [PATCH 1/4] Update encapsulation examples to reference E-Trace Encap spec --- fragmentCodeAndTransport.adoc | 68 ++++++++++++++++++++++------------- payload.adoc | 36 +++---------------- 2 files changed, 47 insertions(+), 57 deletions(-) diff --git a/fragmentCodeAndTransport.adoc b/fragmentCodeAndTransport.adoc index c15df2e..7568225 100644 --- a/fragmentCodeAndTransport.adoc +++ b/fragmentCodeAndTransport.adoc @@ -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 -<>. So this means the packet -will be packed as follows: +The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[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 - [32 04 00 00 02] 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://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: + +* Header - 1 byte +* SrcID - 0 bits as the SrcID is carried via the ATID field. +* This example has no timestamp +* No type field (encoder has no data trace support) +* trace_payload - [32 04 00 00 02] + +Assuming a 32 bit ATB transport results in the following ATB transfers `[ATID=1] [ATBYTES = 3] [ATDATA = 0x00043205]` + `[ATID=1] [ATBYTES = 1] [ATDATA = 0x00000200]` @@ -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 -<>. So this means the packet -will be packed as follows: +The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[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://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: + +* Header - 1 byte +* SrcID - 0 bits as the SrcID is carried via the ATID field. +* This example has no timestamp +* No type field (encoder has no data trace support) +* trace_payload - [0xBD 0xAA 0xAA 0x68 0x00 0x00 0x20] + Assuming at 32 bit ATB transport results in the following ATB transfers `[ATID=0xA] [ATBYTES = 3] [ATDATA = 0xAAAABD07]` + @@ -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 <>. So this means the packet -will be packed as follows: +The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[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://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: + +* Header - 1 byte +* SrcID - 0 bits as the SrcID is carried via the ATID field. +* 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] + Assuming at 32 bit ATB transport results in the following ATB transfers `[ATID=0x5] [ATBYTES = 3] [ATDATA = 0x00007309]` + diff --git a/payload.adoc b/payload.adoc index dab4a5e..35be9a7 100644 --- a/payload.adoc +++ b/payload.adoc @@ -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://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[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. <> 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 From c668bc9c2f03d9268267ad541b6e9c8b894c10c4 Mon Sep 17 00:00:00 2001 From: Iain Robertson Date: Wed, 30 Oct 2024 16:04:45 +0000 Subject: [PATCH 2/4] Updated links to Encap spec to remove googledoc references --- fragmentCodeAndTransport.adoc | 12 ++++++------ payload.adoc | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fragmentCodeAndTransport.adoc b/fragmentCodeAndTransport.adoc index 7568225..a3bb587 100644 --- a/fragmentCodeAndTransport.adoc +++ b/fragmentCodeAndTransport.adoc @@ -98,7 +98,7 @@ 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 is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: +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 * SrcID - N bits. As an example use 6 bits and the value of 1. @@ -112,7 +112,7 @@ Since the Siemens transport is byte stream based the data seen will be: ==== ATB transport -The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: +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 * SrcID - 0 bits as the SrcID is carried via the ATID field. @@ -212,7 +212,7 @@ byte 0, 00 is byte 1 and and the final value 20 is byte 9. ==== Siemens transport -The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: +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 * SrcID - N bits. As an example use 6 bits and the value of A. @@ -224,7 +224,7 @@ The packet is encapsulated according to the https://drive.google.com/file/d/1R-_ ==== ATB transport -The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: +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 * SrcID - 0 bits as the SrcID is carried via the ATID field. @@ -306,7 +306,7 @@ byte 0, 00 is byte 1 and and the final value 10 is byte 8. ==== Siemens transport -The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: +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 * SrcID - N bits. As an example use 6 bits and the value of 5. @@ -318,7 +318,7 @@ The packet is encapsulated according to the https://drive.google.com/file/d/1R-_ ==== ATB transport -The packet is encapsulated according to the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[Unformatted Trace & Diagnostic Data Packet Encapsulation for RISC-V Specification], with the following attributes: +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 * SrcID - 0 bits as the SrcID is carried via the ATID field. diff --git a/payload.adoc b/payload.adoc index 35be9a7..678e608 100644 --- a/payload.adoc +++ b/payload.adoc @@ -4,7 +4,7 @@ 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 mandated, but the https://drive.google.com/file/d/1R-_koXIpdb9_qW6jpz74TSnNXOfJGhfn/view?usp=drive_link[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. +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: From b0b13abe22f21563537eca4cd09de31d95b91933 Mon Sep 17 00:00:00 2001 From: Iain Robertson Date: Tue, 12 Nov 2024 17:12:54 +0000 Subject: [PATCH 3/4] Fixed a few clarifications requested by Ved --- fragmentCodeAndTransport.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fragmentCodeAndTransport.adoc b/fragmentCodeAndTransport.adoc index a3bb587..285f156 100644 --- a/fragmentCodeAndTransport.adoc +++ b/fragmentCodeAndTransport.adoc @@ -115,10 +115,10 @@ Since the Siemens transport is byte stream based the data seen will be: 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 -* SrcID - 0 bits as the SrcID is carried via the ATID field. +* 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 - [32 04 00 00 02] +* trace_payload - [0x32 0x04 0x00 0x00 0x02] carried via ATDATA bus. Assuming a 32 bit ATB transport results in the following ATB transfers @@ -227,10 +227,10 @@ The packet is encapsulated according to the https://github.com/riscv-non-isa/e-t 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 -* SrcID - 0 bits as the SrcID is carried via the ATID field. +* 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 - [0xBD 0xAA 0xAA 0x68 0x00 0x00 0x20] +* 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 @@ -321,10 +321,10 @@ The packet is encapsulated according to the https://github.com/riscv-non-isa/e-t 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 -* SrcID - 0 bits as the SrcID is carried via the ATID field. +* 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] +* 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 From f409a4251834be6f715ee4a7ca61b8566a993f43 Mon Sep 17 00:00:00 2001 From: Iain Robertson Date: Mon, 23 Dec 2024 14:43:03 +0000 Subject: [PATCH 4/4] Made explicit that Header is carried via ATDATA --- fragmentCodeAndTransport.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fragmentCodeAndTransport.adoc b/fragmentCodeAndTransport.adoc index 285f156..4c41814 100644 --- a/fragmentCodeAndTransport.adoc +++ b/fragmentCodeAndTransport.adoc @@ -104,7 +104,7 @@ The packet is encapsulated according to the https://github.com/riscv-non-isa/e-t * 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 - [32 04 00 00 02] +* trace_payload - [0x32 0x04 0x00 0x00 0x02] Since the Siemens transport is byte stream based the data seen will be: @@ -114,7 +114,7 @@ Since the Siemens transport is byte stream based the data seen will be: 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 +* 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) @@ -226,7 +226,7 @@ The packet is encapsulated according to the https://github.com/riscv-non-isa/e-t 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 +* 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) @@ -320,7 +320,7 @@ The packet is encapsulated according to the https://github.com/riscv-non-isa/e-t 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 +* 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)