-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapb_config.sv
More file actions
59 lines (48 loc) · 1.54 KB
/
apb_config.sv
File metadata and controls
59 lines (48 loc) · 1.54 KB
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
class apb_config extends uvm_component;
//======================
// Factory registration
//======================
`uvm_component_utils(apb_config)
//======================
// Constructor
//======================
function new(string name = "apb_config", uvm_component parent = null);
super.new(name, parent);
endfunction
//======================
// Integer Arguments
//======================
int packets;
int start_addr;
bit read_write;
int incr ;
//======================
// String Arguments
//======================
string packets_str;
string start_addr_str;
string read_write_str;
string incr_str ;
//======================
// post_randomize()
//======================
function void post_randomize();
uvm_cmdline_processor clp = uvm_cmdline_processor::get_inst();
// no of packets to run
if (clp.get_arg_value("+PACKETS=", packets_str)) begin
packets = packets_str.atoi();
end
// start address
if (clp.get_arg_value("+START_ADDR=", start_addr_str)) begin
start_addr = start_addr_str.atohex();
end
// select between write and read transactions , 0 for read 1 for write
if(clp.get_arg_value("+RW=" , read_write_str)) begin
read_write = read_write_str.atoi();
end
// used to increment address in apb_vip_sequence based upon the address width
if(clp.get_arg_value("+INCR=" , incr_str)) begin
incr = incr_str.atoi();
end
endfunction
endclass