diff options
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | frontends/verific/verific.cc | 48 |
2 files changed, 52 insertions, 1 deletions
@@ -18,6 +18,7 @@ ENABLE_READLINE := 1 ENABLE_EDITLINE := 0 ENABLE_GHDL := 0 ENABLE_VERIFIC := 0 +ENABLE_VERIFIC_EDIF := 0 DISABLE_VERIFIC_EXTENSIONS := 0 DISABLE_VERIFIC_VHDL := 0 ENABLE_COVER := 1 @@ -527,6 +528,10 @@ ifneq ($(wildcard $(VERIFIC_DIR)/vhdl),) VERIFIC_COMPONENTS += vhdl endif endif +ifeq ($(ENABLE_VERIFIC_EDIF),1) +VERIFIC_COMPONENTS += edif +CXXFLAGS += -DVERIFIC_EDIF_SUPPORT +endif ifneq ($(DISABLE_VERIFIC_EXTENSIONS),1) VERIFIC_COMPONENTS += extensions CXXFLAGS += -DYOSYSHQ_VERIFIC_EXTENSIONS diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index b6f48a9de..820ac042c 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -53,6 +53,10 @@ USING_YOSYS_NAMESPACE #include "VhdlUnits.h" #endif +#ifdef VERIFIC_EDIF_SUPPORT +#include "edif_file.h" +#endif + #include "VerificStream.h" #include "FileSystem.h" @@ -2352,6 +2356,9 @@ void verific_import(Design *design, const std::map<std::string,std::string> &par #ifdef VERIFIC_VHDL_SUPPORT vhdl_file::Reset(); #endif +#ifdef VERIFIC_EDIF_SUPPORT + edif_file::Reset(); +#endif Libset::Reset(); Message::Reset(); RuntimeFlags::DeleteAllFlags(); @@ -2413,6 +2420,13 @@ struct VerificPass : public Pass { log("\n"); log("\n"); #endif +#ifdef VERIFIC_EDIF_SUPPORT + log(" verific {-edif} <edif-file>..\n"); + log("\n"); + log("Load the specified EDIF files into Verific.\n"); + log("\n"); + log("\n"); +#endif log(" verific {-f|-F} [-vlog95|-vlog2k|-sv2005|-sv2009|\n"); log(" -sv2012|-sv|-formal] <command-file>\n"); log("\n"); @@ -2958,7 +2972,18 @@ struct VerificPass : public Pass { goto check_error; } #endif - +#ifdef VERIFIC_EDIF_SUPPORT + if (GetSize(args) > argidx && args[argidx] == "-edif") { + edif_file edif; + argidx++; + while (argidx < GetSize(args)) { + std::string filename = frontent_rewrite(args, argidx, tmp_files); + if (!edif.Read(filename.c_str())) + log_cmd_error("Reading `%s' in EDIF mode failed.\n", filename.c_str()); + } + goto check_error; + } +#endif if (argidx < GetSize(args) && args[argidx] == "-pp") { const char* filename = nullptr; @@ -3222,6 +3247,9 @@ struct VerificPass : public Pass { #ifdef VERIFIC_VHDL_SUPPORT vhdl_file::Reset(); #endif +#ifdef VERIFIC_EDIF_SUPPORT + edif_file::Reset(); +#endif Libset::Reset(); Message::Reset(); RuntimeFlags::DeleteAllFlags(); @@ -3348,6 +3376,13 @@ struct ReadPass : public Pass { log("\n"); log("\n"); #endif +#ifdef VERIFIC_EDIF_SUPPORT + log(" read {-edif} <edif-file>..\n"); + log("\n"); + log("Load the specified EDIF files. (Requires Verific.)\n"); + log("\n"); + log("\n"); +#endif log(" read {-f|-F} <command-file>\n"); log("\n"); log("Load and execute the specified command file. (Requires Verific.)\n"); @@ -3441,6 +3476,17 @@ struct ReadPass : public Pass { return; } #endif +#ifdef VERIFIC_EDIF_SUPPORT + if (args[1] == "-edif") { + if (use_verific) { + args[0] = "verific"; + Pass::call(design, args); + } else { + cmd_error(args, 1, "This version of Yosys is built without Verific support.\n"); + } + return; + } +#endif if (args[1] == "-f" || args[1] == "-F") { if (use_verific) { args[0] = "verific"; |