Академический Документы
Профессиональный Документы
Культура Документы
May 2006
Paul Baleme, Satya Ayyagari
Day One
Welcome
Length: 2 days
Intel Confidential 4
Typographic Conventions
Intel Confidential 5
What is SystemVerilog
Intel Confidential 6
Getting More Information
SystemVerilog LRM
http://www.eda.org/sv/SystemVerilog_3.1a.pdf
AVC Wiki
http://www-
fmec.fm.intel.com/twiki/bin/view/Chipset/SystemVerilog
Additional Information
www.accellera.org
Intel Confidential 7
Using SystemVerilog
(some users may have to do the following before the above will work)
% source /usr/users/a2fs/environment/imdenv/alias
Intel Confidential 8
Hello World
module helloWorld();
initial
begin: hello
$display("Hello World");
end: hello
endmodule: helloWorld
Intel Confidential 9
Compiling SystemVerilog
Intel Confidential 10
Commenting Your Code
Intel Confidential 11
Lab 1: Hello World
Intel Confidential 12
Basic Data Types
Integer Data Type
shortint 2-state (1, 0), 16 bit signed
int 2-state, 32 bit signed
longint 2-state, 64 bit signed
byte 2-state, 8 bit signed
bit 2-state, user-defined vector size
logic 4-state (1,0,x,z) user-def
reg 4-state user-defined size
integer 4-state, 32 bit signed
time 4-state, 64 bit unsigned
Intel Confidential 14
Signed/Unsigned
Intel Confidential 15
Strings
string – dynamic allocated array of bytes
SV provides methods for working with strings
Intel Confidential 17
Literal Values
Real Literal
value.value
Ex: 2.4
Intel Confidential 18
Variable Declarations
initial begin
$display(“begin”);
int i;
...
end
Intel Confidential 19
Lab 2: Data Types
Write a top level module that displays the following output.
Use of the following data types:
1. int both signed and unsigned
2. logic
3. string
Hint:
int i, h;
$display(“%d %h”, i, h);
string str; $sformat(str, “%b”, l)
$display(“Logic value in upper case %s”,str.toupper());
Output:
# The integer i is 0x00000014
# The unsigned integer ui is 0xdeadbeef
# The logic L is 1Z
# string str1 is "Hello World"
# string str2 is "Cruel World“
Intel Confidential 20
Operators
Logic Operators
& | ~ ^ ~& ~| ~^ << >>
Arithmetic Operators
+ - % / * ** <<< >>>
Assignment Operators
= += -= *= /= %= &= |= ^= <<= >>= <<<= >>>=
Example:
a += 3;
Equivalent to:
a = a + 3;
Intel Confidential 21
Operators
Intel Confidential 22
Concatenation
Intel Confidential 23
Lab 3: Operators
Ignore remainder.
Intel Confidential 24
Flow Control Constructs
Intel Confidential 26
if
Intel Confidential 27
?:
Ex: var_m = (x == 1) ? a : b;
Intel Confidential 28
case
Intel Confidential 29
casez, casex
Intel Confidential 30
forever
Intel Confidential 31
repeat
Example
x = 0;
repeat (16)
begin
$display(“%d”, x++);
end
Intel Confidential 32
while
Intel Confidential 33
for
Intel Confidential 34
Enhanced for
SystemVerilog adds:
Loop variable declaration
Multiple statements in init and step blocks (comma
separated)
++ and -- operators (Mentioned in operator section)
Intel Confidential 35
foreach
int arr_x[];
typedef int arr_joe[7:0][3:8]
arr_joe arr_y[$];
int arr_z[0:3*width][8*num-1:0];
initial
begin
arr_x = new[10];
foreach (arr_x[i]) statement
foreach (arr_y[m,n,p]) statement
foreach (arr_z[i,j]) statement
end
Intel Confidential 36
do..while
Intel Confidential 37
Lab 4: Flow control
Fn = Fn-1 + Fn-2
Hint: F1 = F2 = 1
Intel Confidential 38
User Defined Types and
Enumerated Types
User Defined Types
inch foot = 12, yard = 36; // these are 2 new variables of type ‘inch’
8-40 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Enumeration
Syntax:
enum [enum_base_type] { enum_name_declaration {,enum_name_declaration} }
Intel Confidential 42
Casting
Casting
A data type can be changed by using a cast
(’) operation.
Syntax: <type>’(<value/expression>)
Examples:
int’(2.0 * 3.0)// real to int casting
7’(x-2)//number of bits to change
size.
signed(m)//changes m to signed
inteltype’(2+3)//casting to a user
defined type [inteltype].
Intel Confidential 44
Arrays
Packed/Unpacked Arrays
Intel Confidential 46
Array Literals and Default
To help in assigning literal values to arrays SV introduces the default keyword:
For more control, consider the dimensions of the array and use { } to match those
dimensions exactly.
8-47 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
1st new array in SV, not synthesizable
Dynamic Arrays
Dynamic declaration of one index of an unpacked array
Syntax:
data_type array_name[] ;
Declares a dynamic array array_name of type data_type
Examples:
bit [3:0] nibble[ ]; // Dynamic array of 4-bit vectors
integer mem[ ]; // Dynamic array of integers
8-49 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Dynamic Array Example
module dyn_arry ();
bit data1 [];
initial
begin
// create a 128 element array
data1 = new [128];
$display("Size of array = %d",
data1.size());
data2 = new[256](data1);
$display("Size of array = %d",
data2.size());
data1.delete();
$display("Size of array = %d",
data1.size());
end
endmodule
Intel Confidential 50
3rd new array in SV, not synthesizable
for (int i=0; i < q1.size; i++) // step through a list using integers (NO POINTERS)
begin … end
Intel Confidential 51
Queue Methods
size() Returns the number of items in the queue. Prototype:
If the queue is empty, it returns 0. function int size();
insert() Inserts the given item at the specified index position. Prototype:
function void insert (int index, queue_type item);
Q.insert (i, e) => Q = ‘{Q[0:i-1], e, Q[i,$]}
pop_front() Removes and returns the first element of the queue. Prototype:
function queue_type pop_front();
e = Q.pop_front () => e = Q[0]; Q = Q[1,$]
pop_back() Removes and returns the last element of the queue. Prototype:
function queue_type pop_back();
e = Q.pop_back () => e = Q[$]; Q = Q[0,$-1]
push_front() Inserts the given element at the front of the queue. Prototype:
function void push_front (queue_type item);
Q.push_front (e) => Q = ‘{e, Q}
push_back() Inserts the given element at the end of the queue. Prototype:
function void push_back (queue_type item);
Q.push_back (e) => Q = ‘{Q, e}
Intel Confidential 52
Queue Example
module queues ();
int q [$]; // declare the q
initial
begin: store_disp
// Push elements into the queue
q.push_back(1);
q.push_back(0);
// Display its contents
$display("Size of queue = %0d", q.size());
// Delete the element of queue at index 1
q.delete(1);
// Push to front of the queue
q.push_front (0);
// Display all the contents in the queue
for (int i = 0; i < q.size(); i++)
$display("q[%0d] = %0d", i, q[i]);
end: store_disp
endmodule: queues
Intel Confidential 53
Lab 6: Queues
Intel Confidential 54
Associative Arrays
Associative arrays are used when the size of the
array is not known or the data is sparse.
Syntax:
data_type array_name [index_type];
In other words
value_type array_name [key_type];
It implements a lookup table of the elements of its
declared type.
Data type used as an index serves as lookup key
and imposes an order.
Associative array do not have their storage allocated
until it is used.
Intel Confidential 55
Index Types
Intel Confidential 56
Associative Array Methods
Function Use
num() Returns number of entries
Intel Confidential 57
Associative array methods - Example
module asoc_arry ();
int db [string]; // Define an associative array
initial
begin: test
string s;
db ["joe"] = 21; // store values at indexes of associative array
db ["jill"] = 19;
// Display the size of the associative array
$display("Size of hash = %0d", db.num());
if (db.exists("jill")) // check if index exists and change value
begin
db["jill"] = 25;
end
// print the contents of associative array
if (db.first(s))
do
begin
$display("Name = %s -- Age = %0d", s, db[s]);
end
while (db.next(s));
end: test
endmodule: asoc_arry
Intel Confidential 58
Lab 7: Associative Arrays
Intel Confidential 59
Procedural Blocks
Triggering sensitivity
@(<signal>) waits for an edge on <signal> before
executing the next statement
Edge-sensitive signal detection
Intel Confidential 61
Initial Block
An initial block starts at time 0,
executes exactly once during a Example
simulation, and then does not module stimulus;
execute again. reg a,b;
If there are multiple initial initial
blocks, each block starts to begin
execute concurrently at time 0. #5 a = 1’b1;
#25 b = 1’b0;
Each block finishes execution
end
independently of other blocks.
endmodule
Multiple behavioral statements
must be grouped, typically
using begin and end.
Intel Confidential 62
Always Block
Intel Confidential 64
Lab 8: Procedural Blocks
Create a SystemVerilog module:
1. Define an initial block such that it generate a clock clock time
period = 10ns
NOTE: Need to initialize clock even though the bit data type is
automatically done.
2. Create an always blocks that pushes the value of signal 'clk' into
queue 'q' at positive edge of the clock.
3. Increment 'counter' when always block is triggered
4. When counter reaches 4 call $finish system call
Hint: Use if statement
5. Define a final block to print the size of 'q' at the end of simulation
Hint: Use final blocks
Output:
# Size of q = 4
Intel Confidential 65
Types of Assignment
Blocking
Nonblocking
Blocking Assignment
Example
The simulator completes a initial
blocking assignment (=) in begin
one pass [execution and a = 30;
#10;
assignment].
a = 5;
Execution flow is blocked c = #10 a;
until a given blocking b = 2;
assignment is complete. end
// at time 0
If there is a time delay on a
a = 30
statement then the next //at time 10
statement will not be a = 5, b = x, c = x
executed until this delay is // at time 20
over. a = 5, b = x, c = 5
// at time 20
a = 5, b = 2, c = 5
Intel Confidential 67
Nonblocking Assignment
Intel Confidential 68
Tasks and Functions
Tasks
SystemVerilog makes a number of extensions to basic Verilog syntax.
endtask
initial initial
begin begin
reentry(); reentry();
reentry(); reentry();
reentry(); reentry();
reentry(); reentry();
end end
endmodule: task_reentry endmodule: task_reentry
What will be the value of counter for each What will be the value of counter for each
call to reentry()? call to reentry()?
Intel Confidential 71
Task usage examples [2]
module task_function ();
int i, j, z;
initial
begin
i = 5;
j = 3;
end
initial
begin
#10;
tsk (i, z, j);
$display("Z = %0d, J = %0d", z, j); // prints Z = 50, J = 4
end
task tsk (input int t1, output int t2, inout int t3);
t2 = 10 * t1;
t3++;
endtask: tsk
endmodule
Intel Confidential 72
Functions
initial
inverta(); // function called like a task
End
8-73 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Function usage examples
Example 1 Example 2
function void show_packet(); typedef enum {FALSE, TRUE} bool;
bool cache_range;
$display("=================="); function bool is_cache_range ();
$display("Packet Type = %s", if (addr > 0 & addr < 10)
context_name); begin
$display("Address = %h", addr); cache_range = TRUE;
$display("Data = %h", data); $display("addr in cache
range = %d", addr);
$display("==================="); return TRUE;
endfunction end
else begin
cache_range = FALSE;
return FALSE;
end
endfunction
Intel Confidential 74
Task and Functions Usage - Summary
Tasks
Tasks can enable other tasks and functions
Tasks may execute in non-zero simulation time.
Tasks may have zero or more arguments of type input, output
and inout.
Functions
Function can enable other functions only. Task cannot be called
from functions.
Functions should execute in zero simulation time.
Functions have only one return value but SystemVerilog also
allows functions to have input, output or inout types.
Both tasks and functions support passing arguments by
reference. By default arguments are passed by value. [Pass by
reference not supported in Modelsim 6.1]
Intel Confidential 75
Task and function argument passing
Intel Confidential 76
Default argument values – Tasks/Functions
Intel Confidential 77
Lab 9a
Create a SystemVerilog module as described
below:
1. Define a queue 'q' of string type.
2. Define a named initial block "store_info"
3. Store the following values into the queue
1. index =0, str = "Intel Chandler"
2. index =1, str = "Intel Folsom"
4. Display the size of the queue.
5. Define a function named "change_str" which does the following:
1. Takes queue and index ‘i’ as input
2. changes the value of str stored in queue at index i to "Intel Ireland“.
3. returns the value of 1 indicating success.
6. Call the change_str function, passing q and the value 1 for the index so
that “Intel Folsom” is changed to “Intel Ireland”.
Intel Confidential 78
Lab 9b
6. Define a task named “show" which does the following:
1. Takes queue and return value from "change_str" as inputs
2. The default inital value [task input argument: ret_value] shall be
set to 0.
3. When the return value from "change_str" function is 1, prints the
elements stored in the queue using the following format:
q[%0d] = %s"
7. Notes: "change_str" and “show" are called from named initial
block "store_info".
Output:
# Loading work.lab9
# run –all
# Size of storage q = 2
# q[0] = Intel Chandler
# q[1] = Intel Ireland
# q -f
Intel Confidential 79
Hierarchy
Inout
Inputs
Outputs
Module
Intel Confidential 81
Ports
Connections
Direction – input, output, inout
Type – wire, bit, logic, user-defined, etc.
Examples:
input bit[3:0] x, y, z;
input bit w[3:0];
output logic q;
inout logic s;
input int x;
output reg r;
Intel Confidential 82
Module syntax Example
module cpu
(inout logic[63:0] data,
output logic[63:0] addr,
module x (port_list); output logic w_or_rb
module_body );
endmodule : x initial
begin : place_holder
Instantiation $display(“A NOTHING CPU”);
x x1 (port_binding_list); end : place_holder
endmodule : cpu
// Error prone
cpu cpu_inst1(addr, data, w_or_rb);
// Better
cpu cpu_inst2(.addr(addr),
.data(data),
.w_or_rb(w_or_rb)
);
// Newer
cpu cpu_inst3( .* );
Intel Confidential 83
Parameters
Intel Confidential 84
Multiple drivers
Intel Confidential 85
Interfaces
Great coding efficiency can be achieved by modeling the blocks of a system at different
levels of abstraction, behavioral, rtl, gate, etc.
In Verilog, the I/O between these blocks has always remained at the lowest “wire” level.
High-performance system-level simulation requires the abstraction of inter-block
communication.
module mmu(d, a, rw_, en); interface interf;
output [15:0] a; logic [7:0] data;
output rw_, en; logic [15:0] addr;
data inout [7:0] d; logic ena, rw_;
... endinterface
addr endmodule
ad adr
MMU rw_ MEM module mmu(interf io);
module mem(d, a, rw_, en); io.addr <= ad;
ena
input [15:0] a; ...
input rw_, en; endmodule
inout [7:0] d;
interface ... module mem(interf io);
endmodule Traditional adr = io.addr;
Verilog ...
module system; endmodule SystemVerilog
At it’s simplest wire [7:0] data;
an interface is wire [15:0] addr; module system;
like a module wire ena, rw_; interf i1;
mmu U1 (i1);
for ports/wires mmu U1 (data, addr, rw_, ena); mem U2 (i1);
mem U2 (data, addr, rw_, ena); endmodule
endmodule
8-86 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
IO Abstraction
source sink
reg a; a a Traditional Verilog approach
a if ( a == 1) • Simple netlist-level IO
… • source/sink can be abstracted
a = 0;
but IO must stay at low level
• IO operations are cumbersome
8-88 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Interface in hierarchy
Interfaces appear as
normal module
instantiations in design
hierarchy.
At the moment,
interfaces cannot be
instantiated in VHDL
blocks.
Interface instances
interface name: bfm_interface
Instantiated twice: bi1, bi2
Intel Confidential 89
Example
modport interface i2;
wire a, b, c, d;
modport master (input a, b,
output c, d);
modport slave (output a, b,
Different users of input c, d);
interface need endinterface : i2
Intel Confidential 90
Lab 10
Intel Confidential 91
Clocking blocks
Intel Confidential 92
Clocking block syntax
Intel Confidential 93
Program Blocks
initial
begin: there
$display(“Hello There”);
end
endprogram: helloWorld
Intel Confidential 94
Program Blocks
Intel Confidential 95
Day Two
Classes
Testbench Only
Object Oriented Primer
A Class is a description of some group of things that
have something in common.
Objects are individual instances of “classes”.
Example: A class might be “Automobile”. Instances of the
“Automobile” class might be “Joe’s car”, “Bob’s car”,
“Sally’s truck”, etc.
Objects/Classes have:
Data/Properties
Color, speed, direction, etc.
Operations/Methods
Start, stop, increaseSpeed, turn, etc.
Encapsulation:
Encapsulate implementation details internal to the
object/class.
Intel Confidential 98
Classes
Inheritance: (is-a relationship)
Allows users to extend existing classes, making minor
modifications. Extending the “Automobile” class example,
users might create subclasses for “sedan”, “truck”, “van”,
etc. The “van” class might also have a “minivan” subclass.
Etc. In these cases, the subclass IS-A superclass. i.e. a
“sedan” is a “Automobile”.
When using inheritance, the sub-class “inherits” all the
parents public/protected data properties and methods. It is
allowed to override them, or use them as-is.
Composition: (has-a relationship)
Composition is used for the case where one object HAS-A
instance of another class. For example, an “Automobile”
class might have 4 instances of a “wheel” class. In this
case, a wheel is not an “Automobile”, so inheritance should
not be used.
Intel Confidential 99
Classes
Polymorphism:
Most common definition of polymorphism is the ability of
the language to process objects differently depending on
their data type or class. SystemVerilog can only process
objects differently depending on their class.
constructor;
methods;
endclass: classname
function new();
super.new();
command = IDLE;
data = ’{1,2,3,4};
endfunction: new
myClass c;
c = new;
c.property1 = 10;
c.property2 = 11;
c.task1();
c.function1();
myOtherMethod();
// Equivalent to: this.myOtherMethod();
endfunction: myFunc
endclass: myPacket
StaticExample::staticMethod();
…
Intel Confidential 110
Abstract Classes
x = new;
x.setData(’{1,2,3,4,5,6,7,8});
$display(“%s”,x.toString());
s = new;
s.iws = 10;
$display(“current time = %t”,$time);
s.stall();
$display(“current time = %t”,$time);
x = s;
x.setData(’{5,6,7,8});
$display(“%s”,x.toString());
Advanced note:
a -> b is equivalent to !a || b
trans = new;
repeat (20)
begin : rand_gen
if (trans.randomize() == 0)
begin
$display(“ERROR: Random constraints
conflict”);
$finish;
end
$display(“%d: %s”, counter++, trans.toString());
end : rand_gen
end : test_body
endmodule : test_rand
endpackage : p
$fclose $fopen
$fdisplay $fstrobe
$fdisplayb $fstrobeb
$fdisplayh $fstrobeh
$fdisplayo $fstrobeo
$fgetc $ungetc
$fflush $ferror
$fgets $rewind
$fmonitor $fwrite
$fmonitorb $fwriteb
$fmonitorh $fwriteh
$fmonitoro $fwriteo
$readmemb $readmemh
$swrite $swriteb
$swriteo $swriteh
$sformat $sdf_annotate
$fscanf $sscanf
$fread $ftell
$fseek
$random
$dist_chi_square $dist_erlang
$dist_exponential $dist_normal
$dist_poisson $dist_t
$dist_uniform
join_any join_none
begin NOTE
fork
fork Child processes spawned by
…
other blocks continue … a fork…join_none do not start
… as dynamic threads join_none // no waiting at all to execute until the parent
…
@(sig1); process hits a blocking
join_any // any block finished end statement
8-149 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Q
Process Control – Wait Fork 6.1
The wait fork statement is used to ensure that all child processes (spawned by
the process where it is called) have completed execution.
begin
fork
task1();
task2();
join_any // continue when either task completes
fork
task3();
task4();
join_none // continue regardless
8-150 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Q
Process Control – Disable Fork 6.1
The disable fork statement terminates all active child processes of the
process where it is called. Termination is recursive, in other words it terminates
child processes, grandchild processes, etc.
task run_tests;
fork
simul_test1;
simul_test2;
join
endtask
task test_with_timeout;
fork
run_tests(); // 2 child tasks spawned in parallel, first to finish triggers join_any
timeout( 1000 );
join_any
disable fork; // Kills the slower task (including any grandchild processes and so on)
endtask
8-151 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Events Trigger Types [1]
Triggering an event module event_testing ();
Named events are triggered event a, b;
bit clk;
using -> operator.
always @(posedge clk)
Triggering an event -> a;
unblocks all processes always @(negedge clk)
currently waiting on the -> b;
event. initial
Event can be visualized in begin
clk = 1'b0;
wave window.
forever #10 clk = !clk ;
end
endmodule
Method Use
new() Create a semaphore with
specified number of keys.
put() Return one or more keys
back.
get() Obtain one or more keys.
Process 1 Process 2
Backup
ack
clk
(req && ack) ##1 !req ##1 !ack ##1 req ##1 (req && ack)
Assuming we start e1 e2 e3 e4
with req and ack hi Sequence
SVA events are: req 1 0 0 1 1 1 matches
e1 ( !req )
e2 ( !ack )
ack 1 1 0 0 1
e3 ( req )
e4 ( ack ) clk
8-169 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Delay and Range
Delay:
Range:
a ##[3:5] b // a is true on current tick, b will be true 3-5 ticks from now
a ##[3:$] b // a is true on current tick, b will be true 3 or more ticks from now
$ represents a non-zero
and finite number
8-170 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Sequence Block
sequence s1;
@ (posedge clk)
a ##1 b ##1 c; // s1 evaluates on each successive edge of clk
endsequence
sequence s3;
start_sig ##1 s2(a,b) ##1 end_sig; // sequence as sub-expression
endsequence
Where: s3 - same as - start_sig ##1 (!frame && (a == data_bus)) ##1 (c_be[0:3] == b) ##1 end_sig;
8-171 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Procedural Sequence Controls
There are two ways to detect the endpoint of a sequence from within sequential
code. In both cases a verification directive (assert property) is implied for the
sequence.
NOTE:
• Both controls imply an instantiation of the sequence (i.e. assert property(seq))
• Only clocked sequences are supported
• Local sequences only (Hierarchical references are not supported)
8-172 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Verification Directives
• A property (or sequence) by itself does nothing. It must appear within
a verification statement to be evaluated.
8-173 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Assertions in SV - Immediate
8-177 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Implication |-> |=>
Using the implication ( |->, |=> ) operators you can specify a prerequisite
sequence that implies another sequence. Typically this reduces failures
that you expect and wish to ignore.
Think of it this way: If the antecedent matches, the consequent must too.
If the antecedent fails, the consequent is not tested and a true result is
forced. Such forced true results are called “vacuous” and Questa does
NOT report them as they would pollute the coverage statistics.
8-178 • SV for Verification Using Questa: Functional Coverage Copyright © 2005 Mentor Graphics Corporation
Lab 14
1. Define a module with the following ports:
clk and req. [Signals are defined on the
testbench]
2. Define a property that captures back to back
requests
1. Whenever a back2back request does not occur
an error message should be generated.
2. Hint: Use property..endproperty
3. Hint: Use assert property
4. Hint: req changes are in sync with positive edge
of clk
A covergroup is a Example
container that can hold one covergroup cg_name
or more coverpoints. coverpoint s0 iff(!reset);
endgroup
It can be triggered
procedurally using sample()
or through trigger events.
Values of coverpoints inside
covergroup are sampled at
the trigger condition.
The trigger condition can be
a sequence as well.
cross
10x4
combinations
cross
16 cross
4 cross
combinations
combinations
<a1,b1
a1,b2
a1.b3
a1,b4>
binsof (a.a2)
cross
[0:63] [64:127] [128:191] [192:255] 0 [1:84] [85:169] [170:255]
a1 a2 a3 a4 b1 b2 [0:63]b3 b4
[64:127] [128:191] [192:255] 0 [1:84] [85:169] [170:255]
a1 a2 a3 a4 b1 b2 b3 b4
4 cross
combinations
<a2,b1
16 cross a2, b2
binsofcombinations
(b.b2) a2.b3
binsof(a.a2)
a2,b4> || binsof (b.b2)
4 cross
combinations
<b2,11 7 cross
b2, a2 combinations
[one is common]
b2.a3
b2,a4>