1 |
12 |
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 |
|
|
|
40 |
|
|
`ifndef CAG_RGM_RFS_ENV_SV
|
41 |
|
|
`define CAG_RGM_RFS_ENV_SV
|
42 |
|
|
|
43 |
|
|
class cag_rgm_rfs_env #(
|
44 |
|
|
parameter ADDR_WIDTH = 6,
|
45 |
|
|
parameter WRITE_DATA_WIDTH = 64,
|
46 |
|
|
parameter READ_DATA_WIDTH = 64
|
47 |
|
|
) extends uvm_env;
|
48 |
|
|
|
49 |
|
|
uvm_active_passive_enum is_active = UVM_ACTIVE;
|
50 |
|
|
|
51 |
|
|
cag_rgm_rfs_driver #(.ADDR_WIDTH(ADDR_WIDTH), .READ_DATA_WIDTH(READ_DATA_WIDTH), .WRITE_DATA_WIDTH(WRITE_DATA_WIDTH)) driver;
|
52 |
|
|
cag_rgm_rfs_monitor #(.ADDR_WIDTH(ADDR_WIDTH), .READ_DATA_WIDTH(READ_DATA_WIDTH), .WRITE_DATA_WIDTH(WRITE_DATA_WIDTH)) monitor;
|
53 |
|
|
|
54 |
|
|
cag_rgm_sequencer sequencer;
|
55 |
|
|
|
56 |
|
|
`uvm_component_param_utils_begin(cag_rgm_rfs_env #(.ADDR_WIDTH(ADDR_WIDTH), .READ_DATA_WIDTH(READ_DATA_WIDTH), .WRITE_DATA_WIDTH(WRITE_DATA_WIDTH)))
|
57 |
|
|
`uvm_field_enum(uvm_active_passive_enum, is_active, UVM_ALL_ON)
|
58 |
|
|
`uvm_component_utils_end
|
59 |
|
|
|
60 |
|
|
function new(string name="cag_rgm_rfs_env", uvm_component parent);
|
61 |
|
|
super.new(name,parent);
|
62 |
|
|
endfunction : new
|
63 |
|
|
|
64 |
|
|
function void build();
|
65 |
|
|
super.build();
|
66 |
|
|
|
67 |
|
|
monitor = cag_rgm_rfs_monitor #(.ADDR_WIDTH(ADDR_WIDTH), .READ_DATA_WIDTH(READ_DATA_WIDTH), .WRITE_DATA_WIDTH(WRITE_DATA_WIDTH))::type_id::create("monitor",this);
|
68 |
|
|
|
69 |
|
|
if(is_active == UVM_ACTIVE) begin
|
70 |
|
|
driver = cag_rgm_rfs_driver #(.ADDR_WIDTH(ADDR_WIDTH), .READ_DATA_WIDTH(READ_DATA_WIDTH), .WRITE_DATA_WIDTH(WRITE_DATA_WIDTH))::type_id::create("driver",this);
|
71 |
|
|
|
72 |
|
|
sequencer = cag_rgm_sequencer::type_id::create("sequencer",this);
|
73 |
|
|
end
|
74 |
|
|
|
75 |
|
|
endfunction : build
|
76 |
|
|
|
77 |
|
|
function void connect();
|
78 |
|
|
super.connect();
|
79 |
|
|
|
80 |
|
|
if(is_active == UVM_ACTIVE) begin
|
81 |
|
|
driver.seq_item_port.connect(sequencer.seq_item_export);
|
82 |
|
|
monitor.response_port.connect(sequencer.resp_port);
|
83 |
|
|
end
|
84 |
|
|
endfunction : connect
|
85 |
|
|
|
86 |
|
|
function void assign_vi( virtual interface cag_rgm_rfs_if #(.ADDR_WIDTH(ADDR_WIDTH), .READ_DATA_WIDTH(READ_DATA_WIDTH), .WRITE_DATA_WIDTH(WRITE_DATA_WIDTH)) vif);
|
87 |
|
|
monitor.assign_vi(vif);
|
88 |
|
|
if(is_active == UVM_ACTIVE)
|
89 |
|
|
driver.assign_vi(vif);
|
90 |
|
|
endfunction : assign_vi
|
91 |
|
|
|
92 |
|
|
function void set_rf(cag_rgm_register_file rf);
|
93 |
|
|
if(is_active == UVM_ACTIVE)
|
94 |
|
|
sequencer.set_rf(rf);
|
95 |
|
|
endfunction : set_rf
|
96 |
|
|
|
97 |
|
|
endclass : cag_rgm_rfs_env
|
98 |
|
|
|
99 |
|
|
`endif // CAG_RGM_RFS_ENV_SV
|