aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/verific
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2022-10-04 09:18:44 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2022-10-04 09:18:44 +0200
commit1a6f10e8bacfe36ac436c86f8e4b3bdda05e267c (patch)
treedef0d52a79460c99eb95b3f910f7d8d35787b7f5 /frontends/verific
parentf5e2c0a49816be3ce425b96a64a07e8fadcc6e70 (diff)
downloadyosys-1a6f10e8bacfe36ac436c86f8e4b3bdda05e267c.tar.gz
yosys-1a6f10e8bacfe36ac436c86f8e4b3bdda05e267c.tar.bz2
yosys-1a6f10e8bacfe36ac436c86f8e4b3bdda05e267c.zip
Add support for EDIF file reading using Verific
Diffstat (limited to 'frontends/verific')
-rw-r--r--frontends/verific/verific.cc48
1 files changed, 47 insertions, 1 deletions
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";