-
Notifications
You must be signed in to change notification settings - Fork 4
/
agent.sv
33 lines (26 loc) · 1.03 KB
/
agent.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
class agent extends uvm_agent;
typedef uvm_sequencer#(transaction_in) sequencer;
sequencer sqr;
driver drv;
monitor mon;
uvm_analysis_port #(transaction_in) agt_req_port;
uvm_analysis_port #(transaction_out) agt_resp_port;
`uvm_component_utils(agent)
function new(string name = "agent", uvm_component parent = null);
super.new(name, parent);
agt_req_port = new("agt_req_port", this);
agt_resp_port = new("agt_resp_port", this);
endfunction
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
mon = monitor::type_id::create("mon", this);
sqr = sequencer::type_id::create("sqr", this);
drv = driver::type_id::create("drv", this);
endfunction
virtual function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
mon.req_port.connect(agt_req_port);
mon.resp_port.connect(agt_resp_port);
drv.seq_item_port.connect(sqr.seq_item_export);
endfunction
endclass: agent