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

Subversion Repositories openhmc

[/] [openhmc/] [trunk/] [openHMC/] [sim/] [tb/] [bfm/] [src/] [hmc_link_config.sv] - Blame information for rev 12

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
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 HMC_LINK_CONFIG_SV
41
`define HMC_LINK_CONFIG_SV
42
 
43
class hmc_link_config extends uvm_object;
44
 
45
//--
46
//-- variables
47
//--
48
 
49
        rand int                        hmc_tokens;
50
        rand int                        rx_tokens;
51
        rand bit [2:0]          cube_id;
52
 
53
        rand bit                        cfg_tx_lane_reverse;
54
        rand bit [15:0]         cfg_hsstx_inv;
55
        rand bit                        cfg_scram_enb;
56
        rand bit [15:0]         cfg_tx_lane_delay[16]   = '{16{4'h0}};
57
        rand bit [ 3:0]         cfg_retry_limit                 = 3;    //-- LINKRETRY - infinite retry when cfg_retry_limit[3] == 1
58
        rand bit [ 2:0]         cfg_retry_timeout               = 5;
59
 
60
        rand bit                        cfg_check_pkt                   = 1;    //-- check for valid packet
61
 
62
        bit                             cfg_lane_auto_correct   = 1;
63
        bit                             cfg_rsp_open_loop               = 0;
64
        int                             cfg_rx_clk_ratio                = 40;
65
        bit                             cfg_half_link_mode_rx   = (2**`LOG_NUM_LANES==8);
66
        bit [7:0]                       cfg_tx_rl_lim                   = 85;
67
        int                             cfg_tx_clk_ratio                = 40;
68
        bit                             cfg_half_link_mode_tx   = (2**`LOG_NUM_LANES==8);
69
        bit [7:0]                       cfg_init_retry_rxcnt    = 16;
70
        bit [7:0]                       cfg_init_retry_txcnt    = 6;    //-- Actual value in BFM is 4times this value
71
        realtime                        cfg_tsref                               = 1us;
72
        realtime                        cfg_top                                 = 1us;
73
 
74
        bit                             cfg_retry_enb                   = 1;
75
 
76
        //-- error injection is defined in 0.1% granularity
77
    rand int unsigned   cfg_rsp_dln,    cfg_rsp_lng,            cfg_rsp_crc,    cfg_rsp_seq,
78
                                                cfg_rsp_dinv,   cfg_rsp_errstat,        cfg_rsp_err,    cfg_rsp_poison,
79
                                                cfg_req_dln,    cfg_req_lng,            cfg_req_crc,    cfg_req_seq;
80
 
81
//--
82
//-- constrains
83
//--
84
 
85
        constraint hmc_tokens_c {
86
                hmc_tokens >= 25;
87
                soft hmc_tokens dist{[25:30]:/5, [31:100]:/15, [101:1023]:/80};
88
        }
89
 
90
        constraint cfg_hsstx_inv_c {
91
                cfg_hsstx_inv >= 0;
92
        }
93
 
94
        constraint rx_tokens_c {
95
                rx_tokens >= 9;
96
                soft rx_tokens dist{[9:30]:/5, [31:100]:/15, [101:1023]:/80};
97
        }
98
 
99
        constraint cube_id_c {
100
                cube_id >= 0;
101
                soft cube_id == 0;
102
        }
103
        constraint lane_delay_c{
104
                foreach (cfg_tx_lane_delay[i]) {
105
                        cfg_tx_lane_delay[i] >= 0;
106
                        cfg_tx_lane_delay[i] <= 8;
107
                }
108
        }
109
 
110
        constraint retry_timeout_c {
111
                cfg_retry_timeout == 7;
112
        }
113
 
114
 
115
        constraint error_rates_c {
116
                soft cfg_rsp_dln        == 5;
117
                soft cfg_rsp_lng        == 5;
118
                soft cfg_rsp_crc        == 5;
119
                soft cfg_rsp_seq        == 5;
120
                soft cfg_rsp_poison     == 5;
121
 
122
                soft cfg_req_dln        == 5;
123
                soft cfg_req_lng        == 5;
124
                soft cfg_req_crc        == 5;
125
                soft cfg_req_seq        == 0; // Must be zero for BFM 28965 !
126
 
127
 
128
        (
129
        cfg_rsp_dln          ||
130
        cfg_rsp_lng          ||
131
        cfg_rsp_crc          ||
132
        cfg_rsp_seq          ||
133
        cfg_rsp_dinv         ||
134
        cfg_rsp_errstat      ||
135
        cfg_rsp_err          ||
136
        cfg_rsp_poison       ||
137
 
138
        cfg_req_dln          ||
139
        cfg_req_lng          ||
140
        cfg_req_crc          ||
141
        cfg_req_seq
142
        ) -> {
143
            cfg_check_pkt      == 0; //-- disable packet checking
144
            cfg_retry_limit[3] == 1; //-- enable infinite retry
145
        }
146
        }
147
 
148
 
149
        `uvm_object_utils_begin(hmc_link_config)
150
                `uvm_field_int(hmc_tokens, UVM_DEFAULT)
151
                `uvm_field_int(rx_tokens, UVM_DEFAULT)
152
        `uvm_object_utils_end
153
 
154
        function new(string name = "hmc_link_config");
155
                super.new(name);
156
        endfunction : new
157
 
158
        virtual function void do_print (uvm_printer printer);
159
                super.do_print(printer);
160
        endfunction : do_print
161
 
162
endclass : hmc_link_config
163
 
164
`endif // AXI4_STREAM_CONFIG_SV

powered by: WebSVN 2.1.0

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