Skip to content

Commit 85d1b70

Browse files
authored
Merge pull request #986 from Pinata-Consulting/mock-array-timing
mock-array-big/Element: Proper timing constraints
2 parents 3a70fcf + 725b5f6 commit 85d1b70

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

flow/designs/asap7/mock-array-big/Element/config.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export DESIGN_NAME = Element
22
export DESIGN_NICKNAME = mock-array-big_Element
33

44
export VERILOG_FILES = designs/src/mock-array-big/*.v
5-
export SDC_FILE = designs/asap7/mock-array-big/constraints.sdc
5+
export SDC_FILE = designs/asap7/mock-array-big/Element/constraints.sdc
66

77
export PLATFORM = asap7
88

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
set sdc_version 2.0
2+
3+
set cols [expr {[info exists ::env(MOCK_ARRAY_WIDTH)] ? $::env(MOCK_ARRAY_WIDTH) : 8}]
4+
5+
set clk_name clock
6+
set clk_port_name clock
7+
set clk_period 8000
8+
9+
set clk_port [get_ports $clk_port_name]
10+
create_clock -period $clk_period -waveform [list 0 [expr $clk_period / 2]] -name $clk_name $clk_port
11+
12+
# io_ins_x -> REG_x
13+
set_input_delay -clock $clk_name -min [expr $clk_period / 2] [get_ports {io_ins_*}]
14+
set_input_delay -clock $clk_name -max [expr $clk_period / 2] [get_ports {io_ins_*}]
15+
16+
# REG_x -> io_outs_x
17+
set_output_delay -clock $clk_name -min [expr $clk_period / 2] [get_ports {io_outs_*}]
18+
set_output_delay -clock $clk_name -max [expr $clk_period / 2] [get_ports {io_outs_*}]
19+
20+
# For combinational buses routed through the elements, IO delays need to be set to accomodate requirements
21+
# for each instance's position across the entire array. For simplicity, we budget the clock period evenly
22+
# between all elements (with some headroom).
23+
set budget_per_element [expr $clk_period / $cols]
24+
set headroom [expr $budget_per_element * .2]
25+
# For in -> reg and reg -> out paths, min delay captures the case where a signal hasn't flowed through any
26+
# other element before this one
27+
set min_delay $headroom
28+
# For in -> reg and reg -> out paths, max delay captures the case where a signal has flowed through all
29+
# other elements before this one
30+
set max_delay [expr $budget_per_element * ($cols - 1) + $headroom]
31+
32+
# REG[0] (io_outs_left[0] in the source) -> io_lsbOuts_7
33+
set_output_delay -clock $clk_name -min $min_delay [get_ports {io_lsbOuts_7}]
34+
set_output_delay -clock $clk_name -max $max_delay [get_ports {io_lsbOuts_7}]
35+
36+
# All remaining non-clock IOs are only connected to one another without going through any
37+
# registers (in -> out paths). Such paths should not be checked for setup/hold violations
38+
# and do not need to be constrained.
39+
set non_clk_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]
40+
set_false_path -from $non_clk_inputs -to [all_outputs]

0 commit comments

Comments
 (0)