-
Notifications
You must be signed in to change notification settings - Fork 0
/
uvm_box.svh
167 lines (129 loc) · 2.78 KB
/
uvm_box.svh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
`ifndef UVM_BOX__SVH
`define UVM_BOX__SVH
class uvm_box_base extends uvm_object;
// Function: new
//
function new(string name="");
super.new(name);
endfunction : new
endclass : uvm_box_base
// class: uvm_box #(T)
//
class uvm_box #(type T=longint) extends uvm_box_base;
`uvm_object_param_utils(uvm_box #(T))
typedef uvm_box #(T) this_type;
protected T this_val;
// Function: new
//
protected function new(string name="uvm_box");
super.new(name);
endfunction : new
// Function: to_void
//
function void to_void;
endfunction: to_void
// Function: new_box
//
static function this_type new_box(string name="");
new_box = new(name);
endfunction : new_box
// Function: get_box
//
// Alias to new_box
//
static function this_type get_box(string name="");
get_box = new_box(name);
endfunction : get_box
// Function: set
//
function this_type set(T v);
this_val = v;
return this;
endfunction : set
// Function: get
//
function T get;
get = this_val;
endfunction : get
endclass : uvm_box
// class: uvm_box_array #(T)
//
class uvm_box_array #(type T=int) extends uvm_box_base;
`uvm_object_param_utils(uvm_box_array #(T))
typedef uvm_box_array #(T) this_type;
typedef T array_t[$];
protected array_t this_val;
// Function: new
//
protected function new(string name="uvm_box_array");
super.new(name);
endfunction : new
// Function: to_void
//
function void to_void;
endfunction: to_void
// Function: new_box
//
static function this_type new_box(string name="");
new_box = new(name);
endfunction : new_box
// Function: get_box
//
// Alias to new_box
//
static function this_type get_box(string name="");
get_box = new_box(name);
endfunction : get_box
// Function: set
//
function this_type set(array_t v);
this_val = v;
return this;
endfunction : set
// Function: get
//
function array_t get;
get = this_val;
endfunction : get
endclass : uvm_box_array
// class: uvm_box_vector #(T, S)
//
class uvm_box_vector #(type T=logic, int S) extends uvm_box_base;
`uvm_object_param_utils(uvm_box_vector #(T, S))
typedef uvm_box_vector #(T, S) this_type;
typedef T [S-1:0] vector_t;
protected vector_t this_val;
// Function: new
//
protected function new(string name="uvm_box_vector");
super.new(name);
endfunction : new
// Function: to_void
//
function void to_void;
endfunction: to_void
// Function: new_box
//
static function this_type new_box(string name="");
new_box = new(name);
endfunction : new_box
// Function: get_box
//
// Alias to new_box
//
static function this_type get_box(string name="");
get_box = new_box(name);
endfunction : get_box
// Function: set
//
function this_type set(vector_t v);
this_val = v;
return this;
endfunction : set
// Function: get
//
function vector_t get;
get = this_val;
endfunction : get
endclass : uvm_box_vector
`endif // UVM_BOX__SVH