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

Subversion Repositories openhmc

[/] [openhmc/] [trunk/] [openHMC/] [rtl/] [hmc_controller/] [openhmc_top.v] - Blame information for rev 11

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

Line No. Rev Author Line
1 11 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 <http://www.gnu.org/licenses/>.
36
 *
37
 *
38
 *  Module name: hmc_controller_top
39
 *
40
 */
41
 
42
`default_nettype none
43
 
44
module openhmc_top #(
45
    //Define width of the datapath
46
    parameter LOG_FPW               = 2,        //Legal Values: 1,2,3
47
    parameter FPW                   = 4,        //Legal Values: 2,4,6,8
48
    parameter DWIDTH                = FPW*128,  //Leave untouched
49
    //Define HMC interface width
50
    parameter LOG_NUM_LANES         = 3,                //Set 3 for half-width, 4 for full-width
51
    parameter NUM_LANES             = 2**LOG_NUM_LANES, //Leave untouched
52
    parameter NUM_DATA_BYTES        = FPW*16,           //Leave untouched
53
    //Define width of the register file
54
    parameter HMC_RF_WWIDTH         = 64,
55
    parameter HMC_RF_RWIDTH         = 64,
56
    parameter HMC_RF_AWIDTH         = 4,
57
    //Configure the Functionality
58
    parameter LOG_MAX_RTC           = 8,    //Set the depth of the RX input buffer. Must be >= LOG(rf_rx_buffer_rtc) in the RF
59
    parameter HMC_RX_AC_COUPLED     = 1,    //Set to 0 to remove the run length limiter, saves logic and 1 cycle delay
60
    parameter CTRL_LANE_POLARITY    = 1,    //Set to 0 if lane polarity is not applicable or performed by the transceivers, saves logic and 1 cycle delay
61
    parameter CTRL_LANE_REVERSAL    = 1,    //Set to 0 if lane reversal is not applicable or performed by the transceivers, saves logic
62
    //Set the direction of bitslip. Set to 1 if bitslip performs a shift right, otherwise set to 0 (see the corresponding transceiver user guide)
63
    parameter BITSLIP_SHIFT_RIGHT   = 1,
64
    //Debug Params
65
    parameter DBG_RX_TOKEN_MON      = 1     //Remove the RX Link token monitor, saves logic
66
) (
67
    //----------------------------------
68
    //----SYSTEM INTERFACES
69
    //----------------------------------
70
    input  wire                         clk_user,
71
    input  wire                         clk_hmc,
72
    input  wire                         res_n_user,
73
    input  wire                         res_n_hmc,
74
 
75
    //----------------------------------
76
    //----Connect AXI Ports
77
    //----------------------------------
78
    //From AXI to HMC Ctrl TX
79
    input  wire                         s_axis_tx_TVALID,
80
    output wire                         s_axis_tx_TREADY,
81
    input  wire [DWIDTH-1:0]            s_axis_tx_TDATA,
82
    input  wire [NUM_DATA_BYTES-1:0]    s_axis_tx_TUSER,
83
    //From HMC Ctrl RX to AXI
84
    output wire                         m_axis_rx_TVALID,
85
    input  wire                         m_axis_rx_TREADY,
86
    output wire [DWIDTH-1:0]            m_axis_rx_TDATA,
87
    output wire [NUM_DATA_BYTES-1:0]    m_axis_rx_TUSER,
88
 
89
    //----------------------------------
90
    //----Connect Transceiver
91
    //----------------------------------
92
    output wire  [DWIDTH-1:0]           phy_data_tx_link2phy,
93
    input  wire  [DWIDTH-1:0]           phy_data_rx_phy2link,
94
    output wire  [NUM_LANES-1:0]        phy_bit_slip,
95
    output wire  [NUM_LANES-1:0]        phy_lane_polarity,  //All 0 if CTRL_LANE_POLARITY=1
96
    input  wire                         phy_ready,
97
 
98
    //----------------------------------
99
    //----Connect HMC
100
    //----------------------------------
101
    output wire                         P_RST_N,
102
    output wire                         hmc_LxRXPS,
103
    input  wire                         hmc_LxTXPS,
104
    input  wire                         FERR_N, //Not connected
105
 
106
    //----------------------------------
107
    //----Connect RF
108
    //----------------------------------
109
    input  wire  [HMC_RF_AWIDTH-1:0]    rf_address,
110
    output wire  [HMC_RF_RWIDTH-1:0]    rf_read_data,
111
    output wire                         rf_invalid_address,
112
    output wire                         rf_access_complete,
113
    input  wire                         rf_read_en,
114
    input  wire                         rf_write_en,
115
    input  wire  [HMC_RF_WWIDTH-1:0]    rf_write_data
116
 
117
    );
118
 
119
//=====================================================================================================
120
//-----------------------------------------------------------------------------------------------------
121
//---------WIRING AND SIGNAL STUFF---------------------------------------------------------------------
122
//-----------------------------------------------------------------------------------------------------
123
//=====================================================================================================
124
 
125
// ----Assign AXI interface wires
126
wire [4*FPW-1:0]            m_axis_rx_TUSER_temp;
127
assign                      m_axis_rx_TUSER = {{NUM_DATA_BYTES-(4*FPW){1'b0}}, m_axis_rx_TUSER_temp};
128
 
129
wire                        s_axis_tx_TREADY_n;
130
assign s_axis_tx_TREADY =   ~s_axis_tx_TREADY_n;
131
 
132
wire                        m_axis_rx_TVALID_n;
133
assign m_axis_rx_TVALID =   ~m_axis_rx_TVALID_n;
134
 
135
// ----TX FIFO Wires
136
wire    [DWIDTH-1:0]        tx_d_in_data;
137
wire                        tx_shift_out;
138
wire                        tx_empty;
139
wire                        tx_a_empty;
140
wire    [3*FPW-1:0]         tx_d_in_ctrl;
141
 
142
// ----RX FIFO Wires
143
wire    [DWIDTH-1:0]        rx_d_in_data;
144
wire                        rx_shift_in;
145
wire                        rx_full;
146
wire                        rx_a_full;
147
wire    [4*FPW-1:0]         rx_d_in_ctrl;
148
 
149
// ----RX LINK TO TX LINK
150
wire                        rx2tx_link_retry;
151
wire                        rx2tx_error_abort_mode;
152
wire                        rx2tx_error_abort_mode_cleared;
153
wire    [7:0]               rx2tx_hmc_frp;
154
wire    [7:0]               rx2tx_rrp;
155
wire    [7:0]               rx2tx_returned_tokens;
156
wire    [LOG_FPW:0]         rx2tx_hmc_tokens_to_return;
157
wire    [LOG_FPW:0]         rx2tx_hmc_poisoned_tokens_to_return;
158
 
159
// ----Register File
160
//Counter
161
wire                        rf_cnt_retry;
162
wire                        rf_run_length_bit_flip;
163
wire                        rf_error_abort_not_cleared;
164
wire  [HMC_RF_RWIDTH-1:0]   rf_cnt_poisoned;
165
wire  [HMC_RF_RWIDTH-1:0]   rf_cnt_p;
166
wire  [HMC_RF_RWIDTH-1:0]   rf_cnt_np;
167
wire  [HMC_RF_RWIDTH-1:0]   rf_cnt_r;
168
wire  [HMC_RF_RWIDTH-1:0]   rf_cnt_rsp_rcvd;
169
//Status
170
wire [1:0]                  rf_link_status;
171
wire [2:0]                  rf_hmc_init_status;
172
wire [1:0]                  rf_tx_init_status;
173
wire [9:0]                  rf_hmc_tokens_av;
174
wire [9:0]                  rf_rx_tokens_av;
175
wire                        rf_hmc_sleep;
176
//Init Status
177
wire                        rf_all_descramblers_aligned;
178
wire [NUM_LANES-1:0]        rf_descrambler_aligned;
179
wire [NUM_LANES-1:0]        rf_descrambler_part_aligned;
180
//Control
181
wire [5:0]                  rf_bit_slip_time;
182
wire                        rf_hmc_init_cont_set;
183
wire                        rf_set_hmc_sleep;
184
wire                        rf_scrambler_disable;
185
wire [NUM_LANES-1:0]        rf_lane_polarity;
186
wire [NUM_LANES-1:0]        rf_descramblers_locked;
187
wire [9:0]                  rf_rx_buffer_rtc;
188
wire                        rf_lane_reversal_detected;
189
wire [4:0]                  rf_irtry_received_threshold;
190
wire [4:0]                  rf_irtry_to_send;
191
wire                        rf_run_length_enable;
192
wire [2:0]                  rf_first_cube_ID;
193
//Debug
194
wire                        rf_dbg_dont_send_tret;
195
wire                        rf_dbg_halt_on_error_abort;
196
wire                        rf_dbg_halt_on_tx_retry;
197
 
198
// ----Assign PHY wires
199
assign phy_lane_polarity = (CTRL_LANE_POLARITY==1) ? {NUM_LANES{1'b0}} : rf_lane_polarity;
200
 
201
//=====================================================================================================
202
//-----------------------------------------------------------------------------------------------------
203
//---------INSTANTIATIONS HERE-------------------------------------------------------------------------
204
//-----------------------------------------------------------------------------------------------------
205
//=====================================================================================================
206
//----------------------------------------------------------------------
207
//-----TX-----TX-----TX-----TX-----TX-----TX-----TX-----TX-----TX-----TX
208
//----------------------------------------------------------------------
209
 
210
openhmc_async_fifo #(
211
    .DWIDTH(DWIDTH+(FPW*3)),
212
    .ENTRIES(16)
213
) fifo_tx_data (
214
    //System
215
    .si_clk(clk_user),
216
    .so_clk(clk_hmc),
217
    .si_res_n(res_n_user),
218
    .so_res_n(res_n_hmc),
219
 
220
    //From AXI-4 TX IF
221
    .d_in({s_axis_tx_TUSER[(FPW*3)-1:0],s_axis_tx_TDATA}),
222
    .shift_in(s_axis_tx_TVALID && s_axis_tx_TREADY),
223
    .full(s_axis_tx_TREADY_n),
224
    .almost_full(),
225
 
226
    //To TX Link Logic
227
    .d_out({tx_d_in_ctrl,tx_d_in_data}),
228
    .shift_out(tx_shift_out),
229
    .empty(tx_empty),
230
    .almost_empty(tx_a_empty)
231
);
232
 
233
tx_link #(
234
    .LOG_FPW(LOG_FPW),
235
    .FPW(FPW),
236
    .NUM_LANES(NUM_LANES),
237
    .HMC_PTR_SIZE(8),
238
    .HMC_RF_RWIDTH(HMC_RF_RWIDTH),
239
    .HMC_RX_AC_COUPLED(HMC_RX_AC_COUPLED),
240
    //Debug
241
    .DBG_RX_TOKEN_MON(DBG_RX_TOKEN_MON)
242
) tx_link_I(
243
 
244
    //----------------------------------
245
    //----SYSTEM INTERFACE
246
    //----------------------------------
247
    .clk(clk_hmc),
248
    .res_n(res_n_hmc),
249
 
250
    //----------------------------------
251
    //----TO HMC PHY
252
    //----------------------------------
253
    .phy_scrambled_data_out(phy_data_tx_link2phy),
254
 
255
    //----------------------------------
256
    //----HMC IF
257
    //----------------------------------
258
    .hmc_LxRXPS(hmc_LxRXPS),
259
    .hmc_LxTXPS(hmc_LxTXPS),
260
 
261
    //----------------------------------
262
    //----FROM HMC_TX_HTAX_LOGIC
263
    //----------------------------------
264
    .d_in_data(tx_d_in_data),
265
    .d_in_flit_is_valid(tx_d_in_ctrl[FPW-1:0]),
266
    .d_in_flit_is_hdr(tx_d_in_ctrl[(2*FPW)-1:1*FPW]),
267
    .d_in_flit_is_tail(tx_d_in_ctrl[(3*FPW)-1:(2*FPW)]),
268
    .d_in_empty(tx_empty),
269
    .d_in_a_empty(tx_a_empty),
270
    .d_in_shift_out(tx_shift_out),
271
 
272
    //----------------------------------
273
    //----RX Block
274
    //----------------------------------
275
    .rx_force_tx_retry(rx2tx_link_retry),
276
    .rx_error_abort_mode(rx2tx_error_abort_mode),
277
    .rx_error_abort_mode_cleared(rx2tx_error_abort_mode_cleared),
278
    .rx_hmc_frp(rx2tx_hmc_frp),
279
    .rx_rrp(rx2tx_rrp),
280
    .rx_returned_tokens(rx2tx_returned_tokens),
281
    .rx_hmc_tokens_to_return(rx2tx_hmc_tokens_to_return),
282
    .rx_hmc_poisoned_tokens_to_return(rx2tx_hmc_poisoned_tokens_to_return),
283
 
284
    //----------------------------------
285
    //----RF
286
    //----------------------------------
287
    //Monitoring    1-cycle set to increment
288
    .rf_cnt_retry(rf_cnt_retry),
289
    .rf_sent_p(rf_cnt_p),
290
    .rf_sent_np(rf_cnt_np),
291
    .rf_sent_r(rf_cnt_r),
292
    .rf_run_length_bit_flip(rf_run_length_bit_flip),
293
    .rf_error_abort_not_cleared(rf_error_abort_not_cleared),
294
    //Status
295
    .rf_hmc_is_in_sleep(rf_hmc_sleep),
296
    .rf_hmc_received_init_null(rf_hmc_init_status[0]),
297
    .rf_link_is_up(rf_link_status[1]),
298
    .rf_descramblers_aligned(rf_all_descramblers_aligned),
299
    .rf_tx_init_status(rf_tx_init_status),
300
    .rf_hmc_tokens_av(rf_hmc_tokens_av),
301
    .rf_rx_tokens_av(rf_rx_tokens_av),
302
    //Control
303
    .rf_hmc_sleep_requested(rf_set_hmc_sleep),
304
    .rf_hmc_init_cont_set(rf_hmc_init_cont_set),
305
    .rf_scrambler_disable(rf_scrambler_disable),
306
    .rf_rx_buffer_rtc(rf_rx_buffer_rtc),
307
    .rf_first_cube_ID(rf_first_cube_ID),
308
    .rf_irtry_to_send(rf_irtry_to_send),
309
    .rf_run_length_enable(rf_run_length_enable),
310
    //Debug
311
    .rf_dbg_dont_send_tret(rf_dbg_dont_send_tret),
312
    .rf_dbg_halt_on_error_abort(rf_dbg_halt_on_error_abort),
313
    .rf_dbg_halt_on_tx_retry(rf_dbg_halt_on_tx_retry)
314
 
315
);
316
 
317
//----------------------------------------------------------------------
318
//-----RX-----RX-----RX-----RX-----RX-----RX-----RX-----RX-----RX-----RX
319
//----------------------------------------------------------------------
320
rx_link #(
321
    .LOG_FPW(LOG_FPW),
322
    .FPW(FPW),
323
    .LOG_NUM_LANES(LOG_NUM_LANES),
324
    .HMC_RF_RWIDTH(HMC_RF_RWIDTH),
325
    //Configure the functionality
326
    .LOG_MAX_RTC(LOG_MAX_RTC),
327
    .CTRL_LANE_POLARITY(CTRL_LANE_POLARITY),
328
    .CTRL_LANE_REVERSAL(CTRL_LANE_REVERSAL),
329
    .BITSLIP_SHIFT_RIGHT(BITSLIP_SHIFT_RIGHT)
330
) rx_link_I (
331
 
332
    //----------------------------------
333
    //----SYSTEM INTERFACE
334
    //----------------------------------
335
    .clk(clk_hmc),
336
    .res_n(res_n_hmc),
337
 
338
    //----------------------------------
339
    //----TO HMC PHY
340
    //----------------------------------
341
    .phy_scrambled_data_in(phy_data_rx_phy2link),
342
    .init_bit_slip(phy_bit_slip),
343
 
344
    //----------------------------------
345
    //----FROM TO RX HTAX FIFO
346
    //----------------------------------
347
    .d_out_fifo_data(rx_d_in_data),
348
    .d_out_fifo_full(rx_full),
349
    .d_out_fifo_a_full(rx_a_full),
350
    .d_out_fifo_shift_in(rx_shift_in),
351
    .d_out_fifo_ctrl(rx_d_in_ctrl),
352
 
353
    //----------------------------------
354
    //----TO TX Block
355
    //----------------------------------
356
    .tx_link_retry(rx2tx_link_retry),
357
    .tx_error_abort_mode(rx2tx_error_abort_mode),
358
    .tx_error_abort_mode_cleared(rx2tx_error_abort_mode_cleared),
359
    .tx_hmc_frp(rx2tx_hmc_frp),
360
    .tx_rrp(rx2tx_rrp),
361
    .tx_returned_tokens(rx2tx_returned_tokens),
362
    .tx_hmc_tokens_to_return(rx2tx_hmc_tokens_to_return),
363
    .tx_hmc_poisoned_tokens_to_return(rx2tx_hmc_poisoned_tokens_to_return),
364
 
365
    //----------------------------------
366
    //----RF
367
    //----------------------------------
368
    //Monitoring    1-cycle set to increment
369
    .rf_cnt_poisoned(rf_cnt_poisoned),
370
    .rf_cnt_rsp(rf_cnt_rsp_rcvd),
371
    //Status
372
    .rf_link_status(rf_link_status),
373
    .rf_hmc_init_status(rf_hmc_init_status),
374
    .rf_hmc_sleep(rf_hmc_sleep),
375
    //Init Status
376
    .rf_all_descramblers_aligned(rf_all_descramblers_aligned),
377
    .rf_descrambler_aligned(rf_descrambler_aligned),
378
    .rf_descrambler_part_aligned(rf_descrambler_part_aligned),
379
    .rf_descramblers_locked(rf_descramblers_locked),
380
    .rf_tx_sends_ts1(rf_tx_init_status[1] && !rf_tx_init_status[0]),
381
    //Control
382
    .rf_bit_slip_time(rf_bit_slip_time),
383
    .rf_hmc_init_cont_set(rf_hmc_init_cont_set),
384
    .rf_lane_polarity(rf_lane_polarity),
385
    .rf_scrambler_disable(rf_scrambler_disable),
386
    .rf_lane_reversal_detected(rf_lane_reversal_detected),
387
    .rf_irtry_received_threshold(rf_irtry_received_threshold)
388
);
389
 
390
openhmc_async_fifo #(
391
    .DWIDTH(DWIDTH+(FPW*4)),
392
    .ENTRIES(16)
393
) fifo_rx_data(
394
    //System
395
    .si_clk(clk_hmc),
396
    .so_clk(clk_user),
397
    .si_res_n(res_n_hmc),
398
    .so_res_n(res_n_user),
399
 
400
    //To RX LINK Logic
401
    .d_in({rx_d_in_ctrl,rx_d_in_data}),
402
    .shift_in(rx_shift_in),
403
    .full(rx_full),
404
    .almost_full(rx_a_full),
405
 
406
    //AXI-4 RX IF
407
    .d_out({m_axis_rx_TUSER_temp,m_axis_rx_TDATA}),
408
    .shift_out(m_axis_rx_TVALID && m_axis_rx_TREADY),
409
    .empty(m_axis_rx_TVALID_n),
410
    .almost_empty()
411
 
412
);
413
 
414
//----------------------------------------------------------------------
415
//---Register File---Register File---Register File---Register File---Reg
416
//----------------------------------------------------------------------
417
//Instantiate register file depending on the number of lanes
418
generate
419
    if(NUM_LANES==8) begin : register_file_8x
420
        openhmc_8x_rf openhmc_rf_I (
421
            //system IF
422
            .res_n(res_n_hmc),
423
            .clk(clk_hmc),
424
 
425
            //rf access
426
            .address(rf_address),
427
            .read_data(rf_read_data),
428
            .invalid_address(rf_invalid_address),
429
            .access_complete(rf_access_complete),
430
            .read_en(rf_read_en),
431
            .write_en(rf_write_en),
432
            .write_data(rf_write_data),
433
 
434
            //status registers
435
            .status_general_link_up_next(rf_link_status[1]),
436
            .status_general_link_training_next(rf_link_status[0]),
437
            .status_general_sleep_mode_next(rf_hmc_sleep),
438
            .status_general_phy_ready_next(phy_ready),
439
            .status_general_lanes_reversed_next(rf_lane_reversal_detected),
440
            .status_general_hmc_tokens_remaining_next(rf_hmc_tokens_av),
441
            .status_general_rx_tokens_remaining_next(rf_rx_tokens_av),
442
            .status_general_lane_polarity_reversed_next(rf_lane_polarity),
443
 
444
            //init status
445
            .status_init_lane_descramblers_locked_next(rf_descramblers_locked),
446
            .status_init_descrambler_part_aligned_next(rf_descrambler_part_aligned),
447
            .status_init_descrambler_aligned_next(rf_descrambler_aligned),
448
            .status_init_all_descramblers_aligned_next(rf_all_descramblers_aligned),
449
            .status_init_tx_init_status_next(rf_tx_init_status),
450
            .status_init_hmc_init_TS1_next(rf_hmc_init_status[0]),
451
 
452
            //counters
453
            .sent_np_cnt_next(rf_cnt_np),
454
            .sent_p_cnt_next(rf_cnt_p),
455
            .sent_r_cnt_next(rf_cnt_r),
456
            .poisoned_packets_cnt_next(rf_cnt_poisoned),
457
            .rcvd_rsp_cnt_next(rf_cnt_rsp_rcvd),
458
 
459
            //Single bit counter
460
            .tx_link_retries_count_countup(rf_cnt_retry),
461
            .errors_on_rx_count_countup(rx2tx_error_abort_mode_cleared),
462
            .run_length_bit_flip_count_countup(rf_run_length_bit_flip),
463
            .error_abort_not_cleared_count_countup(rf_error_abort_not_cleared),
464
 
465
            //control
466
            .control_p_rst_n(P_RST_N),
467
            .control_hmc_init_cont_set(rf_hmc_init_cont_set),
468
            .control_set_hmc_sleep(rf_set_hmc_sleep),
469
            .control_scrambler_disable(rf_scrambler_disable),
470
            .control_run_length_enable(rf_run_length_enable),
471
            .control_first_cube_ID(rf_first_cube_ID),
472
            .control_debug_dont_send_tret(rf_dbg_dont_send_tret),
473
            .control_debug_halt_on_error_abort(rf_dbg_halt_on_error_abort),
474
            .control_debug_halt_on_tx_retry(rf_dbg_halt_on_tx_retry),
475
            .control_rx_token_count(rf_rx_buffer_rtc),
476
            .control_irtry_received_threshold(rf_irtry_received_threshold),
477
            .control_irtry_to_send(rf_irtry_to_send),
478
            .control_bit_slip_time(rf_bit_slip_time)
479
 
480
        );
481
    end else begin  : register_file_16x
482
        openhmc_16x_rf openhmc_rf_I (
483
            //system IF
484
            .res_n(res_n_hmc),
485
            .clk(clk_hmc),
486
 
487
            //rf access
488
            .address(rf_address),
489
            .read_data(rf_read_data),
490
            .invalid_address(rf_invalid_address),
491
            .access_complete(rf_access_complete),
492
            .read_en(rf_read_en),
493
            .write_en(rf_write_en),
494
            .write_data(rf_write_data),
495
 
496
            //status registers
497
            .status_general_link_up_next(rf_link_status[1]),
498
            .status_general_link_training_next(rf_link_status[0]),
499
            .status_general_sleep_mode_next(rf_hmc_sleep),
500
            .status_general_phy_ready_next(phy_ready),
501
            .status_general_lanes_reversed_next(rf_lane_reversal_detected),
502
            .status_general_hmc_tokens_remaining_next(rf_hmc_tokens_av),
503
            .status_general_rx_tokens_remaining_next(rf_rx_tokens_av),
504
            .status_general_lane_polarity_reversed_next(rf_lane_polarity),
505
 
506
            //init status
507
            .status_init_lane_descramblers_locked_next(rf_descramblers_locked),
508
            .status_init_descrambler_part_aligned_next(rf_descrambler_part_aligned),
509
            .status_init_descrambler_aligned_next(rf_descrambler_aligned),
510
            .status_init_all_descramblers_aligned_next(rf_all_descramblers_aligned),
511
            .status_init_tx_init_status_next(rf_tx_init_status),
512
            .status_init_hmc_init_TS1_next(rf_hmc_init_status[0]),
513
 
514
            //counters
515
            .sent_np_cnt_next(rf_cnt_np),
516
            .sent_p_cnt_next(rf_cnt_p),
517
            .sent_r_cnt_next(rf_cnt_r),
518
            .poisoned_packets_cnt_next(rf_cnt_poisoned),
519
            .rcvd_rsp_cnt_next(rf_cnt_rsp_rcvd),
520
 
521
            //Single bit counter
522
            .tx_link_retries_count_countup(rf_cnt_retry),
523
            .errors_on_rx_count_countup(rx2tx_error_abort_mode_cleared),
524
            .run_length_bit_flip_count_countup(rf_run_length_bit_flip),
525
            .error_abort_not_cleared_count_countup(rf_error_abort_not_cleared),
526
 
527
            //control
528
            .control_p_rst_n(P_RST_N),
529
            .control_hmc_init_cont_set(rf_hmc_init_cont_set),
530
            .control_set_hmc_sleep(rf_set_hmc_sleep),
531
            .control_scrambler_disable(rf_scrambler_disable),
532
            .control_run_length_enable(rf_run_length_enable),
533
            .control_first_cube_ID(rf_first_cube_ID),
534
            .control_debug_dont_send_tret(rf_dbg_dont_send_tret),
535
            .control_debug_halt_on_error_abort(rf_dbg_halt_on_error_abort),
536
            .control_debug_halt_on_tx_retry(rf_dbg_halt_on_tx_retry),
537
            .control_rx_token_count(rf_rx_buffer_rtc),
538
            .control_irtry_received_threshold(rf_irtry_received_threshold),
539
            .control_irtry_to_send(rf_irtry_to_send),
540
            .control_bit_slip_time(rf_bit_slip_time)
541
        );
542
    end
543
endgenerate
544
 
545
endmodule
546
 
547
`default_nettype wire

powered by: WebSVN 2.1.0

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