From: Miodrag Milanovic Date: Thu, 9 Jun 2022 06:57:48 +0000 (+0200) Subject: verific: Added "-vlog-libext" option to specify search extension for libraries X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6e8e4b4550c27c6c2f2e6d17877e5b8613f04317;p=yosys.git verific: Added "-vlog-libext" option to specify search extension for libraries --- diff --git a/CHANGELOG b/CHANGELOG index c26f389fc..bb96fb3c6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -30,6 +30,7 @@ Yosys 0.17 .. Yosys 0.17-dev * Verific support - Proper file location for readmem commands + - Added "-vlog-libext" option to specify search extension for libraries Yosys 0.16 .. Yosys 0.17 -------------------------- diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index a9adb5a17..6351483db 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -86,7 +86,7 @@ bool verific_import_pending; string verific_error_msg; int verific_sva_fsm_limit; -vector verific_incdirs, verific_libdirs; +vector verific_incdirs, verific_libdirs, verific_libexts; void msg_func(msg_type_t msg_type, const char *message_id, linefile_type linefile, const char *msg, va_list args) { @@ -2323,6 +2323,7 @@ void verific_import(Design *design, const std::map &par LineFile::DeleteAllLineFiles(); verific_incdirs.clear(); verific_libdirs.clear(); + verific_libexts.clear(); verific_import_pending = false; if (!verific_error_msg.empty()) @@ -2433,6 +2434,11 @@ struct VerificPass : public Pass { log("find undefined modules.\n"); log("\n"); log("\n"); + log(" verific -vlog-libext ..\n"); + log("\n"); + log("Add Verilog library extensions, used when searching in library directories.\n"); + log("\n"); + log("\n"); log(" verific -vlog-define [=]..\n"); log("\n"); log("Add Verilog defines.\n"); @@ -2716,6 +2722,12 @@ struct VerificPass : public Pass { goto check_error; } + if (GetSize(args) > argidx && args[argidx] == "-vlog-libext") { + for (argidx++; argidx < GetSize(args); argidx++) + verific_libexts.push_back(args[argidx]); + goto check_error; + } + if (GetSize(args) > argidx && args[argidx] == "-vlog-define") { for (argidx++; argidx < GetSize(args); argidx++) { string name = args[argidx]; @@ -2856,6 +2868,8 @@ struct VerificPass : public Pass { veri_file::AddIncludeDir(dir.c_str()); for (auto &dir : verific_libdirs) veri_file::AddYDir(dir.c_str()); + for (auto &ext : verific_libexts) + veri_file::AddLibExt(ext.c_str()); while (argidx < GetSize(args)) file_names.Insert(args[argidx++].c_str()); @@ -3345,6 +3359,7 @@ struct VerificPass : public Pass { LineFile::DeleteAllLineFiles(); verific_incdirs.clear(); verific_libdirs.clear(); + verific_libexts.clear(); verific_import_pending = false; goto check_error; }