Skip to content

Commit 901e28c

Browse files
committed
dft: document constraints and max_imbalance
Expose -max_imbalance via DFT_MAX_IMBALANCE and document scan-order constraints file directives (groups/strict order/before/chain endpoints). Also update prerequisite OpenROAD pin commit hash.
1 parent ed94319 commit 901e28c

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

doc-DFT-howto.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ What you get:
1010

1111
## Prerequisites
1212

13-
- `tools/OpenROAD` is pinned to `PrecisEDAnon/OpenROAD` (`OpenROAD-clean-DFT`) at `2fadc72cd524c1eec3c5c5c7a1eeede739b0a805`.
13+
- `tools/OpenROAD` is pinned to `PrecisEDAnon/OpenROAD` (`OpenROAD-clean-DFT`) at `9d5965b568187743cdae7fd03b8889dfc79a0080`.
1414
- Build tools (if needed): `./build_openroad.sh --local`
1515
- ORFS defaults `OPENROAD_EXE` to `tools/install/OpenROAD/bin/openroad`.
1616

@@ -44,6 +44,7 @@ Pick one of these:
4444
- Exact chain count: `DFT_CHAIN_COUNT=<N>`
4545
- Cap bits per chain: `DFT_MAX_CHAIN_LENGTH=<bits>` (alias: `DFT_MAX_LENGTH`)
4646
- Cap chains (upper bound): `DFT_MAX_CHAINS=<N>`
47+
- Balance constraint (default 30%): `DFT_MAX_IMBALANCE=<percent>` (alias: `DFT_MAX_IMBALANCE_PERCENT`)
4748

4849
Examples:
4950

@@ -136,6 +137,33 @@ Format:
136137
- One chain per line: `chain_name inst0 inst1 inst2 ...`
137138
- Single-chain shorthand is allowed: `inst0 inst1 inst2 ...`
138139

140+
### 3h) OpenROAD scan-order constraints file (groups / ordering / chain endpoints)
141+
142+
This is separate from `DFT_SCAN_ORDER_FILE`. It *constrains* OpenROAD’s internal solver instead of specifying the entire solution.
143+
144+
- Enable: `DFT_SCAN_SOLVER=openroad DFT_SCAN_ORDER_CONSTRAINTS_FILE=/path/to/constraints.txt`
145+
146+
Supported directives (comments start with `#`; names refer to scan-flop instance names after `scan_replace`):
147+
148+
- Chain naming and optional endpoint coordinates (integer DBU):
149+
- `chain <name> [begin <x> <y>] [end <x> <y>]`
150+
- Equivalent forms: `chain_begin <name> <x> <y>` / `chain_end <name> <x> <y>`
151+
- Grouping (members must stay together in exactly one chain; groups can be hierarchical):
152+
- `group <name> [priority] <inst_or_group...>`
153+
- Strict order (no interpolation; creates fixed adjacency edges):
154+
- `path <name> [priority] <inst0 inst1 inst2 ...>`
155+
- Aliases: `strict_group` / `strict`
156+
- Fixed adjacency:
157+
- `fixed_edge <from_inst> <to_inst>`
158+
- Partial order (“before”):
159+
- `before <inst_or_group_a> <inst_or_group_b>`
160+
- Hard assignment of instances/groups to a named chain:
161+
- `assign <chain_name> <inst_or_group...>`
162+
163+
Notes:
164+
- Chain endpoint coordinates affect the ordering objective by adding begin→first and last→end costs for that chain.
165+
- The tool enforces polarity as a hard constraint using a “falling then rising” structure within each chain; constraints that force rising-before-falling within a chain are rejected.
166+
139167
## 4) Reuse Existing Scan Ports / Custom Naming
140168

141169
OpenROAD DFT endpoints are configured via name patterns:

flow/scripts/dft_scan_post_floorplan.tcl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ if { $max_length == "" } {
7373
set timing_hold_weight [dft_get_env DFT_TIMING_HOLD_WEIGHT ""]
7474
set timing_critical_slack [dft_get_env DFT_TIMING_CRITICAL_SLACK ""]
7575
set scan_order_constraints_file [dft_get_env DFT_SCAN_ORDER_CONSTRAINTS_FILE ""]
76+
set max_imbalance [dft_get_env DFT_MAX_IMBALANCE ""]
77+
if { $max_imbalance == "" } {
78+
set max_imbalance [dft_get_env DFT_MAX_IMBALANCE_PERCENT ""]
79+
}
7680

7781
set insert_lockup [dft_get_env DFT_INSERT_LOCKUP ""]
7882
set lockup_cell_rising [dft_get_env DFT_LOCKUP_CELL_RISING ""]
@@ -112,6 +116,9 @@ set dft_args [list \
112116
if { $vertical_weight != "" } {
113117
lappend dft_args -vertical_weight $vertical_weight
114118
}
119+
if { $max_imbalance != "" } {
120+
lappend dft_args -max_imbalance $max_imbalance
121+
}
115122
if { $timing_setup_weight != "" } {
116123
lappend dft_args -timing_setup_weight $timing_setup_weight
117124
}

flow/scripts/dft_scan_pre_global_route.tcl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,10 @@ proc dft_build_dft_config_args {{clock_mixing_override ""}} {
12071207
set scanopt_rounds [dft_get_env DFT_SCANOPT_ROUNDS ""]
12081208
set scanopt_seed [dft_get_env DFT_SCANOPT_SEED ""]
12091209
set vertical_weight [dft_get_env DFT_VERTICAL_WEIGHT ""]
1210+
set max_imbalance [dft_get_env DFT_MAX_IMBALANCE ""]
1211+
if { $max_imbalance == "" } {
1212+
set max_imbalance [dft_get_env DFT_MAX_IMBALANCE_PERCENT ""]
1213+
}
12101214
set timing_setup_weight [dft_get_env DFT_TIMING_SETUP_WEIGHT ""]
12111215
set timing_hold_weight [dft_get_env DFT_TIMING_HOLD_WEIGHT ""]
12121216
set timing_critical_slack [dft_get_env DFT_TIMING_CRITICAL_SLACK ""]
@@ -1247,6 +1251,9 @@ proc dft_build_dft_config_args {{clock_mixing_override ""}} {
12471251
if { $vertical_weight != "" } {
12481252
lappend dft_args -vertical_weight $vertical_weight
12491253
}
1254+
if { $max_imbalance != "" } {
1255+
lappend dft_args -max_imbalance $max_imbalance
1256+
}
12501257
if { $timing_setup_weight != "" } {
12511258
lappend dft_args -timing_setup_weight $timing_setup_weight
12521259
}

0 commit comments

Comments
 (0)