Giter VIP home page Giter VIP logo

verilog-axis's Introduction

Verilog AXI Stream Components Readme

Build Status

For more information and updates: http://alexforencich.com/wiki/en/verilog/axis/start

GitHub repository: https://github.com/alexforencich/verilog-axis

Introduction

Collection of AXI Stream bus components. Most components are fully parametrizable in interface widths. Includes full cocotb testbenches that utilize cocotbext-axi.

Documentation

arbiter module

General-purpose parametrizable arbiter. Supports priority and round-robin arbitration. Supports blocking until request release or acknowledge.

axis_adapter module

The axis_adapter module bridges AXI stream buses of differing widths. The module is parametrizable, but there are certain restrictions. First, the bus word widths must be identical (e.g. one 8-bit lane and eight 8-bit lanes, but not one 16-bit lane and one 32-bit lane). Second, the bus widths must be related by an integer multiple (e.g. 2 words and 6 words, but not 4 words and 6 words). Wait states will be inserted on the wider bus side when necessary.

axis_arb_mux module

Frame-aware AXI stream arbitrated multiplexer with parametrizable data width and port count. Supports priority and round-robin arbitration.

Wrappers can generated with axis_arb_mux_wrap.py.

axis_async_fifo module

Configurable word-based or frame-based asynchronous FIFO with parametrizable data width, depth, type, and bad frame detection. Supports power of two depths only.

axis_async_fifo_adapter module

Configurable word-based or frame-based asynchronous FIFO with parametrizable data width, depth, type, and bad frame detection. Supports different input and output data widths, inserting an axis_adapter instance appropriately. Supports power of two depths only.

axis_broadcast module

AXI stream broadcaster. Duplicates one input stream across multiple output streams.

axis_cobs_decode

Consistent Overhead Byte Stuffing (COBS) decoder. Fixed 8 bit width.

axis_cobs_encode

Consistent Overhead Byte Stuffing (COBS) encoder. Fixed 8 bit width. Configurable zero insertion.

axis_crosspoint module

Basic crosspoint switch. tready signal not supported. Parametrizable data width.

Wrappers can generated with axis_crosspoint_wrap.py.

axis_demux module

Frame-aware AXI stream demultiplexer with parametrizable data width and port count.

axis_fifo module

Configurable word-based or frame-based synchronous FIFO with parametrizable data width, depth, type, and bad frame detection. Supports power of two depths only.

axis_fifo_adapter module

Configurable word-based or frame-based synchronous FIFO with parametrizable data width, depth, type, and bad frame detection. Supports different input and output data widths, inserting an axis_adapter instance appropriately. Supports power of two depths only.

axis_frame_join module

Frame joiner with optional tag and parametrizable port count. 8 bit data path only.

Wrappers can generated with axis_frame_join_wrap.py.

axis_frame_length_adjust module

Frame length adjuster module. Truncates or pads frames as necessary to meet the specified minimum and maximum length. Reports the original and current lengths as well as whether the packet was truncated or padded. Length limits are configurable at run time.

axis_frame_length_adjust_fifo module

Frame length adjuster module with FIFO. Truncates or pads frames as necessary to meet the specified minimum and maximum length. Reports the original and current lengths as well as whether the packet was truncated or padded. FIFOs are used so that the status information can be read before the packet itself. Length limits are configurable at run time.

axis_ll_bridge module

AXI stream to LocalLink bridge.

axis_mux module

Frame-aware AXI stream multiplexer with parametrizable data width and port count.

Wrappers can generated with axis_mux_wrap.py.

axis_pipeline_fifo module

Parametrizable register pipeline with output FIFO. LENGTH parameter determines number of register stages. For a sufficient pipeline length and bus width, consumes fewer resources than axis_pipeline_register while providing full throughput.

axis_pipeline_register module

Parametrizable register pipeline. LENGTH parameter determines number of register stages (instances of axis_register).

axis_ram_switch module

Frame-aware AXI stream RAM switch with parametrizable data width, port count, and FIFO size. Uses block RAM for storing packets in transit, time-sharing the RAM interface between ports. Functionally equivalent to a combination of per-port frame FIFOs and width converters connected to an AXI stream switch.

axis_rate_limit module

Fractional rate limiter, supports word and frame modes. Inserts wait states to limit data rate to specified ratio. Frame mode inserts wait states at end of frames, word mode ignores frames and inserts wait states at any point. Parametrizable data width. Rate and mode are configurable at run time.

axis_register module

Datapath register with parameter to select between skid buffer, simple buffer, and bypass. Use to improve timing for long routes. Use REG_TYPE parameter to select the type of register (bypass, simple, or skid buffer).

axis_srl_fifo module

SRL-based FIFO. Good for small FIFOs. SRLs on Xilinx FPGAs have a very fast input setup time, so this module can be used to aid in timing closure.

axis_srl_register module

SRL-based register. SRLs on Xilinx FPGAs have a very fast input setup time, so this module can be used to aid in timing closure.

axis_stat_counter module

Statistics counter module. Counts bytes and frames passing through monitored AXI stream interface. Trigger signal used to reset and dump counts out of AXI interface, along with tag value. Use with axis_frame_join to form a single monolithic frame from multiple monitored points with the same trigger.

axis_switch module

Frame-aware AXI stream switch with parametrizable data width and port count.

Wrappers can generated with axis_switch_wrap.py.

axis_tap module

AXI stream tap module. Used to make a copy of an AXI stream bus without affecting the bus. Back-pressure on the output results in truncated frames with tuser set.

ll_axis_bridge module

LocalLink to AXI stream bridge.

priority_encoder module

Parametrizable priority encoder.

Common signals

tdata   : Data (width generally DATA_WIDTH)
tkeep   : Data word valid (width generally KEEP_WIDTH)
tvalid  : Data valid
tready  : Sink ready
tlast   : End-of-frame
tid     : Identifier tag (width generally ID_WIDTH)
tdest   : Destination tag (width generally DEST_WIDTH)
tuser   : User sideband signals (width generally USER_WIDTH)

Common parameters

DATA_WIDTH           : width of tdata signal
KEEP_ENABLE          : enable tkeep signal (default DATA_WIDTH>8)
KEEP_WIDTH           : width of tkeep signal (default (DATA_WIDTH+7)/8)
LAST_ENABLE          : enable tlast signal
ID_ENABLE            : enable tid signal
ID_WIDTH             : width of tid signal
DEST_ENABLE          : enable tdest signal
DEST_WIDTH           : width of tdest signal
USER_ENABLE          : enable tuser signal
USER_WIDTH           : width of tuser signal
USER_BAD_FRAME_VALUE : value of tuser indicating bad frame
USER_BAD_FRAME_MASK  : bitmask for tuser bad frame indication

Source Files

arbiter.v                          : General-purpose parametrizable arbiter
axis_adapter.v                     : Parametrizable bus width adapter
axis_arb_mux.v                     : Parametrizable arbitrated multiplexer
axis_async_fifo.v                  : Parametrizable asynchronous FIFO
axis_async_fifo_adapter.v          : FIFO/width adapter wrapper
axis_broadcast.v                   : AXI stream broadcaster
axis_cobs_decode.v                 : COBS decoder
axis_cobs_encode.v                 : COBS encoder
axis_crosspoint.v                  : Parametrizable crosspoint switch
axis_demux.v                       : Parametrizable demultiplexer
axis_fifo.v                        : Parametrizable synchronous FIFO
axis_fifo_adapter.v                : FIFO/width adapter wrapper
axis_frame_join.v                  : Parametrizable frame joiner
axis_frame_length_adjust.v         : Frame length adjuster
axis_frame_length_adjust_fifo.v    : Frame length adjuster with FIFO
axis_ll_bridge.v                   : AXI stream to LocalLink bridge
axis_mux.v                         : Multiplexer generator
axis_pipeline_fifo.v               : AXI stream register pipeline with FIFO
axis_pipeline_register.v           : AXI stream register pipeline
axis_ram_switch.v                  : AXI stream RAM switch
axis_rate_limit.v                  : Fractional rate limiter
axis_register.v                    : AXI Stream register
axis_srl_fifo.v                    : SRL-based FIFO
axis_srl_register.v                : SRL-based register
axis_switch.v                      : Parametrizable AXI stream switch
axis_stat_counter.v                : Statistics counter
axis_tap.v                         : AXI stream tap
ll_axis_bridge.v                   : LocalLink to AXI stream bridge
priority_encoder.v                 : Parametrizable priority encoder

AXI Stream Interface Example

two byte transfer with sink pause after each byte

          __    __    __    __    __    __    __    __    __
clk    __/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__
                _____ _________________
tdata  XXXXXXXXX_D0__X_D1______________XXXXXXXXXXXXXXXXXXXXXXXX
                _____ _________________
tkeep  XXXXXXXXX_K0__X_K1______________XXXXXXXXXXXXXXXXXXXXXXXX
                _______________________
tvalid ________/                       \_______________________
       ______________             _____             ___________
tready               \___________/     \___________/
                      _________________
tlast  ______________/                 \_______________________

tuser  ________________________________________________________

two back-to-back packets, no pauses

          __    __    __    __    __    __    __    __    __
clk    __/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__
                _____ _____ _____ _____ _____ _____
tdata  XXXXXXXXX_A0__X_A1__X_A2__X_B0__X_B1__X_B2__XXXXXXXXXXXX
                _____ _____ _____ _____ _____ _____
tkeep  XXXXXXXXX_K0__X_K1__X_K2__X_K0__X_K1__X_K2__XXXXXXXXXXXX
                ___________________________________
tvalid ________/                                   \___________
       ________________________________________________________
tready
                            _____             _____
tlast  ____________________/     \___________/     \___________

tuser  ________________________________________________________

bad frame

          __    __    __    __    __    __
clk    __/  \__/  \__/  \__/  \__/  \__/  \__
                _____ _____ _____
tdata  XXXXXXXXX_A0__X_A1__X_A2__XXXXXXXXXXXX
                _____ _____ _____
tkeep  XXXXXXXXX_K0__X_K1__X_K2__XXXXXXXXXXXX
                _________________
tvalid ________/                 \___________
       ______________________________________
tready
                            _____
tlast  ____________________/     \___________
                            _____
tuser  ____________________/     \___________

Testing

Running the included testbenches requires cocotb, cocotbext-axi, and Icarus Verilog. The testbenches can be run with pytest directly (requires cocotb-test), pytest via tox, or via cocotb makefiles.

verilog-axis's People

Contributors

alexforencich avatar lomotos10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

verilog-axis's Issues

Width mismatch in axis_arb_mux

I fixed all the Verilator warnings in #9 except for one. For this one I have three functionally equivalent solutions but they all introduce various levels of ugliness so I would like to have your input on which one to choose. Let me know which you prefer and I'll swing you another patch

Option 1

diff --git a/rtl/axis_arb_mux.v b/rtl/axis_arb_mux.v
index 72a3de5..130430b 100644
--- a/rtl/axis_arb_mux.v
+++ b/rtl/axis_arb_mux.v
@@ -66,7 +66,7 @@ module axis_arb_mux #
     input  wire [S_COUNT*DATA_WIDTH-1:0] s_axis_tdata,
     input  wire [S_COUNT*KEEP_WIDTH-1:0] s_axis_tkeep,
     input  wire [S_COUNT-1:0]            s_axis_tvalid,
-    output wire [S_COUNT-1:0]            s_axis_tready,
+    output reg [S_COUNT-1:0]            s_axis_tready,
     input  wire [S_COUNT-1:0]            s_axis_tlast,
     input  wire [S_COUNT*ID_WIDTH-1:0]   s_axis_tid,
     input  wire [S_COUNT*DEST_WIDTH-1:0] s_axis_tdest,
@@ -104,7 +104,10 @@ reg  [DEST_WIDTH-1:0] m_axis_tdest_int;
 reg  [USER_WIDTH-1:0] m_axis_tuser_int;
 wire                  m_axis_tready_int_early;
 
-assign s_axis_tready = (m_axis_tready_int_reg && grant_valid) << grant_encoded;
+always @* begin
+   s_axis_tready = {S_COUNT{1'b0}};
+   s_axis_tready[grant_encoded] = (m_axis_tready_int_reg && grant_valid);
+end

Option 2

diff --git a/rtl/axis_arb_mux.v b/rtl/axis_arb_mux.v
index 72a3de5..ea00ea9 100644
--- a/rtl/axis_arb_mux.v
+++ b/rtl/axis_arb_mux.v
@@ -104,7 +104,9 @@ reg  [DEST_WIDTH-1:0] m_axis_tdest_int;
 reg  [USER_WIDTH-1:0] m_axis_tuser_int;
 wire                  m_axis_tready_int_early;
 
+/* verilator lint_off WIDTH */
 assign s_axis_tready = (m_axis_tready_int_reg && grant_valid) << grant_encoded;
+/* verilator lint_on WIDTH */
 
 // mux for incoming packet
 wire [DATA_WIDTH-1:0] current_s_tdata  = s_axis_tdata[grant_encoded*DATA_WIDTH +: DATA_WIDTH];

Option 3

index 72a3de5..cbbe1ad 100644
--- a/rtl/axis_arb_mux.v
+++ b/rtl/axis_arb_mux.v
@@ -104,7 +104,7 @@ reg  [DEST_WIDTH-1:0] m_axis_tdest_int;
 reg  [USER_WIDTH-1:0] m_axis_tuser_int;
 wire                  m_axis_tready_int_early;
 
-assign s_axis_tready = (m_axis_tready_int_reg && grant_valid) << grant_encoded;
+assign s_axis_tready = {{S_COUNT-1{1'b0}},(m_axis_tready_int_reg && grant_valid)} << grant_encoded;
 
 // mux for incoming packet
 wire [DATA_WIDTH-1:0] current_s_tdata  = s_axis_tdata[grant_encoded*DATA_WIDTH +: DATA_WIDTH];

Async FIFO does not reset

Steps to reproduce:

  1. Push data into a dual clock FIFO with back pressure applied by holding output_axis_tready low.
  2. Reset the FIFO.
  3. Release the FIFO reset and the data will then come out.

Expected behaviour: resetting will empty the FIFO.

Some questions about axis_async_fifo

Dear alexforencich,
when using axis_async_fifo.v in this repository, I met some questions and I'm not sure whether it's just designed for this, so I want to seek for help for these quesions:
1.if I just write data in this fifo, and don't read→ that means m_axis_tready keep deasserted, in this situation, store_output will assert , and fifo is not empty, so it will perform read, and rd_ptr_reg will continually plus 1 until empty is asserted , but in fact I am not ready to read, these data will be ignored.
2. In this fifo's read logic, it seems that tvalid's asserting depends on whether tready is asserted or not, but axi4s protocol said that 'it's not permitted to wait until TREADY is asserted before asserting TVALID'.
Hoping for you advice for these questions,thanks!

Just A Question

Hi Alex,
Thanks for the great IP.
Can you explain concept of the frame WRT AXI-S, and how you use it?
Thanks
Mike

axis_adapter lost data

  1. use TKEEP and TLAST signal;
  2. Slave width is 250 bytes;
  3. Master width is 4 bytes;

250 = 62 * 4 + 2, then the last 2 bytes lost

Questions about Clock Domain Crossing in axis_async_fifo

Hi I am looking at this specific commit 40acee1bc59c8091c65cedfa470cc16cbce8e6bb.

The module "axis_async_fifo" has a write clock domain (driven by s_clk) and a read clock domain (driven by m_clk). To my understanding, the CDC strategy used in the write domain -> read domain direction is a mux-controlled CDC, i.e., the read domain will only accept the gray pointer from write domain if the update signal generated from write domain is propagated from write to read domain. Also, any updates to the write pointer will be delayed until the ACK for the update signal is propagated back to the write domain.

Above is the case for write -> read direction. However, in read -> write direction, it seems to me we only use 2-flop synchronizer (without any ACK signal) to sync the read pointer from read to write domain.

Q1: Is there a reason why the ACK signal is needed in the write -> read direction? Can't we just simply use 2-flop synchronizer like we do in the read -> write direction?

Q2: Why the pipeline registers in "axis_async_fifo" are needed to sync the read output from the memory? Isn't the read result already synced to the read clock? (based on my assumption that the memory is 1r1w synchronous with separate read/write clocks)

Thanks!

AXIS Mux Missing first tvalid?

@alexforencich I ran stimulus (two AXI Stream interfaces) through the axis_mux.v module and it seems to be missing the tvalid on the first beat on the m_axis output. So, if i transmit send it a transaction of 16 beats, I only get 15 tvalid's out. tdata is correct though. Can you confirm this?
axis_mux_missing_first_beat

axis_frame_length_adjust_fifo incorrect works with small header fifo length

Hi. I'm trying to use axis_frame_length_adjust_fifo in such a way that length_max * HEADER_FIFO_DEPTH << FRAME_FIFO_DEPTH. In this situation, the fifo with headers is filled first. The input AXI interface of the axis_frame_length_adjust module looks fine. But the AXI output interface continues to keep a high level of the m_axis_valid signal at the end of the transaction. Thus, the data FIFO is filled with invalid data and when reading a data packet, its length does not correspond to the length that got into the fifo of the headers.
298112602-c4d63623-1455-4948-88ea-bd311139e213

Issue with tuser in axis_adapter

tuser is supposed to line up with tvalid and tready but it is not hence the reason why in the axis_async_fifo_adapter no tuser is not propagated through the asynchronous FIFO.
This case might not have been tested because tuser in network interfaces is not used but it is the start of frame for axis video while tlast is the end of line .
axis_adapter_tuser_issue

Will look at the code and come up with a solution.

Thank you,

Wim

Intel quartus axis_async_fifo constraints

Quartus gives HOLD slack using the quartus and quartus_pro constraint files.

  • rd_ptr_gray_reg[1] rd_ptr_gray_sync1_reg[1]
  • rd_ptr_gray_reg[0] rd_ptr_gray_sync1_reg[0]
  • rd_ptr_gray_reg[2] rd_ptr_gray_sync1_reg[2]
  • wr_ptr_update_sync3_reg wr_ptr_update_ack_sync1_reg

The problem is the Data Required Path, clock path:
image

Requesting elaboration on axis_adapter

So firstly, thank you for these modules, they've been super useful to me as somebody still new to RTL design.

I just want to confirm my findings on the axis_adapter. I hooked it up to your great axis_uart module and found that when I send [b'\xbf', b'\x80'] in that order over UART, the Xilinx ILA shows the output of the axis_adapter as b'\x80\xbf'. It seems to me that the axis_adapter is expecting things in little-endian byte/word order, but the bytes/words themselves are big-endian. Is this part of the AXI4 standard or can I submit a PR to make a flag parameter that changes the word order?

Additionally, is this accomplished by simply replace indexing instances of seg_reg with (SEG_COUNT - seg_reg - 1)?

axis_fifo.v KEEP_ENABLE parameter changes ADDR_WIDTH

I used the axis_fifo module in a design and it wasn't working due to some issues with the depth of the memory. After some digging I found that the KEEP_ENABLE parameter causes the FIFO depth to shrink based on how many tkeep bits there are.

parameter ADDR_WIDTH = (KEEP_ENABLE && KEEP_WIDTH > 1) ? $clog2(DEPTH/KEEP_WIDTH) : $clog2(DEPTH);

Is there a reason the tkeep is impacting the depth of the FIFO? If I force the code to always use $clogs(DEPTH) then it works great. If there's a reason it was done this way I'd like to understand it in order to use the IP as-is instead of modifying it in my project.

The version I'm using isn't the latest, but I see the same line in the current version.

edge case bug in axis_frame_len.v

If there is a barrage of back to back single transfer packets (with last set on every transfer) the internal frame length counter doesn't clear. So instead the output frame length for each packet continues to grow in size, accumulating larger with each single transfer packet.

axis_adapter incorrect works with parameter S_KEEP_ENABLE = 0 and when input port s_axis_tkeep = 1'b0

Hi,
In the axis_adapter module, if the S_KEEP_ENABLE parameter is disabled, the tkeep input signal should be taken as 1'b1. This was the case in the previous version of the module. In the current version, if the s_axis_tkeep port is set to 1'b0, then this value participates in the logic of the module.

In order to see it in tests, you need to change the test. For example

diff --git a/tb/axis_adapter/Makefile b/tb/axis_adapter/Makefile
index 3e06415..730b77b 100644
--- a/tb/axis_adapter/Makefile
+++ b/tb/axis_adapter/Makefile
@@ -35,7 +35,7 @@ VERILOG_SOURCES += ../../rtl/$(DUT).v
 export PARAM_S_DATA_WIDTH := 8
 export PARAM_S_KEEP_ENABLE := $(shell expr $(PARAM_S_DATA_WIDTH) \> 8 )
 export PARAM_S_KEEP_WIDTH := $(shell expr \( $(PARAM_S_DATA_WIDTH) + 7 \) / 8 )
-export PARAM_M_DATA_WIDTH := 8
+export PARAM_M_DATA_WIDTH := 64
 export PARAM_M_KEEP_ENABLE := $(shell expr $(PARAM_M_DATA_WIDTH) \> 8 )
 export PARAM_M_KEEP_WIDTH := $(shell expr \( $(PARAM_M_DATA_WIDTH) + 7 \) / 8 )
 export PARAM_ID_ENABLE := 1
diff --git a/tb/axis_adapter/test_axis_adapter.py b/tb/axis_adapter/test_axis_adapter.py
index 5997d61..e49f7d1 100644
--- a/tb/axis_adapter/test_axis_adapter.py
+++ b/tb/axis_adapter/test_axis_adapter.py
@@ -88,6 +88,7 @@ async def run_test(dut, payload_lengths=None, payload_data=None, idle_inserter=N
 
     for test_data in [payload_data(x) for x in payload_lengths()]:
         test_frame = AxiStreamFrame(test_data)
+        if tb.source.byte_lanes == 1: test_frame.tkeep = [0]*len(test_data)
         test_frame.tid = cur_id
         test_frame.tdest = cur_id

Besides, the test script tb/test_axis_adapter_8_64.py with the current version of the module hangs in an infinite loop.

BR,
Pavel

Endianness of axis_fifo_adapter

I'm using the axis_fifo_adapter with an input data width of 32 and output data width of 8. I was surprised to see that the output data stream seems to come out in little endian. For example if the input data word is "DEAD_BEEF", it's coming out of the FIFO as "EF", "BE", "AD", "DE".

Is this by design? I would have expected the fifo to use Netowrk byte order or have an option to do that. Am I doing something wrong?

async FIFO timing constraints for Vivado

I'm not sure where these should be documented but it would be nice for the user to have a template to get the constraints right for Vivado. After, poking around in the FIFO from Xilinx and Xilinx forums, this works for me:

#grey coded counter synchronizers in  get a max_delay -datapath only
set wrclk [get_clocks -of_objects [get_ports input_clk]]
set rdclk [get_clocks -of_objects [get_ports output_clk]]
set_max_delay -from [get_cells fifo_inst/wr_ptr_gray_reg_reg[*]] -to [get_cells fifo_inst/wr_ptr_gray_sync1_reg_reg[*]] -datapath_only [get_property -min PERIOD $wrclk]
set_max_delay -from [get_cells fifo_inst/rd_ptr_gray_reg_reg[*]] -to [get_cells fifo_inst/rd_ptr_gray_sync1_reg_reg[*]] -datapath_only [get_property -min PERIOD $rdclk]

#set ASYNC_REG property for all registers in the grey code synchronizer chain
set_property ASYNC_REG TRUE [get_cells -regexp {fifo_inst/(wr|rd)_ptr_gray_sync[12]_reg_reg\[\d+\]}]

#ASYNC_REG property and false path to the reset synchronizer
set_property ASYNC_REG TRUE [get_cells -regexp {fifo_inst/(input|output)_rst_sync[123]_reg_reg}]
set_false_path -to [get_cells -regexp {fifo_inst/(input|output)_rst_sync[123]_reg_reg}]
set_false_path -from [get_cells fifo_inst/output_rst_sync1_reg_reg] -to [get_cells fifo_inst/input_rst_sync2_reg_reg]

axis_async_fifo write pointer CDC

While going after the items reported by the CDC related DRCs of intel quartus 21.3, most of the items seem to be OK from an RTL perspective. But one item catched my eye, which is

wire empty = rd_ptr_gray_reg == (FRAME_FIFO ? wr_ptr_gray_sync1_reg : wr_ptr_gray_sync2_reg);

I don't get the reason why it is OK in FRAME_FIFO mode to read the first stage of the synchronisation chain of the write pointer.

Another item is that in CDCs it is usually not a good idea to add logic in between the last flop of the source clock and the first flop of the destination clock, see

end else if (wr_ptr_update_sync2_reg ^ wr_ptr_update_sync3_reg) begin
wr_ptr_gray_sync1_reg <= wr_ptr_sync_gray_reg;
The path (last flop in source clock) -> (first flop in destination clock) -> (second flop in destination clock) should be free of any logic to allow for shortest paths in between the flops to reduce the probability of metastability.
This special is actually worse, because depending on the condition the input of the synchronizer chain is either driven by the source clock or the destination clock.

arbiter module renaming

Hi,

I'm using your core in a larger code base which has another module called arbiter which is a bit tricky to handle nicely. Would you consider renaming the one here to something like verilog_axis_arbiter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.