| Line 40... |
Line 40... |
|
|
module tx_dequeue(/*AUTOARG*/
|
module tx_dequeue(/*AUTOARG*/
|
// Outputs
|
// Outputs
|
txdfifo_ren, txhfifo_ren, txhfifo_wdata, txhfifo_wstatus,
|
txdfifo_ren, txhfifo_ren, txhfifo_wdata, txhfifo_wstatus,
|
txhfifo_wen, xgmii_txd, xgmii_txc, status_txdfifo_udflow_tog,
|
txhfifo_wen, xgmii_txd, xgmii_txc, status_txdfifo_udflow_tog,
|
status_good_frame_tx_tog, status_good_frame_tx_size,
|
txsfifo_wen, txsfifo_wdata,
|
// Inputs
|
// Inputs
|
clk_xgmii_tx, reset_xgmii_tx_n, ctrl_tx_enable_ctx,
|
clk_xgmii_tx, reset_xgmii_tx_n, ctrl_tx_enable_ctx,
|
status_local_fault_ctx, status_remote_fault_ctx, txdfifo_rdata,
|
status_local_fault_ctx, status_remote_fault_ctx, txdfifo_rdata,
|
txdfifo_rstatus, txdfifo_rempty, txdfifo_ralmost_empty,
|
txdfifo_rstatus, txdfifo_rempty, txdfifo_ralmost_empty,
|
txhfifo_rdata, txhfifo_rstatus, txhfifo_rempty,
|
txhfifo_rdata, txhfifo_rstatus, txhfifo_rempty,
|
| Line 86... |
Line 86... |
output [63:0] xgmii_txd;
|
output [63:0] xgmii_txd;
|
output [7:0] xgmii_txc;
|
output [7:0] xgmii_txc;
|
|
|
output status_txdfifo_udflow_tog;
|
output status_txdfifo_udflow_tog;
|
|
|
output status_good_frame_tx_tog;
|
output txsfifo_wen;
|
output [13:0] status_good_frame_tx_size;
|
output [13:0] txsfifo_wdata;
|
|
|
|
|
|
|
/*AUTOREG*/
|
/*AUTOREG*/
|
// Beginning of automatic regs (for this module's undeclared outputs)
|
// Beginning of automatic regs (for this module's undeclared outputs)
|
reg [13:0] status_good_frame_tx_size;
|
|
reg status_good_frame_tx_tog;
|
|
reg status_txdfifo_udflow_tog;
|
reg status_txdfifo_udflow_tog;
|
reg txdfifo_ren;
|
reg txdfifo_ren;
|
reg txhfifo_ren;
|
reg txhfifo_ren;
|
reg [63:0] txhfifo_wdata;
|
reg [63:0] txhfifo_wdata;
|
reg txhfifo_wen;
|
reg txhfifo_wen;
|
reg [7:0] txhfifo_wstatus;
|
reg [7:0] txhfifo_wstatus;
|
|
reg [13:0] txsfifo_wdata;
|
|
reg txsfifo_wen;
|
reg [7:0] xgmii_txc;
|
reg [7:0] xgmii_txc;
|
reg [63:0] xgmii_txd;
|
reg [63:0] xgmii_txd;
|
// End of automatics
|
// End of automatics
|
|
|
/*AUTOWIRE*/
|
/*AUTOWIRE*/
|
| Line 250... |
Line 249... |
xgxs_txd <= {8{`IDLE}};
|
xgxs_txd <= {8{`IDLE}};
|
xgxs_txc <= 8'hff;
|
xgxs_txc <= 8'hff;
|
|
|
status_txdfifo_udflow_tog <= 1'b0;
|
status_txdfifo_udflow_tog <= 1'b0;
|
|
|
status_good_frame_tx_tog <= 1'b0;
|
txsfifo_wen <= 1'b0;
|
status_good_frame_tx_size <= 14'b0;
|
txsfifo_wdata <= 14'b0;
|
|
|
end
|
end
|
else begin
|
else begin
|
|
|
curr_state_enc <= next_state_enc;
|
curr_state_enc <= next_state_enc;
|
| Line 273... |
Line 272... |
xgxs_txd_barrel <= next_xgxs_txd[63:32];
|
xgxs_txd_barrel <= next_xgxs_txd[63:32];
|
xgxs_txc_barrel <= next_xgxs_txc[7:4];
|
xgxs_txc_barrel <= next_xgxs_txc[7:4];
|
|
|
frame_available <= next_frame_available;
|
frame_available <= next_frame_available;
|
|
|
|
txsfifo_wen <= 1'b0;
|
|
txsfifo_wdata <= byte_cnt;
|
|
|
//---
|
//---
|
// Barrel shifter. Previous stage always align packet with LANE0.
|
// Barrel shifter. Previous stage always align packet with LANE0.
|
// This stage allow us to shift packet to align with LANE4 if needed
|
// This stage allow us to shift packet to align with LANE4 if needed
|
// for correct inter frame gap (IFG).
|
// for correct inter frame gap (IFG).
|
|
|
| Line 302... |
Line 304... |
|
|
//---
|
//---
|
// Frame count and size
|
// Frame count and size
|
|
|
if (frame_end) begin
|
if (frame_end) begin
|
status_good_frame_tx_tog <= ~status_good_frame_tx_tog;
|
txsfifo_wen <= 1'b1;
|
status_good_frame_tx_size <= byte_cnt;
|
|
end
|
end
|
|
|
end
|
end
|
|
|
end
|
end
|