diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-03-27 14:03:35 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-03-27 14:03:35 +0100 |
commit | 7682629b79fd59f5ed49fb35a3a2441a405bfd63 (patch) | |
tree | d4aa7de16ec90791f30068cd9f4fd7db3493a229 /frontends/verific/verific.cc | |
parent | 2c7fe42ad158a9859895399bdd876f5dbb2c7376 (diff) | |
download | yosys-7682629b79fd59f5ed49fb35a3a2441a405bfd63.tar.gz yosys-7682629b79fd59f5ed49fb35a3a2441a405bfd63.tar.bz2 yosys-7682629b79fd59f5ed49fb35a3a2441a405bfd63.zip |
Add "read -verific" and "read -noverific"
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'frontends/verific/verific.cc')
-rw-r--r-- | frontends/verific/verific.cc | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 95b7d3586..ed9727b88 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2386,21 +2386,43 @@ struct ReadPass : public Pass { log("\n"); log("Add directory to global Verilog/SystemVerilog include directories.\n"); log("\n"); + log("\n"); + log(" read -verific\n"); + log(" read -noverific\n"); + log("\n"); + log("Subsequent calls to 'read' will either use or not use Verific. Calling 'read'\n"); + log("with -verific will result in an error on Yosys binaries that are built without\n"); + log("Verific support. The default is to use Verific if it is available.\n"); + log("\n"); } void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE { +#ifdef YOSYS_ENABLE_VERIFIC + static bool verific_available = !check_noverific_env(); +#else + static bool verific_available = false; +#endif + static bool use_verific = verific_available; + if (args.size() < 2 || args[1][0] != '-') log_cmd_error("Missing mode parameter.\n"); + if (args[1] == "-verific" || args[1] == "-noverific") { + if (args.size() != 2) + log_cmd_error("Additional arguments to -verific/-noverific.\n"); + if (args[1] == "-verific") { + if (!verific_available) + log_cmd_error("This version of Yosys is built without Verific support.\n"); + use_verific = true; + } else { + use_verific = false; + } + return; + } + if (args.size() < 3) log_cmd_error("Missing file name parameter.\n"); -#ifdef YOSYS_ENABLE_VERIFIC - bool use_verific = !check_noverific_env(); -#else - bool use_verific = false; -#endif - if (args[1] == "-vlog95" || args[1] == "-vlog2k") { if (use_verific) { args[0] = "verific"; |