This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class fibonacci; | |
rand int unsigned f_ary[]; | |
rand int unsigned fibonacci_length; | |
constraint f_ary_size_cn { | |
f_ary.size() == fibonacci_length; | |
} | |
constraint f_ary_cn { | |
foreach (f_ary[i]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static function bit from_name( | |
string name, // String which will be converted into enumerated value | |
ref T value // enumerated value | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function automatic void uvm_split_string ( | |
string str, // Actual string which users wants to split into substring | |
byte sep, // Delimeter | |
ref string values[$] // Reference queue of substring | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum {VAL0, VAL1, VAL2, VAL3, VAL4} val_e; | |
typedef uvm_enum_wrapper#(val_e) uvm_vt; | |
module top(); | |
val_e vt; | |
string str; | |
val_e vt_q[$]; | |
string str_q[$]; | |
initial begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum {VAL0, VAL1, VAL2, VAL3, VAL4} val_e; | |
typedef uvm_enum_wrapper#(val_e) uvm_vt; | |
module top(); | |
val_e vt; | |
string str; | |
initial begin | |
#5; | |
if ($value$plusargs("VAL_E=%0s", str)) begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum {VAL0, VAL1, VAL2, VAL3, VAL4} val_e; | |
module top(); | |
val_e vt; | |
string str; | |
bit match; | |
initial begin | |
#5; | |
if ($value$plusargs("VAL_E=%0s", str)) begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class my_seq_item extends uvm_sequence_item; | |
rand bit [31:0] data; | |
rand bit [7:0] addr; | |
`uvm_object_utils_begin(my_seq_item) | |
`uvm_field_int(addr, UVM_DEFAULT | UVM_HEX) | |
`uvm_field_int(data, UVM_DEFAULT | UVM_HEX) | |
`uvm_object_utils_end | |
function new (string name = "my_seq_item"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class my_seq_item extends uvm_sequence_item; | |
rand bit [31:0] data; | |
rand bit [7:0] addr; | |
`uvm_object_utils_begin(my_seq_item) | |
`uvm_field_int(addr, UVM_DEFAULT | UVM_HEX) | |
`uvm_field_int(data, UVM_DEFAULT | UVM_HEX) | |
`uvm_object_utils_end | |
function new (string name = "my_seq_item"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class my_seq_item extends uvm_sequence_item; | |
rand bit [31:0] data; | |
rand bit [7:0] addr; | |
`uvm_object_utils_begin(my_seq_item) | |
`uvm_field_int(addr, UVM_DEFAULT | UVM_HEX) | |
`uvm_field_int(data, UVM_DEFAULT | UVM_HEX) | |
`uvm_object_utils_end | |
function new (string name = "my_seq_item"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class my_object extends uvm_object; | |
integer a; | |
`uvm_object_utils_begin(my_object) | |
`uvm_field_int(a, UVM_DEFAULT | UVM_DEC) | |
`uvm_object_utils_end | |
function new(string name = "my_object"); | |
super.new(name); | |
endfunction : new |
NewerOlder