Fundamentally, an RFNoC block has three main types of interfaces:
Each block has one bidirectional slave (or master and slave) control interface, zero or more data ports and zero or more external IO.
RFNoC is a network-on-chip and has a packetized transport network. Utilities are available to abstract packets into simple interfaces (discussed later), however the understanding of the data flow and packet formats should allow users to build better and more efficient applications. RFNoC provides the following capabilities for the control and data planes:
RFNoC provides seamless integration with USRP Hardware. As an SDR, a USRP has the following external input/output interfaces:
Each USRP will come equipped with NoC Blocks that seamlessly connect to the above IO. Transports will have corresponding transport adapters. It is possible to reassign that IO to other blocks in the design but that is an advanced feature.
Before looking at the FPGA interfaces, it is important to understand how data flows between blocks and stream endpoints. With the provided RFNoC tools, it is possible to choose between a simple interface that abstracts the data movement or a low-level interface that gives the block full control (and responsibility).
The Condensed Hierarchical Datagram for RFNoC (CHDR) is a protocol that defines the fundamental unit of data transfer in an RFNoC network. As shown in the table below, it has a header that encodes packet info, routing info, metadata and the data payload. CHDR is used as a transport protocol between stream endpoints. CHDR can handle control, data, flow control and status messages. The format is dependent on the width of the CHDR bus in the FPGA (CHDR_W). NOTE: CHDR_W can be a power of 2 that is equal to or greater than 64 bits.
| # | Memory Layout <-------------- CHDR_W = 64 bits -------------> | Required? | |||||||
|---|---|---|---|---|---|---|---|---|---|
| 0 | VC (6) | EOB (1) | EOV (1) | PktType (3) | NumMData (5) Value=M | SeqNum (16) | Length (16) Value=L | DstEPID (16) | Y |
| 1 | Timestamp (64) | N | |||||||
| 2 | Metadata[0] (CHDR_W) | N | |||||||
| . | ... | . | |||||||
| M+1 | Metadata[M-1] (CHDR_W) | N | |||||||
| M+2 | Payload[0] (CHDR_W) | Y | |||||||
| . | ... | . | |||||||
| M+N+1 | Payload[N-1] (CHDR_W) | N | |||||||
The individual fields are described in detail in the table below.
| Field | Width | Description | Type |
|---|---|---|---|
| Virtual Channel (VC) | 6 | The virtual channel number for a stream. It is possible to have multiple virtual streams flowing over the same physical stream (EPID-pair). This field identifies the index of the virtual stream. The default value of this field is zero. NOTE: Any virtual streams that are incorrectly addressed will go to port 0. | Required |
| Delimiters (EOV/EOB) | 2 | Delimiter flags for the user logic to use. These bits are unused by the core framework but have the following definitions:
NOTE: Data in RFNoC has three kinds of delimiters: 1) Packets, 2) Vectors and 3) Bursts. A vector is a collection of packets (of items), and a burst is a collection of vectors. | Required |
| PktType | 3 | The type of this CHDR packet. Can be one of the following: 0x0 = Management 0x1 = Stream Status 0x2 = Stream Command 0x3 = [Reserved] 0x4 = Control Transaction 0x5 = [Reserved] 0x6 = Data Packet without a Timestamp 0x7 = Data Packet with a Timestamp | Required |
| NumMData | 5 | The number of metadata words in this packet. Each metadata word is CHDR_W bits wide. If NumMData is zero, then the packet has no metadata. The maximum value for NumMData is 30. NOTE: Metadata is considered to be an advanced feature of RFNoC, and its interpretation is assumed to be block-specific. The framework will provide the ability for the user logic to extract and insert metadata into a packet but the user logic in the block is responsible for defining its format. | Required |
| SeqNum | 16 | Packet sequence number. The value shall start at 0 and increment by 1 for every packet of a given type in a stream. The counter shall roll over to 0 after 65535 (216-1). *NOTE: The sequence number is useful for detecting gaps and reordering issues in a stream. During error- free operation, the sequence number will increase monotonically (by 1) for every packet for each:
for each stream and each packet type. A gap in the sequence number at any point is considered a sequence error.* | Required |
| Length | 16 | Length of the packet in bytes. This includes the header, timestamp, metadata and payload. | Required |
| DstEPID | 16 | The Endpoint ID of the stream endpoint that this packet is destined for. The EPID is used to make routing decisions. (The details of routing are covered in the following sections) NOTE: EPID = 0 is reserved and may not be used. | Required |
| Timestamp | 64 | A 64-bit integer timestamp for the payload in the packet. This field is valid only when the packet type is “Data Packet with a Timestamp” | Optional |
| Metadata | Variable | User-defined metadata. These bits are unused by the core framework and their format is undefined. The definition of the format can be block-specific. | Optional |
| Payload | Variable | User-defined payload NOTE: Every CHDR packet must have at least one line of payload. | Required |
The memory layout for various CHDR widths and configurations is shown below.
| Byte | CHDR_W = 64 |
|---|---|
| 0 | HEADER (64) |
| 8 | METADATA[0] |
| 16 | METADATA[1] |
| 24 | PAYLOAD[0] |
| 32 | PAYLOAD[1] |
| ... | ... |
| ... | PAYLOAD[N-1] |
| Byte | CHDR_W = 64 |
|---|---|
| 0 | HEADER (64) |
| 8 | TIMESTAMP (64) |
| 16 | METADATA[0] |
| 24 | METADATA[1] |
| 32 | PAYLOAD[0] |
| 40 | PAYLOAD[1] |
| ... | ... |
| ... | PAYLOAD[N-1] |
| Byte | CHDR_W = 128 | |
|---|---|---|
| 0 | TIMESTAMP (64) | HEADER (64) |
| 16 | METADATA[0] | |
| 32 | METADATA[1] | |
| 48 | PAYLOAD[0] | |
| 64 | PAYLOAD[1] | |
| ... | ... | |
| ... | PAYLOAD[N-1] | |
| Byte | CHDR_W = 256 or higher | ||
|---|---|---|---|
| 0 | RESERVED | TIMESTAMP (64) | HEADER (64) |
| 32 | METADATA[0] | ||
| 64 | METADATA[1] | ||
| 96 | PAYLOAD[0] | ||
| 128 | PAYLOAD[1] | ||
| ... | ... | ||
| ... | PAYLOAD[N-1] | ||
The amount of metadata in a packet depends on the NumMData field and the width of the CHDR bus. For compatibility between different CHDR widths, it is recommended to limit the amount of metadata to 248 bytes, the maximum amount supported by the smallest CHDR width, CHDR_W = 64.
When the CHDR PktType field is 0x6 or 0x7, the payload is interpreted as a data packet. The data packet is the simplest type of CHDR packet because the format is flexible, and the payload is defined by the blocks generating and consuming it. When the PktType is 0x7, the header contains a valid timestamp. When the PktType is 0x6, the timestamp word is ignored. Note that when the PktType is 0x6 and CHDR_W is 64, there is no timestamp word and the first word of metadata or payload immediately follows the header word.
The stream endpoints separate control traffic from data traffic so that the AXIS-CHDR Data ports on the client side of the stream endpoint only carry data packets (see this Figure). Data packets are designed to have the lowest overhead to enable low-latency and high-throughput streaming of samples.
The exact meaning of the timestamp field in data packets is a block-dependent feature. For example, the radio will add the current timestamp to each outgoing packet but will interpret the timestamp on incoming packets as an instruction to start sending at this time. Other blocks may also have block-specific behavior regarding timestamps. To harmonize the usage of timestamps, the following conventions should be used, where possible, to design blocks and/or software that uses timestamps:
The rationale for not requiring timestamps mid-burst is twofold: First, timestamps mid-burst are redundant, and thus leaving them out might make block designs simpler, and potentially reduce bandwidth usage. The second reason is due to the fixed-point nature of timestamps. Take the example of a radio block producing data at a rate of 200 Msps, which is in the same clock domain as the timekeeper, running at 200 MHz. Following the radio block is a fractional resampler which turns the 200 Msps into a 122.88 Msps stream. Due to the fractional relationship between input and output rates at the resampler, it will not be able to calculate mid-burst timestamps without rounding errors. The timestamp in the first packet, however, does not need to be converted, since the beginning of the packet keeps the same time regardless of the sampling rate. The redundancy of the mid-burst timestamps is thus used to avoid potential pitfalls of fixed-point rounding errors.
When the CHDR PktType field is 0x4, the payload is interpreted as a control packet. The control packet encodes memory-mapped transactions. It has a variable length that can range from 16 bytes (no timestamp and NumData = 1) to 80 bytes (timestamp and NumData = 15).
The table below shows the format of the CHDR payload of a control packet. For simplicity, the rest of the CHDR packet is not shown. Note that a timestamp may be present in both the CHDR packet header and in the control packet contents. This simplifies the parsing of control and data packets.
| # | Memory Layout <-------------- CHDR_W = 64 bits -------------> | Required? | |||||||
|---|---|---|---|---|---|---|---|---|---|
| 0 | Reserved (16) | SrcEPID (16) | IsACK (1) | HasTime (1) | SeqNum (6) | NumData (4) | SrcPort (10) | DstPort (10) | Y |
| 1 | Timestamp (64) | N | |||||||
| 2 | Data[0] (32) | Status (2) | Reserved (2) | OpCode (4) | ByteEnable (4) | Address (20) | Y | ||
| 3 | Data[2] (32) | Data[1] (32) | N | ||||||
| ... | ... | ... | ... | ||||||
| 9 | Data[14] (32) | Data[13] (32) | N | ||||||
A detailed description of the fields is listed in the table below. Each control packet has the source and destination stream endpoint. The packet also has a source and destination port which allows addressing up to 1024 NoC blocks from each endpoint.
| Field | Width | Description | Type |
|---|---|---|---|
| SrcEPID | 16 | The ID of the stream endpoint that this packet is originated from. Note: EPID = 0 is reserved | Required |
| IsACK | 1 | Is this an acknowledgement of a transaction completion? (See following section on ACKs) | Required |
| SeqNum | 6 | Packet sequence number. For each master, the value shall start at 0, increment by 1 and roll over to 0 after 63 (26-1). This control-specific sequence number is independent of the CHDR sequence number. NOTE: The sequence number may not be sequential over the wire in a multi-master case. It will be sequential in the masters’ ingress queue because the slave and the transport modules will not modify it. | Required |
| NumMData | 4 | Number of 32-bit lines in the Data field NOTE: NumData = 0 is reserved. | Required |
| SrcPort | 10 | The port within the source stream endpoint that this transaction originated from. | Required |
| DstPort | 10 | The port within the stream endpoint that this transaction needs to go to | Required |
| Timestamp | 64 | If the transaction is timed, then this field signifies the start time of the transaction. The Timestamp word is not present if HasTime is 0. | Optional |
| Status | 2 | When IsACK is high, this field indicates the transaction completion status: 0x0 = OKAY (Transaction successful) 0x1 = CMDERR (Slave asserted a command error) 0x2 = TSERR (Slave asserted a timestamp error) 0x3 = WARNING (Slave asserted a non-critical error) | Required |
| OpCode | 4 | The operation code of this transaction. See OpCode definitions below. | Required |
| ByteEnable | 4 | A bitmask of the bytes to keep from the Data field. | Required |
| Address | 20 | The byte address for the transaction. | Required |
| Data[i] | Variable | The transaction data. Number of data values depends on the NumData field and their interpretation depends on the OpCode. | Optional |
A control transaction is a memory mapped transaction that contains a 20-bit Address field and a 4-bit byte-enable field (with behavior similar to tkeep/tstrb in AXI4). It may have one to fifteen 32-bit data fields. A transaction can be timed, i.e., only executed when the sample timestamp matches a command timestamp. The OpCode determines the behavior of the transaction. All register transactions must be acknowledged after they are consumed. The packet size of the response will be the same as the packet size of the request. Using this information, the sender is responsible for flow controlling control transactions to ensure that the control packet FIFO is not overrun.
Note that the use of some control transaction features is block-dependent. For example, some NoC blocks may ignore ByteEnable and/or the Timestamp if those blocks do not support those features. This allows NoC blocks to be simpler if such features are not required.
The table below shows the meaning of the OpCode field values.
| OpCode | Operation | Arguments | Description |
|---|---|---|---|
| 0 | Sleep | [0]: Stall cycles | Do nothing and stall the control endpoint for Data[0] clock cycles of the control interface clock. |
| 1 | Write | [0]: Data | Write Data to a single register at Address at all bytes p where by ByteEnable[p] = 1. |
| 2 | Read | [0]: Scratch | Read a single register at Address. |
| 3 | Read then Write | [0]: Data | Read the register at Address then Write Data to it at all bytes p where by ByteEnable[p] = 1. |
| 4 | Block Write | [0]: Data[0] ... [N-1]: Data[N-1] | Write Data[n] to registers sequentially at (Address + 4n) at all bytes p where by ByteEnable[p] = 1 where n = 0 .. N-1. |
| 5 | Block Read | [0]: Scratch[0] ... [N-1]: Scratch[N-1] | Read sequentially from registers at (Address + 4n) where n = 0 .. N-1. |
| 6 | Poll | [0]: Data [1]: Mask [2]: Timeout | Poll on Address until its value for all bits in Mask matches Data&Mask, or until Timeout cycles of control interface clock have elapsed. Acknowledge with CMDERR if timeout occurs, otherwise with OKAY. |
| 7-9 | Reserved | Reserved | Reserved |
| >9 | User Defined | User Defined | 6 opcodes are reserved for user-specific implementation. |
The CHDR Control packet is an example of a hierarchical packet format because the control payload itself forms another packet type, called AXIS-Ctrl, that is routed through the control infrastructure. AXIS-Ctrl is a 32-bit bus which is a serialized version of the payload of a CHDR Control packet. The stream endpoint will serialize CHDR to AXIS-Ctrl, where it is passed to the control crossbar. Each NoC Block will also receive and send control transactions/responses in the AXIS-Ctrl format. The stream endpoint will then de-serialize these transactions back to CHDR.
NOTE: The AXIS-Ctrl data width is always 32 bits, regardless of the value of CHDR_W.
Control packets are typically acknowledged by the consumer, e.g., an RFNoC block receiving a control packet will send out an acknowledgement after the control packet has been moved out of the the RFNoC block's internal control packet queue.
Acknowledgements have the exact same structure as regular control packets, with the following requirements:
IsACK flag must be assertedAddress, OpCode, and SeqNum fields must have the same values as the control packet that is being acknowledged. These fields may be used to validate an acknowledgement packet.NOTE: This is an internal-only packet, i.e., the NoC blocks will never see this type of packet. The RFNoC infrastructure is responsible for generating and consuming this packet type.
When the CHDR PktType field is 0x1, the payload is interpreted as a stream status packet. Data streams in RFNoC are always bidirectional. Stream status packets always flow in the opposite direction of a data packet stream to communicate stream health and flow control information.
The following is a 64-bit serialized representation of the stream status packet. For CHDR widths larger than 64, serialization/de-serialization to 64 bits is done least-significant word first.
| # | Memory Layout <-------------- 64-bits -------------> | Required? | |||
|---|---|---|---|---|---|
| 0 | CapacityBytes (40) | Reserved (4) | Status (4) | SrcEPID (16) | Y |
| 1 | XferCountPkts (40) | CapacityPkts (24) | Y | ||
| 2 | XferCountBytes (64) | Y | |||
| 3 | StatusInfo (48) | BuffInfo (16) | Y | ||
| Field | Width | Description | Type |
|---|---|---|---|
| Capacity bytes | 40 | The buffer capacity of the downstream endpoint in bytes. | Required |
| Status | 4 | The current status of the stream. Possible values: 0x0 = Okay (No Error) 0x1 = Command Error (Command execution failed) 0x2 = Sequence Error (Sequence number discontinuity) 0x3 = Data Error (Data integrity check failed) 0x4 = Routing Error (Unexpected destination) Others = Reserved | Required |
| SrcEPID | 16 | Endpoint ID of the source of this message NOTE: The endpoint ID of the destination is present in the CHDR header. | Required |
| XferCount Pkts | 40 | Number of packets received by the destination stream endpoint. | Required |
| Capacity Pkts | 24 | The buffer capacity of the downstream endpoint in packets. | Required |
| XferCount Bytes | 64 | Number of bytes received by the destination stream endpoint. | Required |
| StatusInfo | 48 | Extended information about the status. NOTE: The format of this field is unspecified. It shall be used for diagnostics only. | Required |
| BuffInfo | 16 | Extended information about the buffer state. NOTE: The format of this field is unspecified. It shall be used for diagnostics only. | Required |
NOTE: This is an internal-only packet, i.e., the NoC blocks will never see this type of packet. The RFNoC infrastructure is responsible for generating and consuming this packet type.
When the CHDR PktType field is 0x2, the payload is interpreted as a stream command. Data streams in RFNoC are always bidirectional. Stream command packets always flow in the direction of a data packet stream to trigger stream state changes.
The following is a 64-bit serialized representation of the stream status packet. For CHDR widths larger than 64, serialization/de-serialization to 64 bits is done least-significant word first.
| # | Memory Layout <-------------- 64-bits -------------> | Required? | |||
|---|---|---|---|---|---|
| 0 | NumPkts (40) | OpData (4) | OpCode (4) | SrcEPID (16) | Y |
| 1 | NumBytes (64) | Y | |||
| Field | Width | Description | Type | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| NumPkts | 40 | The number of packets associated with the operation. The exact interpretation of this field depends on the OpCode. | Required | ||||||||||
| OpData | 4 | The data associated with the operation. The exact interpretation of this field depends on the OpCode. | Required | ||||||||||
| OpCode | 4 | A code that describes what needs to be done.
| Required | ||||||||||
| SrcEPID | 16 | Endpoint ID of the source of this message. NOTE: The endpoint ID of the destination is present in the CHDR header. | Required | ||||||||||
| NumBytes | 64 | The number of bytes associated with the operation. The exact interpretation of this field depends on the OpCode. | Required |
NOTE: This is an internal-only packet, i.e., the NoC blocks will never see this type of packet. The RFNoC infrastructure is responsible for generating and consuming this packet type.
When the CHDR PktType field is 0x0, the payload is interpreted as a management packet. Management packets are sent and received by internal RFNoC framework components for discovery and internal configuration. The following information can be discovered:
A management packet can configure and discover information on the various nodes in the network. Nodes can be transport endpoints, crossbars and stream endpoints. The packet is a multi-hop transaction where operations are encoded in layers that are "peeled off" as they are consumed by the various nodes. A hop may contain several operations to execute (with a minimum of one). Each operation has an 8-bit opcode and a 48-bit payload. The interpretation of the payload is operation specific. The various opcodes defined below can allow the following:
Configuration is done via a basic memory mapped writes with a 16-bit address and 32-bit data. In the case of a route setup, the management packet can be configured to terminate at the stream endpoint. For other situations, it can be configured to return to the host.
The following is a 64-bit serialized representation of a management packet. For CHDR widths larger than 64, only the lower 64 bits of each management packet word are used and the upper bits will be ignored. Management packets are NOT serialized.
| # | Memory Layout <-------------- 64-bits -------------> | Required? | ||||
|---|---|---|---|---|---|---|
| 0 | ProtoVer (16) | CHDRWidth (3) | Reserved (19) | NumHops (10) | SrcEPID (16) | Y |
| 1 | OpPayload (48) | OpCode (8) | OpsPending (8) | Y | ||
| ... | ... | ... | ... | N | ||
| N-1 | OpPayload (48) | OpCode (8) | OpsPending (8) | N | ||
| Field | Width | Description | Type | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ProtoVer | 16 | RFNoC protocol version The top 8 bits represent the major version, and the bottom 8 bits represent the minor version. | Required | ||||||||||||||||||||
| CHDRWidth | 3 | RFNoC CHDR bus width (CHDR_W) 0x0 = 64 bits 0x1 = 128 bits 0x2 = 256 bits 0x3 = 512 bits Others = Reserved | Required | ||||||||||||||||||||
| NumHops | 10 | Number of hops that this management packet will take before it is consumed completely. | Required | ||||||||||||||||||||
| SrcEPID | 16 | Endpoint ID of the source of this message. | Required | ||||||||||||||||||||
| OpsPending | 8 | Number of operations left to be executed for the current node/hop. Each node (hop) must have at least one operation associated with it. | Required | ||||||||||||||||||||
| OpCode | 8 | Operation code (what to do) 0x0 = No-op 0x1 = Advertise 0x2 = Select Destination 0x3 = Return To Sender 0x4 = Node Info Request 0x5 = Node Info Response 0x6 = Config Write 0x7 = Config Read Request 0x8 = Config Read Response Others = Reserved | Required | ||||||||||||||||||||
| OpPayload | 48 | The payload associated with the specified operation (instruction). The format of the payload is operation specific.
| Required |
| 1 (Crossbar) | NPorts = ExtendedInfo[7:0] NPortsMgmt = ExtendedInfo[15:8] ExtRtCfgPort = ExtendedInfo[16] |
| 2 (Stream Endpoint) | AxisCtrlEn = ExtendedInfo[0] AxisDataEn = ExtendedInfo[1] NumDataI = ExtendedInfo[7:2] NumDataO = ExtendedInfo[13:8] ReportStreamErrs = ExtendedInfo[14] |
| 3 (Transport Adapter) | NodeSubtype = ExtendedInfo[7:0] |
The figure shows the anatomy of a NoC Block in the FPGA. It consists of two main components: 1) the user logic and 2) the NoC Shell. The NoC Shell is the user logic's interface to the rest of the RFNoC framework. A NoC Shell is custom generated for each block based on user-specified interface options. It is also possible to generate IO interfaces to outside logic from a NoC Block, but that feature is advanced. RFNoC provides a utility (see RFNoC ModTool below) to generate a unique instantiation of a NoC Shell that is custom for each block. Depending on the level of abstraction desired, for most interfaces, there is an option for a simple but potentially less featured interface and a low-level but full-featured interface.
Each block can choose the CHDR width that it wishes to support. A block will generally have a fixed CHDR width and a block can only be used in designs that use the same CHDR width. In an FPGA design, the CHDR widths of all blocks and the device must be the same.
The following two clocks are always available for the user logic to use:
rfnoc_chdr_clk rfnoc_chdr port (described in Section Backend RFNoC Interface).rfnoc_ctrl_clk rfnoc_ctrl port (Section Backend RFNoC Interface).These are always-on clocks that will be used by the framework for data movement. Their frequencies are USRP device dependent.
Two resets are exposed through the user interface, named rfnoc_chdr_rst and rfnoc_ctrl_rst. These resets are both synchronous to their respective clocks and are driven by the backend interface toward user logic. Both resets will assert for at least 32 of their respective clock cycles to ensure a sufficiently long reset for connected user IP. These resets should be used to reset user IP so that the entire block is reset when a reset is requested by the backend interface. A synchronizer may be used to import these resets to other clock domains, if needed.
If a block needs additional clocks, it is possible to add additional clock ports to a block. User clocks for a block must be driven by device clocks when a design is assembled. Frequency ranges can be specified on clocks to ensure that block requirements are met. RFNoC assumes asynchronous data processing so, it is not possible specify the phase or synchronization of optional clocks. If there is a need for low level synchronization with hardware or other blocks, then the advanced IO Ports must be used. These are described in Section Generic IO Ports.
RFNoC ModTool has the following options to generate the basic interface for a NoC block.
chdr_width)The control-plane in the FPGA can be exposed using a low-level AXI4-Stream interface called AXI-Stream CTRL or using a simpler abstracted interface called Control Port.
AXI-Stream Control (AXIS-Ctrl) defines an interface and a packet format to encode control transactions in a standard 32-bit wide AXI-Stream bus. Regardless of the CHDR widths, AXIS-Ctrl will always be 32-bit wide. The data transferred over this interface is identical to the payload of a CHDR control packet except for the top 32 bits of the first payload line. All other fields are identical. Table Memory layout of an AXIS-Ctrl packet shows the various fields of an AXIS-Ctrl packets formatted with a 32-bit word width. Note that the payload is identical to that of the CHDR payload of a control packet, except for the second line in the packet. The fields are described in CHDR control field definitions and Table Additional AXIS-Ctrl field definitions.
AXIS-Ctrl packets traverse over the control network which consists of the control crossbar. This network is different for the typical CHDR network in RFNoC. It allows transactions to originate from and terminate in any NoC block in the device, despite the static data connections. The host software can issue an AXIS-Ctrl transaction going to any FPGA block and any FPGA block can send a transaction to any other FPGA block or to software. It is also possible to communicate with blocks in different devices. These are defined as remote transactions and require the use of two additional fields, RemDstEPID and RemDstPort.
| # | Memory Layout <-------------- 32-bits -------------> | Required? | |||||
|---|---|---|---|---|---|---|---|
| 0 | IsACK (1) | HasTime (1) | SeqNum (6) | NumData (4) | SrcPort (10) | DstPort (10) | Y |
| 1 | Reserved (6) | RemDstPort (10) | RemDstEPID (16) | Y | |||
| 2 | Timestamp[31:0] (32) | N | |||||
| 3 | Timestamp[63:32] (32) | N | |||||
| 4 | Status (2) | Reserved (2) | OpCode (4) | ByteEnable (4) | Address (20) | Y | |
| 5 | Data[0] (32) | Y | |||||
| ... | ... | N | |||||
| 19 | Data[14] (32) | N | |||||
| Field | Width | Description | Type |
|---|---|---|---|
| REmDstEPID | 16 | Remote Destination Endpoint ID: The ID of the remote stream endpoint that this packet is destined towards. Note: EPID = 0 implies that the transaction is local | Required |
| RemDstPort | 10 | The port index of the crossbar downstream of the remote stream endpoint that this packet is destined towards. | Required |
For the NoC block interface, AXIS-Ctrl is a simple 32-bit AXI-Stream interface. Users can request this interface in a clock domain of their choice and are responsible for implementing the framer/de-framer for control packets. When the AXIS-Ctrl port is instantiated, the NoC Shell will expose the following signals for the user-logic to use:
axis_ctrl_clk axis_ctrl_rst m_axis_ctrl_<signal> s_axis_ctrl_<signal> The control port provides a simpler interface to generate and consume control transactions. This interface supports blocking reads/writes, timed commands, backpressure and (N)ACKs, and allows the users to not worry about parsing the AXIS-Ctrl packet. The NoC Shell will internally de-frame AXIS-Ctrl packets, post a transaction on the slave bus and then frame the response back to AXIS-Ctrl. The simplicity of the interface does yield the following limitations:
When the control port is instantiated, NoC Shell will expose the following ports for the user-logic to use:
ctrlport_clk ctrlport_rst m_ctrlport_<signal> s_ctrlport_<signal> | Signal | Direction (Master) | Width | Purpose | Usage |
|---|---|---|---|---|
| req_wr | out | 1 | A single-cycle strobe that indicates the start of a write transaction. | Required |
| req_rd | out | 1 | A single-cycle strobe that indicates the start of a read transaction. | Required |
| req_addr | out | 20 | Address for transaction. This field is valid only when req_rd or req_wr is high. | Required |
| req_portid | out | 10 | Port ID within the device to send the transaction to. This is the local port number. This field is valid only when req_rd or req_wr is high. | Required (Master Only) |
| req_rem_epid | out | 16 | Endpoint ID of the stream endpoint to send the transaction to. This field is valid only when req_rd or req_wr is high. | Required (Remote Master Only) |
| req_rem_portid | out | 10 | Port ID within the stream endpoint to send the transaction to. This field is valid only when req_rd or req_wr is high. | Required (Remote Master Only) |
| req_data | out | 32 | Data for write transaction. This field is valid only when req_wr is high. | Required |
| req_byte_en | out | 4 | A bitmask indicating which of the 4 bytes to use for transaction. If bit ‘i’ is high in keep then byte ‘i’ will be used from req_data. (If not present, use all 32 bits) This field is valid only when req_rd or req_wr is high. | Optional |
| req_has_time | out | 1 | Does the transaction need to happen at a given time? (If not present, perform transaction ASAP) This field is valid only when req_rd or req_wr is high. | Optional |
| req_time | out | 64 | Timestamp to execute the transaction at. (If not present, perform transaction ASAP) This field is valid only when req_rd or req_wr is high. | Optional |
| resp_ack | in | 1 | A strobe that indicates transaction completion. | Required |
| resp_status | in | 2 | The status associated with the transaction ack. The interpretation of these bits is defined in CHDR control field definitions. (If not present, the value is 0 i.e. OKAY) This field is valid only when resp_ack is high. | Optional |
| resp_data | in | 32 | Response data for a read transaction. This field is valid only when resp_ack is high. | Required |
READ and WRITE Transaction
A write transaction is defined as the assertion of reg_wr for 1 clock cycle and a read transaction is defined as a similar assertion of reg_rd. The value of reg_addr and reg_data (and other optional signals) can be used as arguments for the write. An untimed write will start executing in the same cycle as the assertion of reg_wr. The example in the first figure below shows two writes (A0, A1) that execute in 0 clock cycles and one write that takes multiple cycles to execute. The second figure below shows two 0 cycle reads and one multi-cycle read.
Control-Port Transaction Rules
Transaction Status
It is possible for a control slave to acknowledge a transaction with an optional status. The status bits must have the appropriate value when resp_ack is high. This Figure shows two transaction where the first one was successful and the second one failed.
Timed Transactions
A transaction (read or write) can also be timed i.e. the execution of the transaction will begin at the specified time. The optional signals req_has_time will be asserted to indicate that a transaction is timed. The contents of req_time will be used as the timestamp at which transaction execution should start. It is permissible for the transaction to take multiple clock cycles to finish executing, after which the resp_ack must be asserted. This Figure shows three timed transactions: The first one executes immediately (because time = req_time) and executes in 1 clock cycle. The second one must wait for the time to tick up to 2000 at which point it executes (in 1 clock cycle) and asserts an ack. The third one is late and responds with a Timestamp error (TSERR).
RFNoC ModTool has the following options to generate the control interface for the NoC Shell of a NoC block.
fpga_iface)axis_ctrl) or "Control Port" (ctrlport)interface_direction)slave), "Master and Slave" (master_slave), or "Remote-Master and Slave" (remote_master_slave)fifo_depth)clk_domain)byte_mode)True) or "Off" (False) (Off implies 32-bit mode)timed)True) or "Off" (False) (Off implies immediate or non-timed commands)has_status)True) or "Off" (False) (Off implies transactions that are always successful)The data plane in the FPGA can be exposed using a low-level AXI4-Stream interface called AXI-Stream CHDR (AXIS-CHDR) or using the simpler abstracted interfaces AXI-Stream Payload Context and AXI-Stream Data. This plane of communication is intended for high-throughput data transfer between blocks. The CHDR header information is retained in the data plane so blocks can attach additional information like metadata and timestamps to packets. The CHDR header information (CHDR field descriptions) must be accurate for all packets entering and leaving a block except for the destination endpoint ID (DstEPID). The destination endpoint is used for routing between stream endpoints and is not relevant between adjacent blocks; the value of this field is reserved and will be overwritten by the framework.
The width of the bus presented to the user is configurable. It is therefore possible to receive multiple data items per clock cycle on the data bus. The first item shall be placed in the least-significant position of the data bus. For complex data types, the real or in-phase (I) component shall be placed in the most-significant position within the data item and the imaginary or quadrature (Q) component shall be placed in the least significant position within the data item. The figures below illustrate the item and complex component ordering within the bus.
Note: Third-party IP may use a different IQ order and/or format than that used by RFNoC. For example, many Xilinx IP blocks put the real (I) component in the least-significant position and imaginary (Q) component in the most-significant position, and the format may not be SC16 by default.
| 31 16 | 15 0 |
| Item 0 | |
| Real (I) | Imaginary (Q) |
| 63 48 | 47 32 | 31 16 | 16 0 |
| Item 1 | Item 2 | ||
| Real (I) | Imaginary (Q) | Real (I) | Imaginary (Q) |
The AXI-Stream CHDR (AXIS-CHDR) interface provides direct access to the data ports. The client can request this interface for maximum control over the stream, but the client is responsible for implementing the framer/de-framer for CHDR packets.
A block may have between 0 and 64 input/output data ports. For a block with P input ports, the NoC Shell will contain P separate slave CHDR streams. For a block with Q output ports, the NoC Shell will contain Q separate master CHDR streams. All the streams share the same clock and reset.
When the AXI-Stream CHDR interface is used, the NoC Shell will expose the ports listed below for the user-logic to connect to. In this list, <name> refers to the name provided by the user for this port and <signal> refers to one of the standard AXI4-Stream signals: tdata (CHDR width), tvalid, tready and tlast. Additionally, these signals may be a concatenation of multiple data streams if a parameter is used to define the number of ports. For example, the signal s_myports_chdr_tvalid[1] would refer to tvalid of the slave stream for port 1 of "myports".
axis_chdr_clk axis_chdr_rsts_<name>_chdr_<signal>m_<name>_chdr_<signal>The payload context interface provides a simpler interface to connect processing IP. The payload context interface abstracts away the CHDR stream into two separate AXI-Stream interfaces: Payload and context. The payload stream contains the payload data of a CHDR packet and can often be directly connected to processing blocks that support AXI-Stream. The payload stream is comprised of items (the smallest processing unit; e.g., a data sample) and can deliver one or more items per cycle. The context stream contains additional information about the payload stream such as the header, timestamp and metadata. Splitting the payload and context streams allows separate (but coupled) state machines for data and header processing. The following abbreviations are used below:
A block may have 0 to 64 input/output data ports. For a block with P input ports, the NoC shell will contain P separate master CHDR streams. For a block with Q output ports, the NoC shell will contain Q separate slave CHDR streams. All the streams share the same clock and reset.
When the AXI-Stream Payload Context interface is used, the NoC Shell will expose the ports listed below for the user-logic to connect to. In this list, <name> refers to the name provided by the user for this port and <signal> refers to one of the standard AXI4-Stream signals: tdata (CHDR width), tvalid, tready and tlast. Additionally, these signals may be a concatenation of multiple data streams if a parameter is used to define the number of ports. For example, the signal s_myports_payload_tvalid[1] would refer to tvalid of the slave payload stream for port 1 of "myports".
axis_data_clkaxis_data_rsts_<name>_payload_<signal>, s_<name>_context_<signal>m_<name>_payload_<signal>, m_<name>_context_<signal><signal>.| Signal | Direction (Master) | Width | Purpose | Usage | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| payload_tdata | out | NIPC * ITEM_W | The primary data payload word for this transfer. | Required | ||||||||||||
| payload_tkeep | out | NIPC | An item qualifier that indicates whether the content of the associated item in tdata is processed in the stream. NOTE: The granularity of this field is item and not byte. This behavior is different from the standard AXI4- Stream tkeep. NOTE: This may only used to indicate trailing items at the end of a packet. | Required for NIPC > 1 | ||||||||||||
| payload_tlast | out | 1 | Indicates the last word (transfer) in the current payload packet. | Required | ||||||||||||
| payload_tvalid | out | 1 | Indicates that the master is driving a valid packet payload word (transfer). | Required | ||||||||||||
| payload_tready | in | 1 | Indicates that the slave can accept a payload word (transfer) in the current cycle. | Required | ||||||||||||
| context_tdata | out | CHDR_W | The primary context word for this transfer. | Required | ||||||||||||
| context_tuser | out | 4 | Indicates the type of context word.
| Required | ||||||||||||
| context_tlast | out | 1 | Indicates the last word (transfer) in the current context packet. | Required | ||||||||||||
| context_tvalid | out | 1 | Indicates that the master is driving a valid context word (transfer). | Required | ||||||||||||
| context_tready | in | 1 | Indicates that the slave can accept a context word (transfer) in the current cycle. | Required |
NOTE: The data in a context packet represents CHDR header information and thus must be in the same order as the CHDR field. The following sequences on context_tuser are valid, and all others will be regarded as a protocol violation for the context port.
| HDR |
| HDR | TS |
| HDR_TS |
| HDR | TS | MDATA | ... | MDATA |
| HDR_TS | MDATA | ... | MDATA |
| HDR | MDATA | ... | MDATA |
The AXI-Stream Data interface provides another simple user interface. It uses an AXI-Stream data interface but does not require the user to packetize header information. It also supports timestamps, EOB, and EOV. The following abbreviations are used below:
A block may have 0 to 64 input/output data ports. For a block with P input ports, the NoC shell will contain P separate master CHDR streams. For a block with Q output ports, the NoC shell will contain Q separate slave CHDR streams. All the streams share the same clock and reset.
When the AXI-Stream Data interface is used, the NoC Shell will expose the ports listed below for the user-logic to connect to. In this list, <name> refers to the name provided by the user for this port and signal refers to one of the standard AXI4-Stream signals: tdata (CHDR width), tvalid, tready and tlast. Additionally, these signals may be a concatenation of multiple data streams if a parameter is used to define the number of ports. For example, the signal s_myports_axis_tvalid[1] would refer to tvalid of the slave stream for port 1 of "myports".
axis_data_clk axis_data_rsts_<name>_axis_<signal><signal>.m_<name>_axis_<signal><signal>.The signals tlength, ttimestamp, thas_time, teov, and teob are sideband signals and behave like tuser in traditional AXI4-Stream. Rather than having a single tuser signal, these signals have been separated into individual signals for ease of use. On the NoC Shell's master data interface, these signals are valid for the duration of the packet (i.e., whenever tvalid is true).
When the sideband signals are read by the NoC Shell's slave data interface depends on the SIDEBAND_AT_END parameter. If SIDEBAND_AT_END is True then these signals must be valid on the last transfer of each packet (i.e., when tlast is asserted) and tlength is calculated automatically by the NoC Shell. If SIDEBAND_AT_END is False, then these signals must be valid on the first transfer of each packet and tlength must be provided as an input to indicate the length of the data packet being input to the NoC Shell.
The SIDEBAND_AT_END = True setting is required in situations where one or more items associated with the CHDR header (e.g., length, timestamp, EOB, EOV) are not known until the end of the packet is ready to be output. An important side-effect of this setting is that all output packets sent to the NoC Shell's slave interface will be completely buffered before they are sent out. This adds latency to the packets and requires that the NoC Shell implement an MTU-sized buffer to store outgoing packets.
| Signal | Direction (Master) | Width | Purpose | Usage |
|---|---|---|---|---|
| t_data | out | NIPC * ITEM_W | The data payload word for this transfer. | Required |
| tkeep | out | NIPC | An item qualifier that indicates whether the content of the associated item in tdata is processed in the stream. NOTE: The granularity of this field is item and not byte. This behavior is different from the standard AXI4- Stream tkeep. NOTE: This may only used to indicate trailing items at the end of a packet. | Required for NIPC > 1 |
| tlast | out | 1 | Indicates the last word (transfer) in the current payload packet. | Required |
| tvalid | out | 1 | Indicates that the master is driving a valid packet payload word (transfer). | Required |
| tready | in | 1 | Indicates that the slave can accept a payload word (transfer) in the current cycle. | Required |
| ttimestamp | out | 64 | The timestamp for the first item in the packet. | Optional |
| thas_time | out | 1 | Indicates if the ttimstamp field is being used. This will be 0 if there is not timestamp for the current packet. | Optional |
| tlength | out | 16 | The byte length of the data packet (i.e., the byte length of the CHDR payload, which excludes the header and metadata). NOTE: This port is read by the slave interface when SIDEBAND_AT_END is True and is ignored by the slave interface when SIDEBAND_AT_END is False. | Optional |
| teov | out | 1 | Indicates if the EOV bit was set in the packet. | Optional |
| teob | out | 1 | Indicates if the EOB bit was set in the packet. | Optional |
RFNoC Modtool has the following options to generate the data interface for the NoC Shell of a NoC block.
fpga_iface)axis_chdr), "AXI-Stream Payload Context" (axis_pyld_ctxt), or "AXI-Stream Data" (axis_data)clk_domain)item_width)nipc)payload_fifo_depth)context_fifo_depth)info_fifo_depth)IO Ports are interfaces to the user-logic that don't interact with the RFNoC framework. IO Ports may interact with other blocks in an assembled design (for backdoor inter-block communication) or with IO on the USRP device.
The user logic can get access to a hardware time-base and timestamp. The capabilities of a hardware time-base are device specific. The timestamp can be used with real-time blocks like the radio which interfaces with ADCs/DACs.
tb_clk: The time-base clock.tb_rst: A synchronous reset in tb_clk domain. tb_rst = 1 indicates that the time-base is disabled.tb_timestamp: A 64-bit global timestamp that is synchronous to tb_clk. The timestamp is a counter that may start at an arbitrary value and count up by one every clock cycle of tb_clk after tb_rst is released.tb_period_ns_q32: A 64-bit fixed point number in the Q32 format that represents the period of the time-base in nanoseconds.
It is possible to add more generic IO to a NoC block. A generic IO port is a collection of signals, their types, widths and directions. This collection is called an IO Signature. An IO Signature can be inherited from a specific USRP device or be user-defined. Each IO Signature contains the following information:
If a block defines a generic IO Port, then the IO port must be assigned to another IO Port with the same signature during design image assembly. The other IO Port may be a part of the USRP device or an IO Port on another block. The following connection rules apply:
Because NoC Shell is a part of the user NoC block, there will be certain interfaces exposed as inputs/outputs from the block that the user logic can ignore. These interfaces are termed as "backend" and are used by NoC Shell to communicate with the rest of the framework.
rfnoc_chdr_clk rfnoc_chdr_rsts_rfnoc_chdr_<signal>m_rfnoc_chdr_<signal>rfnoc_ctrl_clk rfnoc_ctrl_rst s_rfnoc_ctrl_<signal> m_rfnoc_ctrl_<signal> rfnoc_core_configrfnoc_core_status The RFNoC FPGA image is a standalone design for a USRP that has a collection of block instantiations and a partial topology preconfigured in the FPGA (static connections). This design can be configured using software to create a full flow-graph or be a part of a multi-USRP flow-graph.
After all blocks are developed, the RFNoC framework has built-in tools to generate an FPGA image with user-specified block instantiations and a central router core with user-specified block connections. The following user information will be used to define a topology of the blocks and build an FPGA bitfile.
The following information is inferred based on the user-specified preferences, device info (part of the board support package) and meta-data from each block:
The code generator will determine the following parameters using that info:
Using this info, the code generator will do the following
The RFNoC software will ensure that all the blocks in the FPGA image are initialized before use. RFNoC defines the following as three phases of initialization:
RFNoC is a network that may consist of multiple FPGA designs so "All Blocks" above refers to all blocks in the collection of USRPs controlled by the RFNoC software. Both, the RFNoC framework and the individual blocks share the responsibility for initialization. The control and data path resets (Sections Control Plane and Data Plane) will be asserted for each block to begin the reset operations and the framework imposes a time limit to allow the block to finish its reset procedure. Before the resets are asserted, the framework will also flush data at the input and output of each block. Flushing is an internal framework operation (not visible to the NoC blocks or the user) that ensures that no data is generated downstream of the flush point and all data is consumed at the flush point. The figure below shows the full initialization sequence for an image with multiple blocks (Block 0 ... Block N) and multiple stream endpoints (SEP 0 ... SEP N).