Quantcast
Channel: Jason Andrews Blog
Viewing all articles
Browse latest Browse all 33813

RE: Coverage not getting hit when trying with IUS simulator

$
0
0
Here is the complete code I generated based on your example: typedef enum bit {READ, WRITE} cmd_e; typedef enum bit {ABC, XYZ} data_e; class xact_c; rand cmd_e cmd; bit set_ccc; rand data_e data_type; constraint cmd_const {data_type dist {ABC := 1, XYZ := 1};} constraint type_const {data_type dist {ABC := 1, XYZ := 1};} function void print(); $display("xact print %n, %b, %n", cmd, set_ccc, data_type); endfunction endclass class cov_data_callback; event xact_sample; xact_c xact = new(); function void transaction_observed_cov(); $display("PRINTING XACT"); xact.print(); //Till this point my displays come fine in the log with IUS //I see correct values but still bin doesn't hit. ->this.xact_sample; endfunction endclass class A extends cov_data_callback; covergroup transaction_type @(xact_sample); type_option.comment = "coverage"; option.per_instance = 1; cmd : coverpoint xact.cmd iff((xact.set_ccc == 0) && (xact.data_type == ABC)) { option.comment = "This coverpoint captures coverage of commands sent by Master"; bins write_cmd = {WRITE}; bins read_cmd = {READ}; } endgroup function new(); super.new(); transaction_type = new(); endfunction endclass module test; A grpTest = new(); initial begin repeat (10) begin #1 void'(grpTest.xact.randomize()); grpTest.transaction_observed_cov(); end end endmodule The output is: PRINTING XACT xact print WRITE, 0, ABC PRINTING XACT xact print WRITE, 0, XYZ PRINTING XACT xact print WRITE, 0, ABC PRINTING XACT xact print WRITE, 0, XYZ PRINTING XACT xact print WRITE, 0, ABC PRINTING XACT xact print WRITE, 0, XYZ PRINTING XACT xact print READ, 0, ABC PRINTING XACT xact print WRITE, 0, XYZ PRINTING XACT xact print WRITE, 0, ABC PRINTING XACT xact print WRITE, 0, XYZ And the coverage is: So with my example, the coverage report is lining up with the displayed output. Tim

Viewing all articles
Browse latest Browse all 33813

Latest Images

Trending Articles



Latest Images