|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



COVER POINTS



A covergroup can contain one or more coverage points. A coverage point can be an integral variable or an integral expression. A coverage point creates a hierarchical scope, and can be optionally labeled. If the label is specified then it designates the name of the coverage point.



program main;
bit [0:2] y;
bit [0:2] values[$]= '{3,5,6};

covergroup cg;
cover_point_y : coverpoint y;
endgroup

cg cg_inst = new();

initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram



In the above example, we are sampleing the cover point "y". The cover point is named "cover_point_y" . In the Coverage report you will see this name. A cover group "cg" is defined and its instance "cg_inst" is created. The value of "y" is sampled when cg_inst.sample() method is called. Total possible values for Y are 0,1,2,3,4,5,6,7. The variable "y" is assigned only values 3,5,6. The coverage engine should report that only 3 values are covered and there are 8 possible values.



Commands To Simulate And Get The Coverage Report:



VCS



Compilation command:
vcs -sverilog -ntb_opts dtm filename.sv
Simulation Command:
./simv
Command to generate Coverage report: Coverage report in html format will be in the ./urgReport directory
urg -dir simv.vdb



NCSIM



ncverilog -sv -access +rwc -coverage functional filename.sv
iccr iccr.cmd
iccr.cmd
load_test *
report_detail -instance -both -d *



QUESTASIM



Create the library
vlib library_name

Compilation command
vlog work library_name filename.sv

Simulation Command:
vsim library_name.module_top_name

Coverage will be saved in UCDB Format in Questasim

Case 1) By default in modelsim.ini file to Name of UCDB file will be threre, If it is there, it will create one file filename.ucdb

Case 2) Sometimes in modelsim.ini file UCDB File name will be commented in that case we have to save UCDB File explicitly after vsim command
Coverage save filename.ucdb

Once u are ready with UCDB File u need to generate coverage report from ucdb file
To generate only Functional coverage report
vcover cvg myreport.txt outfilename.ucdb




After running the above program, the coverage report will show,




VARIABLE : cover_point_y
Expected : 8
Covered : 3
Percent: 37.50.



In the above report, the coverage percentage is calculated by Covered/Expected.

Index
Introduction
Cover Group
Sample
Cover Points
Coverpoint Expression
Generic Coverage Groups
Coverage Bins
Explicit Bin Creation
Transition Bins
Wildcard Bins
Ignore Bins
Illegal Bins
Cross Coverage
Coverage Options
Coverage Methods
System Tasks
Cover Property

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright 2007-2017 :: all rights reserved www.testbench.in::Disclaimer