OpenCores
URL https://opencores.org/ocsvn/openhmc/openhmc/trunk

Subversion Repositories openhmc

[/] [openhmc/] [trunk/] [openHMC/] [sim/] [UVC/] [hmc/] [sv/] [hmc_requester_agent.sv] - Blame information for rev 15

Details | Compare with Previous | View Log

Line No. Rev Author Line
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_REQUESTER_AGENT_SV
40
`define HMC_REQUESTER_AGENT_SV
41
 
42
/* Agent is incomplete and not tested in ACTIVE State */
43
/* Use at your own risk */
44
 
45
class hmc_requester_agent #(parameter NUM_LANES = 16) extends uvm_agent;
46
 
47
        uvm_active_passive_enum active_passive = UVM_PASSIVE;
48
 
49
        hmc_monitor#(.NUM_LANES(NUM_LANES)) monitor;
50
 
51
        hmc_requester_driver#(.NUM_LANES(NUM_LANES)) driver;
52
        hmc_requester_sequencer                       sequencer;
53
        hmc_token_handler                             token_handler;
54
        hmc_retry_buffer                              retry_buffer;
55
        virtual interface hmc_sr_if#(.NUM_LANES(NUM_LANES)) vif;
56
 
57
        `uvm_component_param_utils_begin(hmc_requester_agent # (.NUM_LANES(NUM_LANES)))
58
                `uvm_field_enum(uvm_active_passive_enum, active_passive, UVM_DEFAULT)
59
        `uvm_component_utils_end
60
 
61
        function new(string name="hmc_requester_agent", uvm_component parent);
62
                super.new(name,parent);
63
        endfunction : new
64
 
65
        function void build_phase(uvm_phase phase);
66
                super.build_phase(phase);
67
 
68
                if(active_passive == UVM_ACTIVE) begin
69
                        driver        = hmc_requester_driver#(.NUM_LANES(NUM_LANES))::type_id::create("driver", this);
70
                        sequencer     = hmc_requester_sequencer::type_id::create("sequencer",this);
71
                        token_handler = hmc_token_handler::type_id::create("token_handler",this);
72
                        retry_buffer  = hmc_retry_buffer::type_id::create("retry_buffer",this);
73
                end
74
 
75
                if(uvm_config_db#(virtual interface hmc_sr_if#(.NUM_LANES(NUM_LANES)))::get(this, "", "vif",vif) ) begin
76
                        this.vif = vif;
77
                        uvm_config_db#(virtual interface hmc_sr_if#(.NUM_LANES(NUM_LANES)))::set(this, "driver","vif",vif);
78
                end
79
        endfunction : build_phase
80
 
81
        function void connect_phase(uvm_phase phase);
82
                super.connect_phase(phase);
83
 
84
                if(active_passive == UVM_ACTIVE) begin
85
                        driver.seq_item_port.connect(sequencer.seq_item_export);
86
 
87
                        driver.token_handler = token_handler;
88
                        driver.retry_buffer  = retry_buffer;
89
 
90
                        driver.remote_status = monitor.status.Responder_link_status;
91
 
92
                        monitor.frp_port.connect(driver.hmc_frp_port);
93
                        monitor.item_collected_port.connect(sequencer.hmc_req_port);
94
                        monitor.return_token_port.connect(token_handler.token_imp);
95
                        monitor.rrp_port.connect(retry_buffer.return_pointer_imp);
96
                end
97
        endfunction : connect_phase
98
 
99
endclass : hmc_requester_agent
100
 
101
`endif // HMC_REQUESTER_AGENT_SV

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.