Skip to content

Commit 51cb48d

Browse files
committed
mock-array: clean up Element constraints.sdc file
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 136f929 commit 51cb48d

File tree

6 files changed

+290
-386
lines changed

6 files changed

+290
-386
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export DESIGN_NAME = Element
44
export DESIGN_NICKNAME = mock-array_Element
55

66
export VERILOG_FILES = designs/src/mock-array/*.v
7-
export SDC_FILE = designs/asap7/mock-array/Element/constraints.sdc
7+
export SDC_FILE = designs/asap7/mock-array/constraints.sdc
88

99
export PLATFORM = asap7
1010

flow/designs/asap7/mock-array/Element/constraints.sdc

Lines changed: 0 additions & 77 deletions
This file was deleted.

flow/designs/asap7/mock-array/README.md

Lines changed: 60 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -36,86 +36,63 @@ Now build the design as usual:
3636
make
3737
```
3838

39-
Element/constraint.sdc
40-
----------------------
41-
42-
A relatively simple constraint.sdc is adequate for the Element as
43-
timing is exported when the Element macro is made and checked at the
44-
mock-array level.
45-
46-
Note that a failure on timing at the Element level is
47-
not a problem, as long as timing is met at the mock-array level.
48-
49-
The purpose of the constraint.sdc file at the Element level is to
50-
be able to iterate on the Element during development and work on,
51-
for instance, maximum operating frequency changes in the Verilog,
52-
but also to give the tools some guidance on how to optimize the
53-
macro.
54-
55-
Optimizing Element/constraint.sdc
56-
---------------------------------
57-
58-
Before considering the various strategies to articulate an Element/constraint.sdc
59-
file below, note that no tests have been run to verify that these
60-
different constraint.sdc changes below have any effects on the quality
61-
of results at the mock-array level. If there are no substantial
62-
differences in quality of results and timing is met, then the differences
63-
between the strategies below are inconsequential.
64-
65-
A single macro is made for all the elements in the array, though strictly
66-
speaking each macro is unique in that the timing constraints of each element
67-
in the array is different.
68-
69-
To illustrate, consider the `assign io_lsbOuts_0 = io_lsbIns_1;` statement in Element.v.
70-
Here a signal is routed from left to right, through the Element without the signal
71-
being registered.
72-
73-
Clearly, the maximum input delay for `io_lsbIns_1` is
74-
smaller for the leftmost than for the rightmost Element.
75-
76-
Taking a step back, it is also worth considering what level of detail is
77-
appropriate for the Element's constraint.sdc file.
78-
79-
In the beginning of a project, during exploration, the .sdc file does not
80-
need to be particularly detailed. In fact, details can be counterproductive,
81-
as they tend to be inaccurate and cause the tools to spend time solving potential non-issues.
82-
83-
Consider minimum input delay, which relates to hold times. If the main concern
84-
of architectural exploration is to ensure that the design can operate on a
85-
sufficiently high frequency, then specifying minimum input delays during
86-
exploration is premature. Minimum input delay is a constraint that belongs at
87-
the end the development cycle when the design is well established and won't change
88-
and the concern is to lock down the macro for its specific operating frequency.
89-
90-
Choosing a strategy for Element/constraint.sdc combinational paths
91-
------------------------------------------------------------------
92-
93-
It isn't possible to articulate a single .sdc file that exactly captures the
94-
constraints of an Element as each element is used in unique circumstances.
95-
Instead, a choice has to made and each choice has its pros and cons.
96-
97-
It is relatively easy to set up a maximum input/output delay for paths
98-
that start or end in a register, so this case is not discussed here.
99-
100-
It is the combinational(unregistered) in -> out
101-
paths that are tricky to create constraints for.
102-
103-
- Strategy used as of writing: mark non-registered/combinational paths through
104-
the Element as false paths. This will not steer the tools to optimize the
105-
through element path, such as discussed above and there's no timing information
106-
available at the Element level for these combinational paths.
107-
However, at the `MockArray` level when the Elements are used, timing will
108-
be checked, because the .lib file generated for the Element contains timing
109-
information, even for false paths.
110-
- Use `set_max_delay` for combinational paths. This will make the tool try
111-
to optimize the combinational path and there will be timing information available.
112-
However, path segmentation could occur with OpenSTA. Refer [here](https://docs.xilinx.com/r/2020.2-English/ug906-vivado-design-analysis/TIMING-13-Timing-Paths-Ignored-Due-to-Path-Segmentation).
113-
- Overconstrain: set up a maximum input/output path for the element and ignore
114-
timing violations at the Element level for combinational paths.
115-
The timing violations for the combinational paths are not real violations,
116-
because the maximum input and output paths can not occur at the same time
117-
in the array. The leftmost Element has the shortest maximum input path and
118-
and the rightmost the longest maximum input path for
119-
`assign io_lsbOuts_0 = io_lsbIns_1;`. The OpenROAD tool could put too much
120-
emphasis on optimising the combinational path in this case, which could
121-
lead to less than optimal results and/or inflated run times.
39+
CTS
40+
---
41+
42+
mock-array and mock-array Element are intended
43+
to be fitted into a higher level module where CTS creates a balanced clock tree
44+
that takes the mock-array and mock-array Element clock insertion
45+
latency into account. This means that the optimization target
46+
for mock-array and mock-array Element have zero skew.
47+
48+
constraint.sdc shared between mock-array and mock-array/Element
49+
---------------------------------------------------------------
50+
51+
From the following observations, all else follows: the only thing
52+
that can fail timing closure, is a register to register path. All
53+
other constraints give the flow an optimization target. Failure
54+
to meet the timing constraint of an optimization target constraint
55+
is not a timing closure failure.
56+
57+
Note that ORFS regression checks does not have the ability to distinguish
58+
between timing closure failures(register to register paths) and
59+
optimization constraints violations. Timing violations for optimization constraints
60+
in mock-array Element, such as maximum transit time for a combinational path
61+
through mock-array Element, may or may not cause timing
62+
violations later on higher up in mock-array on register to register paths.
63+
64+
For the Element constraint.sdc, the only register to register path
65+
are within the Element and no lower level macros are
66+
involved. Register to register paths within Element have to be checked
67+
at the Element level as they are invisible higher up in mock-array.
68+
69+
As for the remaining optimization constraints for Element, they
70+
should be for combinational through paths and from input pins to register and
71+
from register to output pins.
72+
73+
The constraints.sdc file is designed such that the clock latency & tree
74+
can be ignored as far constraints go;
75+
it is not part of the optimization constraints. The clock tree latency
76+
is accounted for in register to register paths within.
77+
78+
The timing closure for the register to register paths between
79+
Element macros is checked at the mock-array level.
80+
81+
With this in mind, the constraints.sdc file for the Element becomes
82+
quite general and simple. set_max_delay is used exclusively for
83+
optimization constraints and the clock period is used to check timing
84+
closure for register to register paths.
85+
86+
set_input/output_delay are not used and can't really be used
87+
with the requirement that the constraint.sdc file should be articulated
88+
without making assumptions on the clock tree insertion latency. The time specified
89+
for set_input/output_delay is relative to the clock insertion point, i.e.
90+
the time at the clock pin for the macro, which makes it impossible to articulate
91+
the number that is passed in to set_input/output_delay without taking
92+
clock network insertion latency into account.
93+
94+
Since set_input_delay is not used and set_max_delay is used instead, then
95+
no hold cells are inserted, which is what is desired here.
96+
97+
Beware of [path segmentation](https://docs.xilinx.com/r/2020.2-English/ug906-vivado-design-analysis/TIMING-13-Timing-Paths-Ignored-Due-to-Path-Segmentation), which
98+
can occur with OpenSTA.
Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1+
# see README.md
12
set sdc_version 2.0
23

4+
set clk_name clock
5+
set clk_port_name clock
36
set clk_period 250
47

5-
set clk_name clock
6-
set clk_port_name clock
7-
set clk_in_pct 0.2
8-
set clk_o1_pct 0.2
9-
set clk_o2_pct 0.2 ;# relax to see paths thru all Elements
8+
set clk_port [get_ports $clk_port_name]
9+
create_clock -period $clk_period -waveform [list 0 [expr $clk_period / 2]] -name $clk_name $clk_port
10+
set_clock_uncertainty -setup 20.0 [get_clocks $clk_name]
11+
set_clock_uncertainty -hold 20.0 [get_clocks $clk_name]
1012

11-
create_clock -name $clk_name -period $clk_period -waveform [list 0 [expr $clk_period/2]] [get_ports $clk_port_name]
12-
set_clock_uncertainty 10 [get_clocks $clk_name]
13+
set_max_transition 250 [current_design]
14+
set_max_transition 100 -clock_path [all_clocks]
1315

14-
create_clock -name ${clk_name}_vir -period $clk_period -waveform [list 0 [expr $clk_period/2]]
15-
set_clock_uncertainty 10 [get_clocks ${clk_name}_vir]
16-
set_clock_latency 380 [get_clocks ${clk_name}_vir] ;# Matching real clock latency
16+
set non_clk_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]
17+
set all_register_outputs [get_pins -of_objects [all_registers] -filter {direction == output}]
1718

18-
set clk_port [get_ports $clk_port_name]
19-
set non_clock_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]
20-
set non_reg_outputs [lsearch -inline -all -not -exact [all_outputs] [get_ports io_lsbs_*]]
19+
# Optimization targets
20+
set max_delay 80
21+
set_max_delay $max_delay -from $non_clk_inputs -to [all_registers]
22+
set_max_delay $max_delay -from $all_register_outputs -to [all_outputs]
23+
set_max_delay $max_delay -from $non_clk_inputs -to [all_outputs]
2124

22-
set_input_delay [expr $clk_period * $clk_in_pct] -clock ${clk_name}_vir $non_clock_inputs
23-
set_output_delay [expr $clk_period * $clk_o1_pct] -clock ${clk_name}_vir $non_reg_outputs
24-
set_output_delay [expr $clk_period * $clk_o2_pct] -clock ${clk_name}_vir [get_ports io_lsbs_*]
25+
# Set driving cell and load capacitance explicitly to ensure timing results are sufficiently pessimistic
26+
set_driving_cell [all_inputs] -lib_cell BUFx4_ASAP7_75t_R
2527

26-
set_max_transition 300 [current_design]
27-
set_max_transition 100 -clock_path [all_clocks]
28+
# Assuming the load on each output is a BUFx2_ASAP7_75t_R, we pessimistically use 3 times the highest input
29+
# pin capacitance for this cell, which is 0.577042.
30+
# See platforms/asap7/lib/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz, line 1223.
31+
#set_load -pin_load 2.731126 [all_outputs]
32+
set_load -pin_load 10 [all_outputs]

0 commit comments

Comments
 (0)