|
| 1 | +.. _streaming_debug: |
| 2 | + |
| 3 | +Streaming Debug |
| 4 | +=============== |
| 5 | + |
| 6 | +This component is useful for debugging streaming buses (typically :ref:`MFB <mfb_bus>` and :ref:`MVB <mvb_bus>` in the NDK). |
| 7 | +It can count the number of processed words and packets and indicate a bottleneck where the throughput is being decreased. |
| 8 | + |
| 9 | +The whole Streaming Debug system consists of two parts: STREAMING_DEBUG_MASTER and STREAMING_DEBUG_PROBE. |
| 10 | +Furthermore, the Probe has three versions: |
| 11 | + |
| 12 | +- classic (entity STREAMING_DEBUG_PROBE) |
| 13 | +- inverted [#f1]_ (entity STREAMING_DEBUG_PROBE_N) |
| 14 | +- MFB (entity STREAMING_DEBUG_PROBE_MFB); often also used for MVB |
| 15 | + |
| 16 | +The Debug Probes are usually placed between two neighboring components in a stream pipeline. |
| 17 | +For example, imagine a pipeline consisting of components A --> B --> C, as in the following figure. |
| 18 | + |
| 19 | +.. _figure1: |
| 20 | + |
| 21 | +.. figure:: img/streaming_pipeline_example.drawio.svg |
| 22 | + :align: center |
| 23 | + :width: 50 % |
| 24 | + |
| 25 | + An example of a stream pipeline where component A sends data to comp B (and B to C) and where B uses backpressure (DST_RDY) to pause data from A (and C to B). |
| 26 | + |
| 27 | +In this case, Probes can be placed between the components as well as on the beginning and end of the pipeline. |
| 28 | +All Probes should be connected to the same Debug Master (for simplicity and saving FPGA resources). |
| 29 | +This is displayed in the following diagram. |
| 30 | + |
| 31 | +.. _figure2: |
| 32 | + |
| 33 | +.. figure:: img/streaming_debug_example.drawio.svg |
| 34 | + :align: center |
| 35 | + :width: 80 % |
| 36 | + |
| 37 | + A pipeline with integrated Debug Probes and Master. |
| 38 | + Control signals such as Data Valid (SRC_RDY), Start-Of-Packet (SOP), End-Of-Packet (EOP), and backpressure (DST_RDY) all flow through the Probe. |
| 39 | + This is the intended manner in which the probes should be integrated into a design to use all of its features. |
| 40 | + Also, the "Bus Control" (see section :ref:`bus_control`) signals are connected from the Master to the Probe. |
| 41 | + |
| 42 | +However, we often do not need to use features to stop (block) or discard (drop) the flowing traffic. |
| 43 | +In that case, the "Bus Control" signals and some other connections can be omitted. |
| 44 | +The typical connection of the Debug Probes is shown in the following diagram. |
| 45 | + |
| 46 | +.. _figure3: |
| 47 | + |
| 48 | +.. figure:: img/streaming_debug_example_2.drawio.svg |
| 49 | + :align: center |
| 50 | + :width: 80 % |
| 51 | + |
| 52 | + Common connection of the Probes in the NDK designs - Bus Control is not used (see section :ref:`bus_control`). |
| 53 | + |
| 54 | +Debug Master |
| 55 | +------------ |
| 56 | +The Debug Master component is connected to the MI bus and one or more Probes. |
| 57 | +It accepts commands through the MI bus to control the Probes or read statistical data. |
| 58 | +The module contains counters that increment according to signals received from each Probe (one counter - of each type - per Probe). |
| 59 | + |
| 60 | +Counters |
| 61 | +~~~~~~~~ |
| 62 | +Six types of counters are available in the Debug Master for each Debug Probe. |
| 63 | +Each can be disabled/enabled by generic parameters: "E" or "e" to "enable"; anything else will translate as "disable". |
| 64 | + |
| 65 | +- `COUNTER_WORD`: number of valid data words - clock cycles when both SRC_RDY and DST_RDY were asserted. |
| 66 | +- `COUNTER_WAIT`: number of clock cycles when neither SRC_RDY nor DST_RDY were asserted. |
| 67 | +- `COUNTER_DST_HOLD`: number of clock cycles when SRC_RDY was asserted and DST_RDY deasserted (the next component in the pipeline could not process new data). |
| 68 | +- `COUNTER_SRC_HOLD`: number of clock cycles when SRC_RDY was deasserted and DST_RDY asserted (the previous component in the pipeline did not output valid data). |
| 69 | +- `COUNTER_SOP`: number of transaction starts (valid SOPs/SOFs). |
| 70 | +- `COUNTER_EOP`: number of transaction ends (valid SOPs/SOFs). |
| 71 | + |
| 72 | +Debug Probes |
| 73 | +------------ |
| 74 | +Each Probe has three interfaces: |
| 75 | + |
| 76 | +- `RX` - connect signals on the interface of the previous component in the pipeline. |
| 77 | + In the A --> B --> C example at the top, this would be the output (TX) interface of component **A** for Probe placed between comps **A** and **B**. |
| 78 | +- `TX` - connect signals on the interface of the next component in the pipeline. |
| 79 | + In the A --> B --> C example at the top, this would be the input (RX) interface of component **B** for Probe placed between comps **A** and **B**. |
| 80 | +- `DEBUG` - connect to the Master's `DEBUG` interface. |
| 81 | + |
| 82 | +See Probe connections in the :ref:`second diagram <figure2>` (or the :ref:`third <figure3>`). |
| 83 | + |
| 84 | +**The Debug interface** |
| 85 | + |
| 86 | +When Bus Control is enabled, the `BLOCK` and `DROP` signals can modify the traffic flow (see the following section). |
| 87 | +Other signals on this interface are the monitored signals from the Probe that increment the Master's counters. |
| 88 | + |
| 89 | +Each Probe is identified by: |
| 90 | + |
| 91 | +- four-letter user-defined string (generic parameter of the component), |
| 92 | +- an automatically assigned ID (port number on which it is connected to the Master) |
| 93 | + |
| 94 | +.. _bus_control: |
| 95 | + |
| 96 | +Bus control |
| 97 | +----------- |
| 98 | +When this "advanced" feature is enabled, the user can halt or discard the traffic flowing through a selected Probe. |
| 99 | +To utilize this feature, the Probe must be inserted into the pipeline as shown in the :ref:`second diagram <figure2>`. |
| 100 | +And for each Probe, it has to be enabled using the `BUS_CONTROL` generic parameter. |
| 101 | +Appropriate MI commands to Debug Master are translated to the `DEBUG_BLOCK` and `DEBUG_DROP` interface signals. |
| 102 | +This sets the requested Probe to: |
| 103 | + |
| 104 | +- Halt the traffic (when the `DEBUG_BLOCK` signal asserts). |
| 105 | + The Probe then pauses the incoming traffic by deasserting `RX_DST_RDY` and invalidating the output by deasserting `TX_SRC_RDY`. |
| 106 | +- Discard the traffic (when the `DEBUG_DROP` signal asserts; has priority over the `DEBUG_BLOCK` signal). |
| 107 | + The Probe accepts all incoming traffic by asserting `RX_DST_RDY` and invalidate the output by deasserting `TX_SRC_RDY`. |
| 108 | + |
| 109 | +.. _usage: |
| 110 | + |
| 111 | +Usage |
| 112 | +----- |
| 113 | +Use the `nfb-busdebugctl` tool for easy control of the whole Streaming Debug system. |
| 114 | +For more info, see the tool's documentation. |
| 115 | + |
| 116 | +Entities |
| 117 | +-------- |
| 118 | + |
| 119 | +.. vhdl:autoentity:: STREAMING_DEBUG_MASTER |
| 120 | +
|
| 121 | +.. vhdl:autoentity:: STREAMING_DEBUG_PROBE_MFB |
| 122 | +
|
| 123 | +.. rubrica:: Footnotes |
| 124 | + |
| 125 | +.. [#f1] The monitored signals are expected to be negated. |
| 126 | +
|
0 commit comments