From 2dd5ef5e8b152863ebcb1d3e79e1d591593a365e Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sat, 22 May 2021 12:27:32 +0100 Subject: [PATCH] Internals: Move --coverage and --savable check out of V3EmitC (#2976) --- src/V3EmitC.cpp | 5 +---- src/V3Options.cpp | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 08f186b3e..b5c88dadc 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -3120,10 +3120,7 @@ void EmitCImp::emitIntTop(AstNodeModule*) { } if (v3Global.opt.mtasks()) puts("#include \"verilated_threads.h\"\n"); if (v3Global.opt.savable()) puts("#include \"verilated_save.h\"\n"); - if (v3Global.opt.coverage()) { - puts("#include \"verilated_cov.h\"\n"); - if (v3Global.opt.savable()) v3error("--coverage and --savable not supported together"); - } + if (v3Global.opt.coverage()) puts("#include \"verilated_cov.h\"\n"); if (v3Global.dpi()) { // do this before including our main .h file so that any references to // types defined in svdpi.h are available diff --git a/src/V3Options.cpp b/src/V3Options.cpp index f816b7d41..d292b4096 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -787,6 +787,10 @@ void V3Options::notify() { cmdfl->v3warn(E_UNSUPPORTED, "--main not usable with SystemC. Suggest see examples for sc_main()."); } + + if (coverage() && savable()) { + cmdfl->v3error("--coverage and --savable not supported together"); + } } //######################################################################