Introduction Code coverage refects how thorough the HDL code was exercised. the set o eatures provided by code coverage tools usually includes line/bloc coverage! arc coverage or state "achines! expression coverage! event coverage and toggle coverage. #here are so"e li"itiation with this approach. they are! $verlooing non%i"ple"ented eatures. #he inability to "easure the interaction between "ultiple "odules. #he ability to "easure si"ultaneous events or se&uences o events. •
•
•
•
•
Functional coverage perceives the design ro" a user's or a syste" point o view. –
–
–
–
–
Have you covered all o your typical scenarios( )rror cases( Corner cases( *rotocols( Functional coverage also allows relationships! +$,! I've covered every state in "y state "achine! but did I ever have an interrupt at the sa"e ti"e( -hen the input buer was ull! did I have all types o pacets inected( Did I ever inect two erroneous pacets in a row(+
•
0yste"1erilog unctional coverage eatures are below. –
–
–
–
–
–
–
Coverage o variables and expressions! as well as cross coverage between the" 3uto"atic as well as user%de4ned coverage bins 3ssociate bins with sets o values! transitions! or cross products Filtering conditions at "ultiple levels )vents and se&uences to auto"atically trigger coverage sa"pling *rocedural activation and &uery o coverage $ptional directives to control and regulate coverage
Functional Coverage types •
#here are 5 places where unctional coverage points can be coded in a veri4cation enviro"ent! and they can be class4ed as –
points are very near the rando"i8ation points are sa"pled at input interace o points which sa"ple internal D:# points which sa"ple output interace o
•
•
•
•
F1 Coverage points #hese set o coverage points are coded in class which is instantiated very near to the rando"i8ation and it is beore actual <F=/driver to D:#. F2 Coverage points #hese set o coverage points are coded in class which is instantiated inside a input "onitor or coverage class itsel will have ablitiy to sa"ple the D:# input signals. #his is perect or having unctional coverage on sti"ulus that D:# is being driven with! F3 Coverage points #hese set o coverage points are coded in class which is instantiated as standalone class! and it "onitors the internal states o D:#! lie F0= states! or so"e registers. F4 Coverage points #hese set o coverage points are coded in class which is instantiated inside a output "onitor or coverage class itsel will have ablitiy to sa"ple the D:# output signals. #his is perect or having unctional coverage on output o D:#!
CoverGroup Inside a Class •
3s said earlier! covergroup can be e"bedded inside a class! interace! or "odule. -hen e"ebedded inside a class! it allows to generate coverage on subset o class properties. I"portant dierence between a covergroup in "odule and covergroup in class is that! it is optional to create the instance o covergroup in class. as this is ind o auto"atic i.e the coverage group is i"plicitly declared. 3n e"bedded covergroup can de4ne a coverage "odel or protected and local class properties without any changes to the class data encapsulation. Class "e"bers can beco"e coverage points or can be used in other coverage constructs! such as conditional guards or option initiali8ation. 3 class can have "ore than one covergroup.
Cross coverage •
•
•
coverage group can speciy cross coverage between two or "ore coverage points or variables. Cross coverage is speci4ed using the cross construct. -hen veriying co"plex syste"s it is i"portant that co"bination o unctional points are veri4ed. cross c"d >?)3D/-?I#)@ and addres or "e"ory co"ponent cross pacet type and pacet length or a networing co"ponent
Coverage options •
Coverage OptionsLie in 1era! 0yste"verilog provides ways to control the behavior o the covergroup! coverpoint and cross. $ne o the "ost co""on usage o these coverage options is setting weightage o a covergroup. In a advanced testbench there could be "any covergroups! and ro" the veri4cation point o view so"e covergroups have high priority! and they "igh be is less nu"ber! on other there hand there could be covergroups which are o low priority! and they are in large nu"ber. #here is no way si"ulator is going to now this priority inor"ation! so 0yste"verilog provides options to co""unicate this to si"ulator. #his way! even i don't have good coverage on low priority covegroup! it won't eect overall coverage in big way.