-
Notifications
You must be signed in to change notification settings - Fork 1
/
rggen_ral_reg_file.svh
39 lines (34 loc) · 997 Bytes
/
rggen_ral_reg_file.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
class rggen_ral_reg_file extends rggen_ral_block;
protected int array_index[$];
function new(string name, int unsigned n_bytes, int has_coverage);
super.new(name, n_bytes, has_coverage);
endfunction
function void configure(
uvm_reg_block parent,
int array_index[$],
string hdl_path
);
super.configure(parent, hdl_path);
foreach (array_index[i]) begin
this.array_index.push_back(array_index[i]);
end
endfunction
virtual function uvm_reg_block get_parent_block();
rggen_ral_reg_file file;
rggen_ral_block block;
if ($cast(file, get_parent())) begin
return file.get_parent_block();
end
else if ($cast(block, get_parent())) begin
return block;
end
else begin
return null;
end
endfunction
virtual function void get_array_index(ref int array_index[$]);
foreach (this.array_index[i]) begin
array_index.push_back(this.array_index[i]);
end
endfunction
endclass