1 |
15 |
juko |
/*
|
2 |
|
|
* .--------------. .----------------. .------------.
|
3 |
|
|
* | .------------. | .--------------. | .----------. |
|
4 |
|
|
* | | ____ ____ | | | ____ ____ | | | ______ | |
|
5 |
|
|
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || |
|
6 |
|
|
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| |
|
7 |
|
|
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | |
|
8 |
|
|
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| |
|
9 |
|
|
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| |
|
10 |
|
|
* | | | | | | | | | | | |
|
11 |
|
|
* |_| | '------------' | '--------------' | '----------' |
|
12 |
|
|
* '--------------' '----------------' '------------'
|
13 |
|
|
*
|
14 |
|
|
* openHMC - An Open Source Hybrid Memory Cube Controller
|
15 |
|
|
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg
|
16 |
|
|
* www.ziti.uni-heidelberg.de
|
17 |
|
|
* B6, 26
|
18 |
|
|
* 68159 Mannheim
|
19 |
|
|
* Germany
|
20 |
|
|
*
|
21 |
|
|
* Contact: openhmc@ziti.uni-heidelberg.de
|
22 |
|
|
* http://ra.ziti.uni-heidelberg.de/openhmc
|
23 |
|
|
*
|
24 |
|
|
* This source file is free software: you can redistribute it and/or modify
|
25 |
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
26 |
|
|
* the Free Software Foundation, either version 3 of the License, or
|
27 |
|
|
* (at your option) any later version.
|
28 |
|
|
*
|
29 |
|
|
* This source file is distributed in the hope that it will be useful,
|
30 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
31 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
32 |
|
|
* GNU Lesser General Public License for more details.
|
33 |
|
|
*
|
34 |
|
|
* You should have received a copy of the GNU Lesser General Public License
|
35 |
|
|
* along with this source file. If not, see .
|
36 |
|
|
*
|
37 |
|
|
*
|
38 |
|
|
*/
|
39 |
|
|
`ifndef HMC_RESPONDER_AGENT_SV
|
40 |
|
|
`define HMC_RESPONDER_AGENT_SV
|
41 |
|
|
|
42 |
|
|
class hmc_responder_agent #(parameter NUM_LANES = 16)extends uvm_agent;
|
43 |
|
|
|
44 |
|
|
uvm_active_passive_enum active_passive = UVM_PASSIVE;
|
45 |
|
|
|
46 |
|
|
hmc_monitor#(.NUM_LANES(NUM_LANES)) monitor;
|
47 |
|
|
hmc_status h_status;
|
48 |
|
|
|
49 |
|
|
hmc_responder_driver #(.NUM_LANES(NUM_LANES)) driver;
|
50 |
|
|
hmc_responder_sequencer sequencer;
|
51 |
|
|
hmc_token_handler token_handler;
|
52 |
|
|
hmc_retry_buffer retry_buffer;
|
53 |
|
|
|
54 |
|
|
hmc_transaction_mon req_transaction_mon;
|
55 |
|
|
|
56 |
|
|
virtual interface hmc_sr_if#(.NUM_LANES(NUM_LANES)) vif;
|
57 |
|
|
|
58 |
|
|
`uvm_component_param_utils_begin(hmc_responder_agent#(.NUM_LANES(NUM_LANES)))
|
59 |
|
|
`uvm_field_enum(uvm_active_passive_enum, active_passive, UVM_DEFAULT)
|
60 |
|
|
`uvm_component_utils_end
|
61 |
|
|
|
62 |
|
|
function new(string name="hmc_responder_agent", uvm_component parent);
|
63 |
|
|
super.new(name,parent);
|
64 |
|
|
endfunction : new
|
65 |
|
|
|
66 |
|
|
function void build_phase(uvm_phase phase);
|
67 |
|
|
super.build_phase(phase);
|
68 |
|
|
|
69 |
|
|
if(active_passive == UVM_ACTIVE) begin
|
70 |
|
|
driver = hmc_responder_driver#(.NUM_LANES(NUM_LANES))::type_id::create("driver", this);
|
71 |
|
|
sequencer = hmc_responder_sequencer::type_id::create("sequencer",this);
|
72 |
|
|
token_handler = hmc_token_handler::type_id::create("token_handler",this);
|
73 |
|
|
retry_buffer = hmc_retry_buffer::type_id::create("retry_buffer",this);
|
74 |
|
|
end
|
75 |
|
|
|
76 |
|
|
if(uvm_config_db#(virtual interface hmc_sr_if#(.NUM_LANES(NUM_LANES)))::get(this, "", "vif",vif) ) begin
|
77 |
|
|
this.vif = vif;
|
78 |
|
|
|
79 |
|
|
uvm_config_db#(virtual interface hmc_sr_if#(.NUM_LANES(NUM_LANES)))::set(this, "driver","vif",vif);
|
80 |
|
|
end
|
81 |
|
|
|
82 |
|
|
if(!uvm_config_db#(hmc_status)::get(this, "", "h_status",h_status) ) begin
|
83 |
|
|
`uvm_fatal(get_type_name(),"hmc_status is not set")
|
84 |
|
|
end
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
endfunction : build_phase
|
88 |
|
|
|
89 |
|
|
function void connect_phase(uvm_phase phase);
|
90 |
|
|
super.connect_phase(phase);
|
91 |
|
|
|
92 |
|
|
if(active_passive == UVM_ACTIVE) begin
|
93 |
|
|
driver.seq_item_port.connect(sequencer.seq_item_export);
|
94 |
|
|
|
95 |
|
|
driver.token_handler = token_handler;
|
96 |
|
|
driver.retry_buffer = retry_buffer;
|
97 |
|
|
|
98 |
|
|
driver.remote_status = h_status.Requester_link_status;
|
99 |
|
|
|
100 |
|
|
monitor.frp_port.connect(driver.hmc_frp_port);
|
101 |
|
|
req_transaction_mon.transaction_finished_port.connect(sequencer.hmc_req_port);
|
102 |
|
|
monitor.return_token_port.connect(token_handler.token_imp);
|
103 |
|
|
monitor.rrp_port.connect(retry_buffer.return_pointer_imp);
|
104 |
|
|
driver.start_clear_retry_event = monitor.start_clear_retry_event;
|
105 |
|
|
end
|
106 |
|
|
|
107 |
|
|
endfunction : connect_phase
|
108 |
|
|
|
109 |
|
|
endclass : hmc_responder_agent
|
110 |
|
|
|
111 |
|
|
`endif // HMC_RESPONDER_AGENT_SV
|