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

Subversion Repositories srdydrdy_lib

[/] [srdydrdy_lib/] [trunk/] [examples/] [bridge/] [env/] [gmii_driver.v] - Diff between revs 8 and 11

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 8 Rev 11
Line 65... Line 65...
      // Swap and Complement:
      // Swap and Complement:
      crc32_result = ~{temp[7:0], temp[15:8], temp[23:16], temp[31:24]};
      crc32_result = ~{temp[7:0], temp[15:8], temp[23:16], temp[31:24]};
   end
   end
endtask
endtask
 
 
 
  task print_packet;
 
    input [31:0] length;
 
    integer      i;
 
    begin
 
      for (i=0; i<length; i=i+1)
 
        begin
 
          if (i % 16 == 0) $write ("%x: ", i[15:0]);
 
          $write ("%x ", rxbuf[i]);
 
          if (i % 16 == 7) $write ("| ");
 
          if (i % 16 == 15) $write ("\n");
 
        end
 
      if (i % 16 != 0) $write ("\n");
 
    end
 
  endtask
 
 
  task send_packet;
  task send_packet;
    input [47:0] da, sa;
    input [47:0] da, sa;
    input [15:0] length;
    input [15:0] length;
    integer      p;
    integer      p;
    begin
    begin
Line 80... Line 95...
      gencrc32 (length);
      gencrc32 (length);
      { rxbuf[length-4], rxbuf[length-3],
      { rxbuf[length-4], rxbuf[length-3],
        rxbuf[length-2], rxbuf[length-1] } = crc32_result;
        rxbuf[length-2], rxbuf[length-1] } = crc32_result;
 
 
      $display ("%m : Sending packet DA=%x SA=%x of length %0d", da, sa, length);
      $display ("%m : Sending packet DA=%x SA=%x of length %0d", da, sa, length);
 
      print_packet (length);
 
 
      repeat (7)
      repeat (7)
        begin
        begin
          @(posedge rx_clk);
          @(posedge rx_clk);
          rx_dv <= #1 1;
          rx_dv <= #1 1;
          rxd   <= #1 `GMII_PRE;
          rxd   <= #1 `GMII_PRE;

powered by: WebSVN 2.1.0

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