-
Notifications
You must be signed in to change notification settings - Fork 3
/
wdog_reset_generator.sv
43 lines (33 loc) · 1.08 KB
/
wdog_reset_generator.sv
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
// Class: wdog_reset_generator
//
class wdog_reset_generator extends uvm_component;
`uvm_component_utils(wdog_reset_generator);
// Group: Configuration Object(s)
env_config env_cfg;
// Group: Components
virtual wdog_intf intf;
// Constructor: new
function new(string name = "wdog_reset_generator", uvm_component parent);
super.new(name, parent);
endfunction: new
task reset_frc();
intf.WDOGRESn <= 0;
#1;
@(posedge intf.wdogclk);
intf.WDOGRESn <= 1;
endtask
task reset_module();
intf.PRESETn <= 0;
#1;
@(posedge intf.pclk);
intf.PRESETn <= 1;
endtask
function void build_phase(uvm_phase phase);
if (!uvm_config_db#(env_config)::get(this, "", "env_cfg", env_cfg))
`uvm_fatal(get_name(), "env_cfg cannot be found in ConfigDB!")
endfunction: build_phase
function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
intf = env_cfg.intf;
endfunction: connect_phase
endclass: wdog_reset_generator