Skip to content

Commit b13008f

Browse files
committed
dft: keep OpenROAD ordering when constraints set
1 parent 10d2b72 commit b13008f

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

flow/scripts/dft_scan_pre_global_route.tcl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,15 @@ proc dft_scanopt_next_reorder {chain_cells_by_name {tag "pregrt"}} {
854854
return $chain_cells_by_name
855855
}
856856

857+
# scanopt_next is an external reorder step and does not currently interpret
858+
# OpenROAD's scan-order constraints (groups/paths/fixed_edge/before/etc).
859+
# If the user provided a constraints file, keep OpenROAD's ordering.
860+
set constraints_file [dft_get_env DFT_SCAN_ORDER_CONSTRAINTS_FILE ""]
861+
if { $constraints_file != "" } {
862+
puts "DFT: WARNING: DFT_SCAN_SOLVER=scanopt_next ignores DFT_SCAN_ORDER_CONSTRAINTS_FILE; using OpenROAD order"
863+
return $chain_cells_by_name
864+
}
865+
857866
set out_dir "/tmp"
858867
if { [info exists ::env(REPORTS_DIR)] && $::env(REPORTS_DIR) != "" } {
859868
set out_dir $::env(REPORTS_DIR)

flow/util/scan_chain_plot_openroad.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,25 @@ def _inst_xy(inst) -> Tuple[int, int]:
6969

7070

7171
def _bterm_xy(bterm) -> Tuple[int, int]:
72+
if hasattr(bterm, "getFirstPinLocation"):
73+
try:
74+
ok, x, y = bterm.getFirstPinLocation()
75+
if ok:
76+
return int(x), int(y)
77+
except Exception:
78+
pass
7279
return _bbox_center_xy(bterm.getBBox())
7380

7481

7582
def _iterm_xy(iterm) -> Tuple[int, int]:
76-
bbox = iterm.getBBox()
77-
return int(bbox.xMin()), int(bbox.yMin())
83+
if hasattr(iterm, "getAvgXY"):
84+
try:
85+
ok, x, y = iterm.getAvgXY()
86+
if ok:
87+
return int(x), int(y)
88+
except Exception:
89+
pass
90+
return _bbox_center_xy(iterm.getBBox())
7891

7992

8093
def _node_id(kind: str, name: str) -> str:

0 commit comments

Comments
 (0)