Add "read -incdir"
authorClifford Wolf <clifford@clifford.at>
Mon, 16 Jul 2018 13:32:26 +0000 (15:32 +0200)
committerClifford Wolf <clifford@clifford.at>
Mon, 16 Jul 2018 13:32:26 +0000 (15:32 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
frontends/verific/verific.cc

index 62a8028b862e9be501aff69cb934f1bffadfbed6..ab752b96d09937192a849335b29de499585aa657 100644 (file)
@@ -2186,6 +2186,11 @@ struct ReadPass : public Pass {
                log("\n");
                log("Unset global Verilog/SystemVerilog defines.\n");
                log("\n");
+               log("\n");
+               log("    read -incdir <directory>\n");
+               log("\n");
+               log("Add directory to global Verilog/SystemVerilog include directories.\n");
+               log("\n");
        }
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
        {
@@ -2263,6 +2268,20 @@ struct ReadPass : public Pass {
                        return;
                }
 
+               if (args[1] == "-incdir") {
+                       if (use_verific) {
+                               args[0] = "verific";
+                               args[1] = "-vlog-incdir";
+                               Pass::call(design, args);
+                       }
+                       args[0] = "verilog_defaults";
+                       args[1] = "-add";
+                       for (int i = 1; i < GetSize(args); i++)
+                               args[i] = "-I" + args[i];
+                       Pass::call(design, args);
+                       return;
+               }
+
                log_cmd_error("Missing or unsupported mode parameter.\n");
        }
 } ReadPass;