Did the desired events happen What is the quality of the stimulus Create a

Did the desired events happen what is the quality of

This preview shows page 27 - 31 out of 31 pages.

– Did the desired events happen – What is the quality of the stimulus Create a statistics class – Used to track stimulus and response statistics For example: Total packets generated and total packets received – Can also be used to track events of interest For example: Total packets dropped, Queue occupancy
Image of page 27
DAC2003 Accellera SystemVerilog Workshop 154 Example of coverage class class Counter ; int count; int limit; extern task new (int lim=1000); extern task inc (); extern task dec (); endclass class Stats; Counter counter [string]; Counter event_counter [string]; task new (); counter[”GenPkts”] = new; counter [”RxPkts”] = new; counter [”UcPkts”] = new; counter [”McPkts”] = new; event_counter [”DropPkts”] = new; endtask extern task inc_stats (string PktType); extern task inc_events (string EventType); extern task pr (); endclass Track statistics to grade test effectiveness Assoc array of counters Indexed by counter name
Image of page 28
DAC2003 Accellera SystemVerilog Workshop 155 Style Guidelines One class hierarchy per file File name same as base class name Class name capitalized – Hostxactor Define methods external to class Constraints should be defined external to class Use interfaces for BFM, drivers or transactors
Image of page 29