Lab 08 Cov
Lab 08 Cov
8 Coverage Metrics
Learning Objectives
30 minutes
UNIT Unit 8
What other types of coverage are available with VCS Coverage Metrics? __________
_____________________________________________________________________
What are the vcs & simv options to invoke each type of coverage? _______________
_____________________________________________________________________
What option would you use to specify line and condition coverage only?__________
4. In the main cmView window, left click on the FSM Coverage icon.
5. Left click on Module List to display all modules where a finite state machine was
found. You should see that the CPU module has one state machine.
6. Double click left on the CPU module (under the List of all modules). This will bring
up a window with coverage details for the FSM in the CPU module. Double click the
Transitions tab you will see a matrix of transitions. A green check indicates the
transition was covered during your simulation. A red X indicates that the transition
was not covered. An empty (gray) box indicates that VCS found that transition was
not possible.
Which state transitions were not covered?________________________________
__________________________________________________________________
7. Click on the States tab. This displays each possible state in the FSM and whether it
was covered. There are five states in this FSM and each one was covered at least once
during the simulation run.
8. Click on the Reachability tab. This shows information about transitions between two
states through intervening states. Lets look at an example…
9. Click on the yellow box that represents the transition from MEMORY to FETCH.
The 1 / 2 displayed in this box indicates that there are two possible transitions from
MEMORY to FETCH and that only one was covered. After clicking this transition
you will see that VCS has determined two possible transitions:
MEMORY -> WRITE_BACK -> FETCH (covered)
MEMORY -> FETCH (not covered)
10. Exit the cmView GUI
So far we have been writing coverage results into default filenames under the
simv.cm directory. For example…
simv.cm/coverage/verilog/test.line
simv.cm/coverage/verilog/test.fsm
This is fine as long as there is only one test vector to run. But what if there are
multiple test vectors? You don’t want to overwrite the default filenames with each
new test vector that is simulated. It is more useful save the coverage results for each
simulation with a new vector and then merge the results . In this section we will
examine how to do this.
1. First clean up the directory you are working in. Make sure you have exited the
cmView GUI and then run the clean script.
2. The directory CODE contains five different tests. Copy the first test into the run
directory
cp CODE/text1 text_segment
Coverage Metrics 8- 3
cp CODE/data1 data_segment
3. Run a vcs compile and enable all types of coverage (see “run_all” script)
VCS COMMAND LINE_____________________________________________
6. One by one, copy the other vectors into the run directory and rerun the simulation
with all coverage types enabled. For each simulation run, be sure to rename the
coverage report files. (A script called run_all is provided.)
What file contains condition coverage results for test5?_____________________
What file contains line coverage results for test2?__________________________
7. We will now merge the data together. At the command line type:
vcs –cm_pp –cm_dir test1 –cm_dir test2 –cm_dir test3 –cm_dir test4 –cm_dir test5
–cm_name merged
This will create a merging of all the 5 tests into a merged database and the merged
coverage report will be stored in "simv.cm/reports" with the filename prefix "merged"
(i.e. simv.cm/reports/merged.long_l will contain the merged coverage results from the 5
tests).
8. You can also observe these data and do test grading through GUI. Invoke the cmView
GUI. Type:
vcs –cm_pp gui –cm line+tgl+cond+fsm –cm_dir test1 –cm_name test1
Go to the “File” on the menu bar and drop down to “Open Coverage Statement”. This
will open the hierarchy and coverage window. On the coverage menu bar select “add”,
this opens the window that will allow you to add the line coverage data for grading. In
the filter window or thru selecting, set the path for ./test2/*.line select test2.line and add
it. You can do the same steps to add other tests ( test3 to test5). Close the window after
adding the line coverage. You can now compare tests using the compare menu.
9. We will use cmView’s auto-grading feature to determine a subset of test vectors that
meet a user-defined coverage goal. From the main cmView window select
Coverage Metrics 8- 5