commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10718 - gnuradio/trunk/usrp2/fpga/simple_gemac


From: matt
Subject: [Commit-gnuradio] r10718 - gnuradio/trunk/usrp2/fpga/simple_gemac
Date: Tue, 31 Mar 2009 01:39:35 -0600 (MDT)

Author: matt
Date: 2009-03-31 01:39:34 -0600 (Tue, 31 Mar 2009)
New Revision: 10718

Modified:
   gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tb.v
   gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tx.v
Log:
tx should be fully working now


Modified: gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tb.v
===================================================================
--- gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tb.v    2009-03-31 
06:55:21 UTC (rev 10717)
+++ gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tb.v    2009-03-31 
07:39:34 UTC (rev 10718)
@@ -123,16 +123,22 @@
        SendPacketFromFile(60);
        repeat (100)
          @(posedge clk);
-       SendPacketFromFile(59);
+       SendPacketFromFile(61);
        repeat (100)
          @(posedge clk);
-       SendPacketFromFile(58);
+       SendPacketFromFile(62);
        repeat (100)
          @(posedge clk);
-       SendPacketFromFile(61);
+       SendPacketFromFile(63);
        repeat (100)
          @(posedge clk);
-       SendPacketFromFile(62);
+       SendPacketFromFile(64);
+       repeat (100)
+         @(posedge clk);
+       SendPacketFromFile(59);
+       repeat (100)
+         @(posedge clk);
+       SendPacketFromFile(58);
        #10000 $finish;
      end
 

Modified: gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tx.v
===================================================================
--- gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tx.v    2009-03-31 
06:55:21 UTC (rev 10717)
+++ gnuradio/trunk/usrp2/fpga/simple_gemac/simple_gemac_tx.v    2009-03-31 
07:39:34 UTC (rev 10718)
@@ -43,8 +43,9 @@
    localparam TX_CRC_2              = TX_CRC_0 + 2;
    localparam TX_CRC_3              = TX_CRC_0 + 3;
    localparam TX_ERROR              = 32;
-   localparam TX_PAUSE              = 56;
-   localparam TX_PAUSE_SOF   = 63;
+   localparam TX_PAUSE              = 55;
+   localparam TX_PAUSE_SOF   = TX_PAUSE + 7;
+   localparam TX_PAUSE_FIRST = TX_PAUSE_SOF + 1;
    localparam TX_PAUSE_END   = TX_PAUSE_SOF + 18;
 
    reg send_pause;
@@ -138,8 +139,7 @@
           tx_en_pre <= 0;
         TX_PAD :
           txd_pre <= 0;
- 
-        8'b01xx_xxxx :  // In Pause Frame
+        TX_PAUSE_FIRST, 8'b01xx_xxxx :  // In Pause Frame
           txd_pre <= pause_dat;
        endcase // case (tx_state)
 
@@ -195,25 +195,30 @@
 
    wire clear_crc   = (tx_state == TX_IDLE);
 
-//   wire calc_crc_pre = (tx_state==TX_FIRSTBYTE)||(tx_state==TX_IN_FRAME)||
-//     ((tx_state  ==TX_IN_FRAME_2)&tx_valid )||(tx_state==TX_PAD 
)||(tx_state[6]);
-  // reg calc_crc;
-  // always @(posedge tx_clk)
-  //   calc_crc <= calc_crc_pre;
-   wire calc_crc    = 0;
+   wire calc_crc    = 
+       (tx_state==TX_IN_FRAME) |
+       (tx_state==TX_IN_FRAME_2) |
+       (tx_state==TX_PAD) |
+       (tx_state[6]);
 
-   /*
-   wire calc_crc    = ~(tx_state==TX_IDLE) &
-       ~(tx_state==TX_IDLE) &
-       ~(tx_state==TX_IDLE) &
-       ~(tx_state==TX_IDLE) &
-    */
+   reg [7:0] crc_ctr;
+   reg calc_crc_d1;
+   always @(posedge tx_clk) 
+     calc_crc_d1 <= calc_crc;
+   
+   always @(posedge tx_clk)
+     if(reset)
+       crc_ctr          <= 0;
+     else if(calc_crc)
+       crc_ctr          <= crc_ctr+1;
+     else if(calc_crc_d1)
+       $display("CRC COUNT = %d",crc_ctr);
+     else
+       crc_ctr <= 0;
+
    crc crc(.clk(tx_clk), .reset(reset), .clear(clear_crc),
            .data(txd_pre), .calc(calc_crc), .crc_out(crc_out));
 
-
-//        .data(txd_pre), .calc(calc_crc & ~(tx_state==TX_CRC_0)), 
.crc_out(crc_out));
-
    assign tx_ack    = (tx_state == TX_FIRSTBYTE);
 
    reg tx_valid_d1;
@@ -233,9 +238,6 @@
            GMII_TXD <= crc_out[15:8];
          TX_CRC_3 :
            GMII_TXD <= crc_out[7:0];
-//       TX_IN_FRAME : 
-//       TX_PAD :
-//         GMII_TXD <= tx_valid_d1 ? txd_pre : 0;
          default :
            GMII_TXD <= txd_pre;
        endcase // case (tx_state)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]