mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-13 13:45:28 +00:00
Merge pull request #5721 from tefantasy/abc-liberty-args
abc: new option to pass extra ABC read_lib args
This commit is contained in:
commit
db258e6dd9
1 changed files with 23 additions and 3 deletions
|
|
@ -131,6 +131,7 @@ struct AbcConfig
|
|||
std::vector<std::string> liberty_files;
|
||||
std::vector<std::string> genlib_files;
|
||||
std::string constr_file;
|
||||
std::string abc_liberty_args;
|
||||
vector<int> lut_costs;
|
||||
std::string delay_target;
|
||||
std::string sop_inputs;
|
||||
|
|
@ -1030,14 +1031,21 @@ 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, run_abc.dont_use_args, config.exe_file);
|
||||
std::string merged_scl;
|
||||
if (config.abc_liberty_args.empty()) {
|
||||
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 if(!config.liberty_files.empty()) {
|
||||
log_warning("ABC: Merged scl conversion failed, using liberty format\n");
|
||||
if (!config.abc_liberty_args.empty()) {
|
||||
log("ABC: abc_liberty_args provided, using liberty format\n");
|
||||
} else {
|
||||
log_warning("ABC: Merged scl conversion failed, using liberty format\n");
|
||||
}
|
||||
bool first_lib = true;
|
||||
for (std::string liberty_file : config.liberty_files) {
|
||||
run_abc.abc_script += stringf("read_lib %s %s -w \"%s\" ; ", run_abc.dont_use_args, first_lib ? "" : "-m", liberty_file);
|
||||
run_abc.abc_script += stringf("read_lib %s %s %s -w \"%s\" ; ", run_abc.dont_use_args, first_lib ? "" : "-m", config.abc_liberty_args, liberty_file);
|
||||
first_lib = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -2035,6 +2043,10 @@ struct AbcPass : public Pass {
|
|||
log(" preserve naming by an equivalence check between the original and\n");
|
||||
log(" post-ABC netlists (experimental).\n");
|
||||
log("\n");
|
||||
log(" -liberty_args <string>\n");
|
||||
log(" when -liberty is used, also pass the specified arguments to ABC\n");
|
||||
log(" command \"read_lib\". Example: -liberty_args \"-G 250\"\n");
|
||||
log("\n");
|
||||
log("When no target cell library is specified the Yosys standard cell library is\n");
|
||||
log("loaded into ABC before the ABC script is executed.\n");
|
||||
log("\n");
|
||||
|
|
@ -2217,6 +2229,14 @@ struct AbcPass : public Pass {
|
|||
config.markgroups = true;
|
||||
continue;
|
||||
}
|
||||
if (arg == "-liberty_args" && argidx+1 < args.size()) {
|
||||
config.abc_liberty_args = args[++argidx];
|
||||
if (!config.abc_liberty_args.empty()) {
|
||||
if (config.abc_liberty_args[0] == '\"' && config.abc_liberty_args.back() == '\"')
|
||||
config.abc_liberty_args = config.abc_liberty_args.substr(1, config.abc_liberty_args.size() - 2);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
extra_args(args, argidx, design);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue