| 1 |
2 |
antanguay |
//////////////////////////////////////////////////////////////////////
|
| 2 |
|
|
//// ////
|
| 3 |
|
|
//// File name "sync_clk_xgmii.v" ////
|
| 4 |
|
|
//// ////
|
| 5 |
|
|
//// This file is part of the "10GE MAC" project ////
|
| 6 |
|
|
//// http://www.opencores.org/cores/xge_mac/ ////
|
| 7 |
|
|
//// ////
|
| 8 |
|
|
//// Author(s): ////
|
| 9 |
|
|
//// - A. Tanguay (antanguay@opencores.org) ////
|
| 10 |
|
|
//// ////
|
| 11 |
|
|
//////////////////////////////////////////////////////////////////////
|
| 12 |
|
|
//// ////
|
| 13 |
|
|
//// Copyright (C) 2008 AUTHORS. All rights reserved. ////
|
| 14 |
|
|
//// ////
|
| 15 |
|
|
//// This source file may be used and distributed without ////
|
| 16 |
|
|
//// restriction provided that this copyright statement is not ////
|
| 17 |
|
|
//// removed from the file and that any derivative work contains ////
|
| 18 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
| 19 |
|
|
//// ////
|
| 20 |
|
|
//// This source file is free software; you can redistribute it ////
|
| 21 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
| 22 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
| 23 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
| 24 |
|
|
//// later version. ////
|
| 25 |
|
|
//// ////
|
| 26 |
|
|
//// This source is distributed in the hope that it will be ////
|
| 27 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
| 28 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
| 29 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
| 30 |
|
|
//// details. ////
|
| 31 |
|
|
//// ////
|
| 32 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
| 33 |
|
|
//// Public License along with this source; if not, download it ////
|
| 34 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
| 35 |
|
|
//// ////
|
| 36 |
|
|
//////////////////////////////////////////////////////////////////////
|
| 37 |
|
|
|
| 38 |
|
|
|
| 39 |
|
|
`include "defines.v"
|
| 40 |
|
|
|
| 41 |
|
|
module sync_clk_xgmii_tx(/*AUTOARG*/
|
| 42 |
|
|
// Outputs
|
| 43 |
12 |
antanguay |
ctrl_tx_enable_ctx, status_local_fault_ctx, status_remote_fault_ctx,
|
| 44 |
2 |
antanguay |
// Inputs
|
| 45 |
12 |
antanguay |
clk_xgmii_tx, reset_xgmii_tx_n, ctrl_tx_enable,
|
| 46 |
2 |
antanguay |
status_local_fault_crx, status_remote_fault_crx
|
| 47 |
|
|
);
|
| 48 |
|
|
|
| 49 |
|
|
input clk_xgmii_tx;
|
| 50 |
|
|
input reset_xgmii_tx_n;
|
| 51 |
|
|
|
| 52 |
|
|
input ctrl_tx_enable;
|
| 53 |
|
|
|
| 54 |
|
|
input status_local_fault_crx;
|
| 55 |
|
|
input status_remote_fault_crx;
|
| 56 |
|
|
|
| 57 |
|
|
output ctrl_tx_enable_ctx;
|
| 58 |
|
|
|
| 59 |
|
|
output status_local_fault_ctx;
|
| 60 |
|
|
output status_remote_fault_ctx;
|
| 61 |
|
|
|
| 62 |
|
|
/*AUTOREG*/
|
| 63 |
|
|
|
| 64 |
|
|
/*AUTOWIRE*/
|
| 65 |
|
|
|
| 66 |
|
|
wire [2:0] sig_out;
|
| 67 |
|
|
|
| 68 |
12 |
antanguay |
assign ctrl_tx_enable_ctx = sig_out[2];
|
| 69 |
|
|
assign status_local_fault_ctx = sig_out[1];
|
| 70 |
|
|
assign status_remote_fault_ctx = sig_out[0];
|
| 71 |
2 |
antanguay |
|
| 72 |
|
|
meta_sync #(.DWIDTH (3)) meta_sync0 (
|
| 73 |
|
|
// Outputs
|
| 74 |
|
|
.out (sig_out),
|
| 75 |
|
|
// Inputs
|
| 76 |
|
|
.clk (clk_xgmii_tx),
|
| 77 |
|
|
.reset_n (reset_xgmii_tx_n),
|
| 78 |
|
|
.in ({
|
| 79 |
|
|
ctrl_tx_enable,
|
| 80 |
|
|
status_local_fault_crx,
|
| 81 |
|
|
status_remote_fault_crx
|
| 82 |
|
|
}));
|
| 83 |
|
|
|
| 84 |
|
|
endmodule
|