verific: Added "-vlog-libext" option to specify search extension for libraries
authorMiodrag Milanovic <mmicko@gmail.com>
Thu, 9 Jun 2022 06:57:48 +0000 (08:57 +0200)
committerMiodrag Milanovic <mmicko@gmail.com>
Thu, 9 Jun 2022 06:57:48 +0000 (08:57 +0200)
CHANGELOG
frontends/verific/verific.cc

index c26f389fc54a0d4876989a35ddef019231f6d518..bb96fb3c65c8f87f870d4d04d71cc3d7696bf85b 100644 (file)
--- 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
 --------------------------
index a9adb5a17fe0b87833dcf941fc733f3c74b9ffd6..6351483dbdcadc7aa5f340418b84b0a02adc18ae 100644 (file)
@@ -86,7 +86,7 @@ bool verific_import_pending;
 string verific_error_msg;
 int verific_sva_fsm_limit;
 
-vector<string> verific_incdirs, verific_libdirs;
+vector<string> 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<std::string,std::string> &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 <extension>..\n");
+               log("\n");
+               log("Add Verilog library extensions, used when searching in library directories.\n");
+               log("\n");
+               log("\n");
                log("    verific -vlog-define <macro>[=<value>]..\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;
                }