Skip to content

Commit 44ad745

Browse files
authored
Merge pull request The-OpenROAD-Project#3480 from The-OpenROAD-Project-staging/secure-write-verilog-wo-physical-only
Do not write physical-only cells on the output verilog file in the final stage.
2 parents 33e29bf + 8f9084a commit 44ad745

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

flow/scripts/final_report.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ source $::env(SCRIPTS_DIR)/deleteRoutingObstructions.tcl
1515
deleteRoutingObstructions
1616

1717
write_def $::env(RESULTS_DIR)/6_final.def
18-
write_verilog $::env(RESULTS_DIR)/6_final.v
18+
write_verilog $::env(RESULTS_DIR)/6_final.v \
19+
-remove_cells [find_physical_only_masters]
1920

2021
# Run extraction and STA
2122
if {

flow/scripts/util.tcl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,39 @@ proc hier_options { } {
201201
return ""
202202
}
203203
}
204+
205+
proc is_physical_only_master { master } {
206+
set physical_only_type_patterns [list \
207+
"COVER" \
208+
"COVER_BUMP" \
209+
"RING" \
210+
"PAD_SPACER" \
211+
"CORE_FEEDTHROUGH" \
212+
"CORE_SPACER" \
213+
"CORE_ANTENNACELL" \
214+
"CORE_WELLTAP" \
215+
"ENDCAP*"]
216+
set master_type [$master getType]
217+
foreach pattern $physical_only_type_patterns {
218+
if { [string match $pattern $master_type] } {
219+
return 1
220+
}
221+
}
222+
return 0
223+
}
224+
225+
# Finds all physical-only masters in the current database and
226+
# returns their names.
227+
proc find_physical_only_masters { } {
228+
set db [::ord::get_db]
229+
set libs [$db getLibs]
230+
set physical_only_masters [list]
231+
foreach lib $libs {
232+
foreach master [$lib getMasters] {
233+
if { [is_physical_only_master $master] } {
234+
lappend physical_only_masters [$master getName]
235+
}
236+
}
237+
}
238+
return $physical_only_masters
239+
}

0 commit comments

Comments
 (0)