Skip to content

Commit 33a8cb6

Browse files
committed
Merge precisedanon/ORFS-toggle-rebased
2 parents c5388e7 + 67cd87d commit 33a8cb6

File tree

6 files changed

+123
-7
lines changed

6 files changed

+123
-7
lines changed

flow/scripts/global_place.tcl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,20 @@ append_env_var global_placement_args GPL_ROUTABILITY_DRIVEN -routability_driven
2828
# Parameters for timing driven mode in global placement
2929
if { $::env(GPL_TIMING_DRIVEN) } {
3030
lappend global_placement_args {-timing_driven}
31-
if { [info exists ::env(GPL_KEEP_OVERFLOW)] } {
32-
lappend global_placement_args -keep_resize_below_overflow $::env(GPL_KEEP_OVERFLOW)
31+
if { [env_var_truthy ORFS_ENABLE_NEW_OPENROAD] } {
32+
set gpl_keep_overflow ""
33+
if { [env_var_exists_and_non_empty GPL_KEEP_OVERFLOW] } {
34+
set gpl_keep_overflow $::env(GPL_KEEP_OVERFLOW)
35+
} elseif { [info exists ::env(PLATFORM)] && $::env(PLATFORM) eq "nangate45" } {
36+
set gpl_keep_overflow 1.0
37+
}
38+
if { $gpl_keep_overflow ne "" } {
39+
lappend global_placement_args -keep_resize_below_overflow $gpl_keep_overflow
40+
}
41+
} else {
42+
if { [info exists ::env(GPL_KEEP_OVERFLOW)] } {
43+
lappend global_placement_args -keep_resize_below_overflow $::env(GPL_KEEP_OVERFLOW)
44+
}
3345
}
3446
}
3547

flow/scripts/global_route.tcl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,26 @@ proc global_route_helper { } {
1212
append_env_var res_aware ENABLE_RESISTANCE_AWARE -resistance_aware 0
1313

1414
proc do_global_route { res_aware } {
15+
set default_route_args {-congestion_iterations 30 \
16+
-congestion_report_iter_step 5 -verbose}
17+
set route_args {}
18+
19+
if { [env_var_truthy ORFS_ENABLE_NEW_OPENROAD] } {
20+
set route_args $default_route_args
21+
if { [env_var_exists_and_non_empty GLOBAL_ROUTE_ARGS] } {
22+
set route_args [concat $route_args $::env(GLOBAL_ROUTE_ARGS)]
23+
}
24+
} else {
25+
if { [env_var_exists_and_non_empty GLOBAL_ROUTE_ARGS] } {
26+
set route_args $::env(GLOBAL_ROUTE_ARGS)
27+
} else {
28+
set route_args $default_route_args
29+
}
30+
}
31+
1532
set all_args [concat [list \
1633
-congestion_report_file $::global_route_congestion_report] \
17-
$::env(GLOBAL_ROUTE_ARGS) {*}$res_aware]
34+
$route_args {*}$res_aware]
1835

1936
log_cmd global_route {*}$all_args
2037
}

flow/scripts/load.tcl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ proc load_design { design_file sdc_file } {
3434
# Read SDC file
3535
read_sdc $::env(RESULTS_DIR)/$sdc_file
3636

37+
if { [env_var_truthy ORFS_ENABLE_NEW_OPENROAD]
38+
&& [info exists ::env(PLATFORM)]
39+
&& $::env(PLATFORM) eq "nangate45" } {
40+
if { ![info exists ::env(NG45_USE_DETAILED_PARA)]
41+
|| [string trim $::env(NG45_USE_DETAILED_PARA)] eq "" } {
42+
# Keep post-route timing consistent with the Nangate45 Oct toolchain by
43+
# defaulting to global-route parasitics unless explicitly overridden.
44+
set ::env(NG45_USE_DETAILED_PARA) 0
45+
}
46+
if { [env_var_truthy DISABLE_NG45_DEAD_LOGIC_REMOVAL]
47+
&& [llength [info commands rsz::set_eliminate_dead_logic_enabled]] } {
48+
puts "INFO: Disabling Nangate45 dead-logic elimination."
49+
rsz::set_eliminate_dead_logic_enabled 0
50+
}
51+
}
52+
3753
if { [file exists $::env(PLATFORM_DIR)/derate.tcl] } {
3854
log_cmd source $::env(PLATFORM_DIR)/derate.tcl
3955
}

flow/scripts/util.tcl

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@ proc log_cmd { cmd args } {
1515

1616
proc repair_timing_helper { args } {
1717
set additional_args {}
18-
append_env_var additional_args SETUP_SLACK_MARGIN -setup_margin 1
18+
if { [lsearch -exact $args "-setup_margin"] == -1 } {
19+
if { [env_var_exists_and_non_empty SETUP_SLACK_MARGIN] } {
20+
lappend additional_args -setup_margin $::env(SETUP_SLACK_MARGIN)
21+
} else {
22+
if { [env_var_truthy ORFS_ENABLE_NEW_OPENROAD] } {
23+
lappend additional_args -setup_margin 0.02
24+
} else {
25+
lappend additional_args -setup_margin 0
26+
}
27+
}
28+
}
1929
append_env_var additional_args HOLD_SLACK_MARGIN -hold_margin 1
2030
append_env_var additional_args SETUP_MOVE_SEQUENCE -sequence 1
2131
append_env_var additional_args TNS_END_PERCENT -repair_tns 1
@@ -107,6 +117,16 @@ proc env_var_exists_and_non_empty { env_var } {
107117
return [expr { [info exists ::env($env_var)] && ![string equal $::env($env_var) ""] }]
108118
}
109119

120+
proc env_var_truthy { env_var } {
121+
if { [env_var_exists_and_non_empty $env_var] } {
122+
set value [string tolower [string trim $::env($env_var)]]
123+
if { [lsearch -exact {1 true yes on} $value] != -1 } {
124+
return 1
125+
}
126+
}
127+
return 0
128+
}
129+
110130
proc append_env_var { list_name var_name prefix has_arg } {
111131
upvar $list_name list
112132
if {

flow/scripts/variables.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ include $(PLATFORM_DIR)/config.mk
4343
# is no way to escape space in defaults.py and get "foreach" to work.
4444
$(foreach line,$(shell $(PYTHON_EXE) $(SCRIPTS_DIR)/defaults.py),$(eval export $(subst __SPACE__, ,$(line))))
4545

46+
# Keep hierarchy for large modules when hierarchical synthesis is enabled.
47+
ifeq ($(strip $(SYNTH_HIERARCHICAL)),1)
48+
ifneq (,$(filter 1 true yes on,$(strip $(ORFS_ENABLE_NEW_OPENROAD))))
49+
export MAX_UNGROUP_SIZE ?= 50000
50+
endif
51+
endif
52+
4653
#-------------------------------------------------------------------------------
4754
# DFT / Scan integration (first-class toggle).
4855
#

flow/scripts/variables.yaml

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ GENERATE_ARTIFACTS_ON_FAILURE:
2222
lot of memory, this allows inspecting results on a laptop for a build that
2323
ran on a server.
2424
default: 0
25+
ORFS_ENABLE_NEW_OPENROAD:
26+
description: >
27+
When set (1/true/yes/on), enables the experimental OpenROAD/flow behavior
28+
on this branch. When unset/0 (default), the flow aims to match vanilla ORFS
29+
(93c42b2) + vanilla OpenROAD (7bc521) behavior.
30+
stages:
31+
- synth
32+
- floorplan
33+
- place
34+
- cts
35+
- grt
36+
- route
37+
- final
38+
default: 0
2539
TNS_END_PERCENT:
2640
description: >
2741
Default TNS_END_PERCENT value for post CTS timing repair. Try fixing all
@@ -367,6 +381,14 @@ SYNTH_MINIMUM_KEEP_SIZE:
367381
stages:
368382
- synth
369383
default: 0
384+
MAX_UNGROUP_SIZE:
385+
description: >
386+
Area threshold, expressed in NAND2 gate equivalents, used to preserve
387+
modules during hierarchical synthesis. When set, this value also seeds
388+
SYNTH_MINIMUM_KEEP_SIZE so large blocks are not unintentionally flattened.
389+
stages:
390+
- synth
391+
default: ""
370392
SYNTH_WRAPPED_OPERATORS:
371393
description: >
372394
Synthesize multiple architectural options for each arithmetic operator in the
@@ -656,7 +678,7 @@ SETUP_SLACK_MARGIN:
656678
- cts
657679
- floorplan
658680
- grt
659-
default: 0
681+
default: ""
660682
SETUP_REPAIR_SEQUENCE:
661683
description: |
662684
Specifies the sequence of moves to do in repair_timing -setup. This should be a string
@@ -1440,10 +1462,21 @@ PRE_GLOBAL_ROUTE_TCL:
14401462
- grt
14411463
GLOBAL_ROUTE_ARGS:
14421464
description: >
1443-
Replaces default arguments for global route.
1465+
Extra arguments appended to the default FastRoute invocation.
1466+
Defaults include -congestion_iterations 30 -congestion_report_iter_step 5 -verbose.
14441467
stages:
14451468
- grt
1446-
default: -congestion_iterations 30 -congestion_report_iter_step 5 -verbose
1469+
default: ""
1470+
DISABLE_NG45_DEAD_LOGIC_REMOVAL:
1471+
description: >
1472+
Set to 1 to turn off resizer's dead-logic elimination on Nangate45 flows.
1473+
The default keeps the cleanup enabled while still allowing opt-out for
1474+
debugging sensitivity to the pass.
1475+
stages:
1476+
- floorplan
1477+
- place
1478+
- cts
1479+
default: 0
14471480
MATCH_CELL_FOOTPRINT:
14481481
description: >
14491482
Enforce sizing operations to only swap cells that have the same layout
@@ -1454,6 +1487,17 @@ MATCH_CELL_FOOTPRINT:
14541487
- cts
14551488
- route
14561489
default: 0
1490+
NG45_USE_DETAILED_PARA:
1491+
description: >
1492+
Controls which parasitics source resizer should use post-route on
1493+
Nangate45 designs. The default of 0 keeps the global-route RC model so the
1494+
timing view aligns with the October toolchain; set to 1 to keep the newer
1495+
detailed-routing parasitics.
1496+
stages:
1497+
- place
1498+
- cts
1499+
- grt
1500+
- route
14571501
RTLMP_MAX_LEVEL:
14581502
description: >
14591503
Maximum depth of the physical hierarchy tree.

0 commit comments

Comments
 (0)