[otbn,dv] Allow unknown instructions in otbn_env_cov
Without this, UVM tests will fail if coverage is turned on and they
see an unknown instruction. This wasn't a problem before because we
didn't generate any bad instructions, but the next commit will add
"bad instruction support" to the RIG.
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/otbn/dv/uvm/env/otbn_env_cov.sv b/hw/ip/otbn/dv/uvm/env/otbn_env_cov.sv
index aaed221..55741d9 100644
--- a/hw/ip/otbn/dv/uvm/env/otbn_env_cov.sv
+++ b/hw/ip/otbn/dv/uvm/env/otbn_env_cov.sv
@@ -71,6 +71,8 @@
`DEF_MNEM(mnem_bn_movr, "bn.movr");
`DEF_MNEM(mnem_bn_wsrr, "bn.wsrr");
`DEF_MNEM(mnem_bn_wsrw, "bn.wsrw");
+ // A fake mnemonic, used for bits that don't decode to a real instruction
+ `DEF_MNEM(mnem_dummy, "dummy-insn");
`undef DEF_MNEM
// A macro used for coverpoints for mnemonics. This expands to entries like
@@ -1617,6 +1619,7 @@
insn_encodings[mnem_bn_movr] = "bnmovr";
insn_encodings[mnem_bn_wsrr] = "wcsr";
insn_encodings[mnem_bn_wsrw] = "wcsr";
+ insn_encodings[mnem_dummy] = "dummy";
endfunction
// Handle coverage for an instruction that was executed
@@ -1724,6 +1727,9 @@
enc_u_cg.sample(mnem, insn_data);
"wcsr":
enc_wcsr_cg.sample(mnem, insn_data);
+ "dummy":
+ // Bad instruction: no encoding-level coverage.
+ ;
default: `dv_fatal($sformatf("Unknown encoding (%0s) for instruction `%0s'", encoding, mnem),
`gfn)
endcase