|
| 1 | +# Verilog AXI Stream Components Readme |
| 2 | + |
| 3 | +For more information and updates: http://alexforencich.com/wiki/en/verilog/axis/start |
| 4 | + |
| 5 | +GitHub repository: https://github.com/alexforencich/verilog-axis |
| 6 | + |
| 7 | +## Introduction |
| 8 | + |
| 9 | +Collection of AXI Stream bus components. Most components are fully |
| 10 | +parametrizable in interface widths. Includes full MyHDL testbench with |
| 11 | +intelligent bus cosimulation endpoints. |
| 12 | + |
| 13 | +## Documentation |
| 14 | + |
| 15 | +### axis_adapter module |
| 16 | + |
| 17 | +The axis_adapter module bridges AXI stream busses of differing widths. The |
| 18 | +module is parametrizable, but there are certain restrictions. First, the bus |
| 19 | +word widths must be identical (e.g. one 8-bit lane and eight 8-bit lanes, but |
| 20 | +not one 16-bit lane and one 32-bit lane). Second, the bus widths must be |
| 21 | +related by an integer multiple (e.g. 2 words and 6 words, but not 4 words |
| 22 | +and 6 words). Wait states will be inserted on the wider bus side when |
| 23 | +necessary. |
| 24 | + |
| 25 | +### axis_async_fifo module |
| 26 | + |
| 27 | +Basic word-based asynchronous FIFO with parametrizable data width and depth. |
| 28 | +Supports power of two depths only. |
| 29 | + |
| 30 | +### axis_async_fifo_64 module |
| 31 | + |
| 32 | +Basic word-based asynchronous FIFO with tkeep signal and parametrizable data |
| 33 | +width and depth. Supports power of two depths only. |
| 34 | + |
| 35 | +### axis_async_frame_fifo module |
| 36 | + |
| 37 | +Basic frame-based asynchronous FIFO with parametrizable data width and depth. |
| 38 | +Supports power of two depths only. |
| 39 | + |
| 40 | +### axis_async_fifo_64 module |
| 41 | + |
| 42 | +Basic frame-based asynchronous FIFO with tkeep signal and parametrizable data |
| 43 | +width and depth. Supports power of two depths only. |
| 44 | + |
| 45 | +### axis_fifo module |
| 46 | + |
| 47 | +Basic word-based synchronous FIFO with parametrizable data width and depth. |
| 48 | +Supports power of two depths only. |
| 49 | + |
| 50 | +### axis_fifo_64 module |
| 51 | + |
| 52 | +Basic word-based synchronous FIFO with tkeep signal and parametrizable data |
| 53 | +width and depth. Supports power of two depths only. |
| 54 | + |
| 55 | +### axis_frame_fifo module |
| 56 | + |
| 57 | +Basic frame-based synchronous FIFO with parametrizable data width and depth. |
| 58 | +Supports power of two depths only. |
| 59 | + |
| 60 | +### axis_fifo_64 module |
| 61 | + |
| 62 | +Basic frame-based synchronous FIFO with tkeep signal and parametrizable data |
| 63 | +width and depth. Supports power of two depths only. |
| 64 | + |
| 65 | +### axis_frame_join_N module |
| 66 | + |
| 67 | +Frame joiner with optional tag. 8 bit data path only. |
| 68 | + |
| 69 | +Can be generated with arbitrary port counts with axis_frame_join.py. |
| 70 | + |
| 71 | +### axis_ll_bringe module |
| 72 | + |
| 73 | +AXI stream to LocalLink bridge. |
| 74 | + |
| 75 | +### axis_rate_limit module |
| 76 | + |
| 77 | +Fractional rate limiter, supports word and frame modes. Inserts wait states |
| 78 | +to limit data rate to specified ratio. Frame mode inserts wait states at end |
| 79 | +of frames, word mode ignores frames and inserts wait states at any point. |
| 80 | +Parametrizable data width. Rate and mode are configurable at run time. |
| 81 | + |
| 82 | +### axis_rate_limit_64 module |
| 83 | + |
| 84 | +Fractional rate limiter with tkeep signal, supports word and frame modes. |
| 85 | +Inserts wait states to limit data rate to specified ratio. Frame mode inserts |
| 86 | +wait states at end of frames, word mode ignores frames and inserts wait states |
| 87 | +at any point. Parametrizable data width. Rate and mode are configurable at |
| 88 | +run time. |
| 89 | + |
| 90 | +### axis_register module |
| 91 | + |
| 92 | +Datapath register. Use to improve timing for long routes. |
| 93 | + |
| 94 | +### axis_register_64 module |
| 95 | + |
| 96 | +Datapath register with tkeep signal. Use to improve timing for long routes. |
| 97 | + |
| 98 | +### axis_stat_counter module |
| 99 | + |
| 100 | +Statistics counter module. Counts bytes and frames passing through monitored |
| 101 | +AXI stream interface. Trigger signal used to reset and dump counts out of AXI |
| 102 | +interface, along with tag value. Use with axis_frame_join_N to form a single |
| 103 | +monolithic frame from multiple monitored points with the same trigger. |
| 104 | + |
| 105 | +### ll_axis_bridge module |
| 106 | + |
| 107 | +LocalLink to AXI stream bridge. |
| 108 | + |
| 109 | +### Common signals |
| 110 | + |
| 111 | + tdata : Data (width generally DATA_WIDTH) |
| 112 | + tkeep : Data word valid (width generally KEEP_WIDTH, present on _64 modules) |
| 113 | + tvalid : Data valid |
| 114 | + tready : Sink ready |
| 115 | + tlast : End-of-frame |
| 116 | + tuser : Bad frame (valid with tlast & tvalid) |
| 117 | + |
| 118 | +### Source Files |
| 119 | + |
| 120 | + rtl/axis_adapter.v : Parametrizable bus width adapter |
| 121 | + rtl/axis_async_fifo.v : Asynchronous FIFO |
| 122 | + rtl/axis_async_fifo_64.v : Asynchronous FIFO (64 bit) |
| 123 | + rtl/axis_async_frame_fifo.v : Asynchronous frame FIFO |
| 124 | + rtl/axis_async_frame_fifo_64.v : Asynchronous frame FIFO (64 bit) |
| 125 | + rtl/axis_fifo.v : Synchronous FIFO |
| 126 | + rtl/axis_fifo_64.v : Synchronous FIFO (64 bit) |
| 127 | + rtl/axis_frame_fifo.v : Synchronous frame FIFO |
| 128 | + rtl/axis_frame_fifo_64.v : Synchronous frame FIFO (64 bit) |
| 129 | + rtl/axis_frame_join.py : Frame joiner generator |
| 130 | + rtl/axis_frame_join_4.v : 4 port frame joiner |
| 131 | + rtl/axis_ll_bridge.v : AXI stream to LocalLink bridge |
| 132 | + rtl/axis_rate_limit.v : Fractional rate limiter |
| 133 | + rtl/axis_rate_limit_64.v : Fractional rate limiter (64 bit) |
| 134 | + rtl/axis_register.v : AXI Stream register |
| 135 | + rtl/axis_register_64.v : AXI Stream register (64 bit) |
| 136 | + rtl/axis_stat_counter.v : Statistics counter |
| 137 | + rtl/ll_axis_bridge.v : LocalLink to AXI stream bridge |
| 138 | + |
| 139 | +### AXI Stream Interface Example |
| 140 | + |
| 141 | +two byte transfer with sink pause after each byte |
| 142 | + |
| 143 | + __ __ __ __ __ __ __ __ __ |
| 144 | + clk __/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__ |
| 145 | + _____ _________________ |
| 146 | + tdata XXXXXXXXX_D0__X_D1______________XXXXXXXXXXXXXXXXXXXXXXXX |
| 147 | + _____ _________________ |
| 148 | + tkeep XXXXXXXXX_K0__X_K1______________XXXXXXXXXXXXXXXXXXXXXXXX |
| 149 | + _______________________ |
| 150 | + tvalid ________/ \_______________________ |
| 151 | + ______________ _____ ___________ |
| 152 | + tready \___________/ \___________/ |
| 153 | + _________________ |
| 154 | + tlast ______________/ \_______________________ |
| 155 | + |
| 156 | + tuser ________________________________________________________ |
| 157 | + |
| 158 | + |
| 159 | +two back-to-back packets, no pauses |
| 160 | + |
| 161 | + __ __ __ __ __ __ __ __ __ |
| 162 | + clk __/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__ |
| 163 | + _____ _____ _____ _____ _____ _____ |
| 164 | + tdata XXXXXXXXX_A0__X_A1__X_A2__X_B0__X_B1__X_B2__XXXXXXXXXXXX |
| 165 | + _____ _____ _____ _____ _____ _____ |
| 166 | + tkeep XXXXXXXXX_K0__X_K1__X_K2__X_K0__X_K1__X_K2__XXXXXXXXXXXX |
| 167 | + ___________________________________ |
| 168 | + tvalid ________/ \___________ |
| 169 | + ________________________________________________________ |
| 170 | + tready |
| 171 | + _____ _____ |
| 172 | + tlast ____________________/ \___________/ \___________ |
| 173 | + |
| 174 | + tuser ________________________________________________________ |
| 175 | + |
| 176 | + |
| 177 | +bad frame |
| 178 | + |
| 179 | + __ __ __ __ __ __ |
| 180 | + clk __/ \__/ \__/ \__/ \__/ \__/ \__ |
| 181 | + _____ _____ _____ |
| 182 | + tdata XXXXXXXXX_A0__X_A1__X_A2__XXXXXXXXXXXX |
| 183 | + _____ _____ _____ |
| 184 | + tkeep XXXXXXXXX_K0__X_K1__X_K2__XXXXXXXXXXXX |
| 185 | + _________________ |
| 186 | + tvalid ________/ \___________ |
| 187 | + ______________________________________ |
| 188 | + tready |
| 189 | + _____ |
| 190 | + tlast ____________________/ \___________ |
| 191 | + _____ |
| 192 | + tuser ____________________/ \___________ |
| 193 | + |
| 194 | + |
| 195 | +## Testing |
| 196 | + |
| 197 | +Running the included testbenches requires MyHDL and Icarus Verilog. Make sure |
| 198 | +that myhdl.vpi is installed properly for cosimulation to work correctly. The |
| 199 | +testbenches can be run with a Python test runner like nose or py.test, or the |
| 200 | +individual test scripts can be run with python directly. |
| 201 | + |
| 202 | +### Testbench Files |
| 203 | + |
| 204 | + tb/axis_ep.py : MyHDL AXI Stream endpoints |
| 205 | + tb/ll_ep.py : MyHDL LocalLink endpoints |
0 commit comments