Skip to content

Commit

Permalink
Merge pull request #16 from AuringzaibSabir/main
Browse files Browse the repository at this point in the history
Capturing coverage for observing the instruction pattern of alu, mul/div & floating-point.
  • Loading branch information
zeeshanrafique23 authored Dec 9, 2021
2 parents 4d612a8 + 780c764 commit 331dd2c
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions hw/vendor/lowrisc_ibex/rtl/ibex_decoder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1787,4 +1787,40 @@ module ibex_decoder #(
// Selectors must be known/valid.
`ASSERT(IbexRegImmAluOpKnown, (opcode == OPCODE_OP_IMM) |->
!$isunknown(instr[14:12]))

////////////////////////
//Functional coverages//
////////////////////////

`ifdef AZADI_FC
// Covergroup to capture ALU operations
covergroup alu_cg ()@(alu_operator_o);
ALU_OPERATIONS: coverpoint alu_operator_o;
endgroup : alu_cg

// Covergroup to capture Multiplier/divider operations
covergroup mul_div_cg ()@(multdiv_operator_o);
MUL_DIV_OPERATIONS: coverpoint multdiv_operator_o;
endgroup : mul_div_cg

// Covergroup to capture floating point operations
covergroup fpu_cg ()@(fp_alu_operator_o);
FPU_OPERATIONS: coverpoint fp_alu_operator_o;
endgroup : fpu_cg

alu_cg alu_cg_h ;
mul_div_cg mul_div_cg_h;
fpu_cg fpu_cg_h ;

initial begin
alu_cg_h = new(); // Instance of a alu covergroup
mul_div_cg_h = new(); // Instance of a mul/div covergroup
fpu_cg_h = new(); // Instance of a fpu covergroup
//alu_cg_h.set_inst_name("ALU OPERATIONS COVERAGES");
//mul_div_cg_h.set_inst_name("MUL/DIV OPERATIONS COVERAGES");
end

`endif // AZADI_FC

endmodule // controller

0 comments on commit 331dd2c

Please sign in to comment.