From 94a215b4f7c9b57b0530231b3628fecf1285a386 Mon Sep 17 00:00:00 2001 From: nella Date: Mon, 20 Apr 2026 20:25:37 +0200 Subject: [PATCH] Add dont_use_cells to scl cache. --- passes/techmap/abc.cc | 2 +- passes/techmap/abc9_exe.cc | 2 +- passes/techmap/liberty_cache.h | 25 ++++++++++++++++++------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index af8d02c5c..9be02cacd 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -1027,7 +1027,7 @@ void AbcModuleState::prepare_module(RTLIL::Design *design, RTLIL::Module *module run_abc.dont_use_args += stringf("-X \"%s\" ", dont_use_cell); } - std::string merged_scl = convert_liberty_files_to_merged_scl(config.liberty_files, config.exe_file); + std::string merged_scl = convert_liberty_files_to_merged_scl(config.liberty_files, run_abc.dont_use_args, config.exe_file); if (!merged_scl.empty()) { run_abc.abc_script += stringf("read_scl \"%s\" ; ", merged_scl.c_str()); } else { diff --git a/passes/techmap/abc9_exe.cc b/passes/techmap/abc9_exe.cc index 29d7ec309..a67807909 100644 --- a/passes/techmap/abc9_exe.cc +++ b/passes/techmap/abc9_exe.cc @@ -183,7 +183,7 @@ void abc9_module(RTLIL::Design *design, std::string script_file, std::string exe dont_use_args += stringf("-X \"%s\" ", dont_use_cell); } - std::string merged_scl = convert_liberty_files_to_merged_scl(liberty_files, exe_file); + std::string merged_scl = convert_liberty_files_to_merged_scl(liberty_files, dont_use_args, exe_file); if (!merged_scl.empty()) { abc9_script += stringf("read_scl \"%s\" ; ", merged_scl.c_str()); } else { diff --git a/passes/techmap/liberty_cache.h b/passes/techmap/liberty_cache.h index 9cf4259eb..391aa6344 100644 --- a/passes/techmap/liberty_cache.h +++ b/passes/techmap/liberty_cache.h @@ -11,17 +11,18 @@ YOSYS_NAMESPACE_BEGIN /* * convert_liberty_files_to_merged_scl() - Convert multiple Liberty files to a single merged SCL cache file. - * @liberty_files - Vector of liberty file paths to merge - * @abc_exe - Path to ABC executable for conversion + * @liberty_files: Vector of liberty file paths to merge + * @dont_use_args: Pre-built ABC -X flags string + * @abc_exe: Path to ABC executable for conversion * * Return: Path to merged SCL cache file, or empty string if conversion fails */ -inline std::string convert_liberty_files_to_merged_scl(const std::vector &liberty_files, const std::string &abc_exe) +inline std::string convert_liberty_files_to_merged_scl(const std::vector &liberty_files, const std::string &dont_use_args, const std::string &abc_exe) { if (liberty_files.empty()) return ""; - // Sort filenames to ensure consistent hash regardless of order + // Sort to ensure consistent hash regardless of order std::vector sorted_files = liberty_files; std::sort(sorted_files.begin(), sorted_files.end()); std::string hash_input; @@ -38,6 +39,8 @@ inline std::string convert_liberty_files_to_merged_scl(const std::vector&1", abc_exe.c_str(), abc_script.c_str()); std::string abc_output; int ret = run_command(cmd, [&abc_output](const std::string &line) { abc_output += line + "\n"; }); @@ -84,6 +88,13 @@ inline std::string convert_liberty_files_to_merged_scl(const std::vector