diff options
Diffstat (limited to 'fpga')
-rw-r--r-- | fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v b/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v index 143808f6d..b5c6943ed 100644 --- a/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v +++ b/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v @@ -434,20 +434,27 @@ module xge_mac_wrapper #( // reg cut_through; reg cut_wait; + reg [15:0] cut_idlecount; if (CUT_THROUGH > 0) begin : yes_cut_through wire cut_start; wire cut_end; - assign cut_start = tx_occupied > CUT_THROUGH; + // start under 2 conditions + // (1) we have more the CUT_THROUGH bytes buffered + assign cut_start = tx_occupied > CUT_THROUGH || + // (2) we have kept bytes waiting for too long + // The second case happens when less than CUT_THROUGH bytes are pushed + (cut_idlecount == 0); assign cut_end = eth_tx_eof && eth_tx_valid; // Add SOF always @(posedge xgmii_clk) begin : cut_through_dff if (xgmii_reset) begin - cut_through <= 1'b0; - cut_wait <= 1'b0; + cut_through <= 1'b0; + cut_wait <= 1'b0; + cut_idlecount <= CUT_THROUGH+2; end else begin cut_wait <= eth_tx_full; if (cut_start) begin @@ -455,6 +462,13 @@ module xge_mac_wrapper #( end else if (cut_end) begin cut_through <= 1'b0; end + if (tx_occupied > 0 && cut_through == 1'b0) begin + if (cut_idlecount > 0) begin + cut_idlecount <= cut_idlecount-1; + end + end else begin + cut_idlecount <= CUT_THROUGH+2; + end end end end else begin : no_cut_through |