Skip to content

Commit f61d7a1

Browse files
authored
Merge pull request #2462 from Pinata-Consulting/mock-cpu-constraints-sdc-update
Mock cpu constraints sdc update
2 parents fb11381 + 3e62cfb commit f61d7a1

File tree

3 files changed

+257
-224
lines changed

3 files changed

+257
-224
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)