From 84711f0e8c842b7309c7f1eff375cb757b41755b Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 19 Nov 2019 13:24:48 -0800 Subject: Print help message for verific pass --- frontends/verific/verific.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index a5c4aa26a..e88702087 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2073,8 +2073,10 @@ struct VerificPass : public Pass { { static bool set_verific_global_flags = true; - if (check_noverific_env()) + if (check_noverific_env()) { + help(); log_cmd_error("This version of Yosys is built without Verific support.\n"); + } log_header(design, "Executing VERIFIC (loading SystemVerilog and VHDL designs using Verific).\n"); @@ -2395,7 +2397,7 @@ struct VerificPass : public Pass { else { if (argidx == GetSize(args)) - log_cmd_error("No top module specified.\n"); + cmd_error(arg, argidx, "No top module specified.\n"); Array veri_modules, vhdl_units; for (; argidx < GetSize(args); argidx++) @@ -2481,7 +2483,7 @@ struct VerificPass : public Pass { goto check_error; } - log_cmd_error("Missing or unsupported mode parameter.\n"); + cmd_error(args, argidx, "Missing or unsupported mode parameter.\n"); check_error: if (!verific_error_msg.empty()) @@ -2490,6 +2492,7 @@ struct VerificPass : public Pass { } #else /* YOSYS_ENABLE_VERIFIC */ void execute(std::vector, RTLIL::Design *) YS_OVERRIDE { + help(); log_cmd_error("This version of Yosys is built without Verific support.\n"); } #endif @@ -2548,14 +2551,14 @@ struct ReadPass : public Pass { static bool use_verific = verific_available; if (args.size() < 2 || args[1][0] != '-') - log_cmd_error("Missing mode parameter.\n"); + cmd_error(args, 1, "Missing mode parameter.\n"); if (args[1] == "-verific" || args[1] == "-noverific") { if (args.size() != 2) - log_cmd_error("Additional arguments to -verific/-noverific.\n"); + cmd_error(args, 1, "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"); + cmd_error(args, 1, "This version of Yosys is built without Verific support.\n"); use_verific = true; } else { use_verific = false; @@ -2564,7 +2567,7 @@ struct ReadPass : public Pass { } if (args.size() < 3) - log_cmd_error("Missing file name parameter.\n"); + cmd_error(args, 3, "Missing file name parameter.\n"); if (args[1] == "-vlog95" || args[1] == "-vlog2k") { if (use_verific) { @@ -2596,7 +2599,7 @@ struct ReadPass : public Pass { args[0] = "verific"; Pass::call(design, args); } else { - log_cmd_error("This version of Yosys is built without Verific support.\n"); + cmd_error(args, 1, "This version of Yosys is built without Verific support.\n"); } return; } @@ -2643,7 +2646,7 @@ struct ReadPass : public Pass { return; } - log_cmd_error("Missing or unsupported mode parameter.\n"); + cmd_error(args, 1, "Missing or unsupported mode parameter.\n"); } } ReadPass; -- cgit v1.2.3 From e2819ce31c20b60b7b5b3a58509006322ceb76ab Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 19 Nov 2019 13:25:38 -0800 Subject: Oops --- frontends/verific/verific.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index e88702087..79730c98a 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2397,7 +2397,7 @@ struct VerificPass : public Pass { else { if (argidx == GetSize(args)) - cmd_error(arg, argidx, "No top module specified.\n"); + cmd_error(args, argidx, "No top module specified.\n"); Array veri_modules, vhdl_units; for (; argidx < GetSize(args); argidx++) -- cgit v1.2.3 From d730bba6d2847515795c32d3a753320b8b48bee0 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 27 Jan 2020 10:32:18 -0800 Subject: verific: no help() when no YOSYS_ENABLE_VERIFIC --- frontends/verific/verific.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 79730c98a..05c615768 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2073,10 +2073,8 @@ struct VerificPass : public Pass { { static bool set_verific_global_flags = true; - if (check_noverific_env()) { - help(); + if (check_noverific_env()) log_cmd_error("This version of Yosys is built without Verific support.\n"); - } log_header(design, "Executing VERIFIC (loading SystemVerilog and VHDL designs using Verific).\n"); @@ -2492,7 +2490,6 @@ struct VerificPass : public Pass { } #else /* YOSYS_ENABLE_VERIFIC */ void execute(std::vector, RTLIL::Design *) YS_OVERRIDE { - help(); log_cmd_error("This version of Yosys is built without Verific support.\n"); } #endif -- cgit v1.2.3