Skip to content

Commit 92cf968

Browse files
jhkim-piiclaude
andcommitted
lec: fix cell filtering and update kepler-formal
- Enhance find_physical_only_masters to auto-detect cells with no signal pins and no liberty cell (e.g., CDMMTYPE2 marker cells) - Add REMOVE_CELLS_FOR_LEC support to write_lec_verilog in lec_check.tcl - Update kepler-formal to 093a7b5 (fix for missing bus direction) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
1 parent 5101376 commit 92cf968

3 files changed

Lines changed: 38 additions & 6 deletions

File tree

flow/scripts/lec_check.tcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
proc write_lec_verilog { filename } {
2+
set remove_cells [find_physical_only_masters]
23
if { [env_var_exists_and_non_empty REMOVE_CELLS_FOR_LEC] } {
3-
write_verilog -remove_cells $::env(REMOVE_CELLS_FOR_LEC) $::env(RESULTS_DIR)/$filename
4-
} else {
5-
write_verilog $::env(RESULTS_DIR)/$filename
4+
lappend remove_cells {*}$::env(REMOVE_CELLS_FOR_LEC)
65
}
6+
write_verilog -remove_cells $remove_cells $::env(RESULTS_DIR)/$filename
77
}
88

99
proc write_lec_script { step file1 file2 } {
@@ -25,7 +25,7 @@ proc run_lec_test { step file1 file2 } {
2525
# tclint-disable-next-line command-args
2626
eval exec $::env(KEPLER_FORMAL_EXE) --config $::env(OBJECTS_DIR)/${step}_lec_test.yml
2727
try {
28-
set count [exec grep -c "Found difference" $::env(LOG_DIR)/${step}_lec_check.log]]
28+
set count [exec grep -c "Found difference" $::env(LOG_DIR)/${step}_lec_check.log]
2929
} trap CHILDSTATUS {results options} {
3030
# This block executes if grep returns a non-zero exit code
3131
set count 0

flow/scripts/util.tcl

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,27 @@ proc is_physical_only_master { master } {
229229
return 0
230230
}
231231

232+
# Returns 1 if the master has no signal pins (only power/ground or none).
233+
proc has_signal_pins { master } {
234+
foreach mterm [$master getMTerms] {
235+
set sig_type [$mterm getSigType]
236+
if { $sig_type != "POWER" && $sig_type != "GROUND" } {
237+
return 1
238+
}
239+
}
240+
return 0
241+
}
242+
243+
# Returns 1 if the master has a corresponding liberty cell.
244+
proc has_liberty_cell { master } {
245+
set master_name [$master getName]
246+
set lib_cells [get_lib_cells -quiet */$master_name]
247+
if { $lib_cells == {} } {
248+
return 0
249+
}
250+
return 1
251+
}
252+
232253
# Finds all physical-only masters in the current database and
233254
# returns their names.
234255
proc find_physical_only_masters { } {
@@ -237,8 +258,19 @@ proc find_physical_only_masters { } {
237258
set physical_only_masters [list]
238259
foreach lib $libs {
239260
foreach master [$lib getMasters] {
261+
set master_name [$master getName]
240262
if { [is_physical_only_master $master] } {
241-
lappend physical_only_masters [$master getName]
263+
lappend physical_only_masters $master_name
264+
continue
265+
}
266+
267+
# Consider cells with no signal pins and no liberty cell as physical-only
268+
if { [has_liberty_cell $master] == 0 } {
269+
if { [has_signal_pins $master] == 0 } {
270+
lappend physical_only_masters $master_name
271+
} else {
272+
puts "Warning: master $master_name has signal pins but no liberty cell"
273+
}
242274
}
243275
}
244276
}

tools/kepler-formal

0 commit comments

Comments
 (0)