Skip to content

Commit a7ab337

Browse files
committed
mock-cpu: remove set_input/output_delays
Not idiomatic for the use-case where the mock-cpu would be connected into an SoC where timing closure is checked. setting set_input_delay in particular is problematic because it can lead to hold cells which should not be used at all, or if they have to be used, they should be inserted where the mock-cpu is used at the SoC level, not inside the mock-cpu macro. set_input/output_delay would be more approperiate at the top level of an SoC on the pins connecting to the outside world. Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 725bac4 commit a7ab337

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

flow/designs/asap7/mock-cpu/constraint.sdc

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,30 @@ set_clock_groups -group $clk1_name -group $clk2_name -asynchronous -allow_paths
2121
set_false_path -from [get_ports *rst_n]
2222
set_false_path -to [get_ports *rst_n]
2323

24-
# Give the world outside of the FIFO time to operate
25-
# on the cycle it is reading/writiing to the FIFO
26-
set min_percent 0.1
27-
set max_percent 0.5
28-
29-
set_input_delay -clock $clk2_name -max [expr $clk2_period * $max_percent] [match_pins .* input 0]
30-
set_output_delay -clock $clk2_name -max [expr $clk2_period * $max_percent] [match_pins .* output 0]
31-
set_input_delay -clock $clk2_name -min [expr $clk2_period * $min_percent] [match_pins .* input 0]
32-
set_output_delay -clock $clk2_name -min [expr $clk2_period * $min_percent] [match_pins .* output 0]
24+
# The mock-cpu is a macro connecting to a slower peripheral bus and possibly DRAM.
25+
# Avoid using set_input/output_delay here.
26+
# Register-to-register paths are checked at the mock-cpu level or from the mock-cpu
27+
# .lib file to an external register.
28+
# Timing closure is ensured at the SoC level where the mock-cpu is connected.
29+
# Instead, set strict optimization targets for inputs and outputs to ensure
30+
# constraints are not too loose.
31+
set non_clk_inputs {}
32+
set clock_ports [list [get_ports $clk1_name] [get_ports $clk2_name]]
33+
foreach input [all_inputs] {
34+
if {[lsearch -exact $clock_ports $input] == -1} {
35+
lappend non_clk_inputs $input
36+
}
37+
}
38+
39+
set_max_delay 80 -from $non_clk_inputs -to [all_outputs]
40+
group_path -name in2out -from $non_clk_inputs -to [all_outputs]
41+
42+
set all_register_outputs [get_pins -of_objects [all_registers] -filter {direction == output}]
43+
set_max_delay 80 -from $non_clk_inputs -to [all_registers]
44+
set_max_delay 80 -from $all_register_outputs -to [all_outputs]
45+
group_path -name in2reg -from $non_clk_inputs -to [all_registers]
46+
group_path -name reg2out -from [all_registers] -to [all_outputs]
47+
group_path -name reg2reg -from [all_registers] -to [all_registers]
3348

3449
## Dual clock fifo timing constraints
3550
# Using fastest clock as constaint

0 commit comments

Comments
 (0)