Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions flow/scripts/cts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ if { $::env(CTS_SNAPSHOTS) } {
}

if { !$::env(SKIP_CTS_REPAIR_TIMING) } {
if { $::env(LEC_CHECK) } {
set lec_enabled [lec_check_enabled]
if { $lec_enabled } {
write_lec_verilog 4_before_rsz_lec.v
}

repair_timing_helper

if { $::env(LEC_CHECK) } {
if { $lec_enabled } {
write_lec_verilog 4_after_rsz_lec.v
run_lec_test 4_rsz 4_before_rsz_lec.v 4_after_rsz_lec.v
}
Expand Down
8 changes: 8 additions & 0 deletions flow/scripts/lec_check.tcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
proc lec_check_enabled { } {
return [expr {
[env_var_equals LEC_CHECK 1]
&& [info exists ::env(KEPLER_FORMAL_EXE)]
&& [file executable $::env(KEPLER_FORMAL_EXE)]
}]
}
Comment on lines +1 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this helper correctly prevents a crash when KEPLER_FORMAL_EXE is missing (which is expected in make issue artifacts), it will silently skip LEC even if the user explicitly requested it via LEC_CHECK=1 in a normal environment. Adding a warning message when the executable is missing but the check is enabled would improve observability.

proc lec_check_enabled { } {
  if { ![env_var_equals LEC_CHECK 1] } {
    return 0
  }
  if { ![info exists ::env(KEPLER_FORMAL_EXE)] || ![file executable $::env(KEPLER_FORMAL_EXE)] } {
    puts "\[WARNING\] LEC_CHECK is enabled but KEPLER_FORMAL_EXE is not found or not executable. Skipping LEC."
    return 0
  }
  return 1
}


proc write_lec_verilog { filename } {
set remove_cells [find_physical_only_masters]
if { [env_var_exists_and_non_empty REMOVE_CELLS_FOR_LEC] } {
Expand Down
2 changes: 1 addition & 1 deletion flow/scripts/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export RESULTS_V = $(notdir $(sort $(wildcard $(RESULTS_DIR)/*.v)))
export GDS_MERGED_FILE = $(RESULTS_DIR)/6_1_merged.$(STREAM_SYSTEM_EXT)

define get_variables
$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD% OPENSTA% PYTHON% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ )))
$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD_EXE OPENROAD_ARGS OPENROAD_CMD OPENROAD_NO_EXIT_CMD OPENROAD_GUI_CMD OPENROAD_WEB_CMD OPENROAD_IS_VALID OPENSTA% PYTHON% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ )))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of excluded variables is becoming quite long and difficult to maintain. Consider refactoring this into a separate variable to improve readability and make it easier to add or remove patterns in the future.

endef

export UNSET_VARIABLES_NAMES := $(call get_variables,command% line environment% default automatic)
Expand Down