Skip to content

Commit

Permalink
Fix reset CDC in AXI VFIFO
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Forencich <[email protected]>
  • Loading branch information
alexforencich committed Mar 30, 2023
1 parent 59d37ee commit 38915fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rtl/axi_vfifo.v
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,14 @@ for (n = 0; n < AXI_CH; n = n + 1) begin : axi_ch
// control sync
(* shreg_extract = "no" *)
reg ch_cfg_enable_sync_1_reg = 1'b0, ch_cfg_enable_sync_2_reg = 1'b0;
(* shreg_extract = "no" *)
reg ch_cfg_reset_sync_1_reg = 1'b0, ch_cfg_reset_sync_2_reg = 1'b0;

always @(posedge ch_clk) begin
ch_cfg_enable_sync_1_reg <= cfg_enable_reg;
ch_cfg_enable_sync_2_reg <= ch_cfg_enable_sync_1_reg;
ch_cfg_reset_sync_1_reg <= cfg_reset_reg;
ch_cfg_reset_sync_2_reg <= ch_cfg_reset_sync_1_reg;
end

// status sync
Expand Down Expand Up @@ -535,7 +539,7 @@ for (n = 0; n < AXI_CH; n = n + 1) begin : axi_ch
.cfg_fifo_base_addr(cfg_fifo_base_addr_reg[AXI_ADDR_WIDTH*n +: AXI_ADDR_WIDTH]),
.cfg_fifo_size_mask(cfg_fifo_size_mask_reg),
.cfg_enable(ch_cfg_enable_sync_2_reg),
.cfg_reset(cfg_reset_reg),
.cfg_reset(ch_cfg_reset_sync_2_reg),

/*
* Status
Expand Down
1 change: 1 addition & 0 deletions syn/vivado/axi_vfifo.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ foreach inst [get_cells -hier -filter {(ORIG_REF_NAME == axi_vfifo || REF_NAME =

# control
constrain_sync_chain $inst "cfg_enable_reg_reg" "axi_ch[*].ch_cfg_enable_sync_1_reg_reg" "axi_ch[*].ch_cfg_enable_sync_2_reg_reg"
constrain_sync_chain $inst "cfg_reset_reg_reg" "axi_ch[*].ch_cfg_reset_sync_1_reg_reg" "axi_ch[*].ch_cfg_reset_sync_2_reg_reg"

set sync_ffs [get_cells "$inst/cfg_fifo_base_addr_reg_reg[*] $inst/axi_ch[*].axi_vfifo_raw_inst/fifo_base_addr_reg_reg[*]"]

Expand Down

0 comments on commit 38915fb

Please sign in to comment.