From 46bd4302de262872185d87ba8a7cec5c36b197b4 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Thu, 8 Dec 2022 18:49:21 -0800 Subject: [PATCH] Update async FIFO timing constraints to handle clocks from OOC IP that are not constrained during synthesis Signed-off-by: Alex Forencich --- syn/vivado/axis_async_fifo.tcl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/syn/vivado/axis_async_fifo.tcl b/syn/vivado/axis_async_fifo.tcl index 5f173b3ca..086515a34 100644 --- a/syn/vivado/axis_async_fifo.tcl +++ b/syn/vivado/axis_async_fifo.tcl @@ -24,13 +24,13 @@ foreach fifo_inst [get_cells -hier -filter {(ORIG_REF_NAME == axis_async_fifo || puts "Inserting timing constraints for axis_async_fifo instance $fifo_inst" # get clock periods - set read_clk [get_clocks -of_objects [get_pins -quiet "$fifo_inst/rd_ptr_reg_reg[*]/C $fifo_inst/rd_ptr_gray_reg_reg[*]/C $fifo_inst/wr_ptr_gray_sync1_reg_reg[*]/C"]] - set write_clk [get_clocks -of_objects [get_pins -quiet "$fifo_inst/wr_ptr_reg_reg[*]/C $fifo_inst/wr_ptr_gray_reg_reg[*]/C $fifo_inst/rd_ptr_gray_sync1_reg_reg[*]/C"]] + set write_clk [get_clocks -of_objects [get_cells -quiet "$fifo_inst/wr_ptr_reg_reg[*] $fifo_inst/wr_ptr_gray_reg_reg[*] $fifo_inst/rd_ptr_gray_sync1_reg_reg[*]"]] + set read_clk [get_clocks -of_objects [get_cells -quiet "$fifo_inst/rd_ptr_reg_reg[*] $fifo_inst/rd_ptr_gray_reg_reg[*] $fifo_inst/wr_ptr_gray_sync1_reg_reg[*]"]] - set read_clk_period [get_property -min PERIOD $read_clk] - set write_clk_period [get_property -min PERIOD $write_clk] + set write_clk_period [if {[llength $write_clk]} {get_property -min PERIOD $write_clk} {expr 1.0}] + set read_clk_period [if {[llength $read_clk]} {get_property -min PERIOD $read_clk} {expr 1.0}] - set min_clk_period [expr $read_clk_period < $write_clk_period ? $read_clk_period : $write_clk_period] + set min_clk_period [expr min($write_clk_period, $read_clk_period)] # reset synchronization set reset_ffs [get_cells -quiet -hier -regexp ".*/s_rst_sync\[23\]_reg_reg" -filter "PARENT == $fifo_inst"]