mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Support weight in coverage (#8472)
This commit is contained in:
+16
-1
@@ -328,6 +328,20 @@ class EmitVBaseVisitorConst VL_NOT_FINAL : public VNVisitorConst {
|
||||
}
|
||||
puts(";\n");
|
||||
}
|
||||
// An option or type_option assignment, from a covergroup, coverpoint, or cross
|
||||
void emitCoverageOption(AstNode* nodep, bool typeOption, VCoverOptionType optType,
|
||||
AstNodeExpr* valuep) {
|
||||
putfs(nodep,
|
||||
std::string{typeOption ? "type_option." : "option."} + optType.ascii() + " = ");
|
||||
iterateConst(valuep);
|
||||
puts(";\n");
|
||||
}
|
||||
void visit(AstCgOptionAssign* nodep) override {
|
||||
emitCoverageOption(nodep, nodep->typeOption(), nodep->optType(), nodep->valuep());
|
||||
}
|
||||
void visit(AstCoverOption* nodep) override {
|
||||
emitCoverageOption(nodep, nodep->typeOption(), nodep->optType(), nodep->valuep());
|
||||
}
|
||||
void visit(AstCoverBin* nodep) override {
|
||||
switch (nodep->binsType()) {
|
||||
case VCoverBinsType::BINS_IGNORE: putfs(nodep, "ignore_bins "); break;
|
||||
@@ -403,8 +417,9 @@ class EmitVBaseVisitorConst VL_NOT_FINAL : public VNVisitorConst {
|
||||
iterateConst(nodep->iffp());
|
||||
puts(")");
|
||||
}
|
||||
if (nodep->binsp()) {
|
||||
if (nodep->binsp() || nodep->optionsp()) {
|
||||
puts(" {\n");
|
||||
iterateAndNextConstNull(nodep->optionsp());
|
||||
iterateAndNextConstNull(nodep->binsp());
|
||||
puts("}\n");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user