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

Subversion Repositories ethmac

[/] [ethmac/] [trunk/] [bench/] [verilog/] [tb_eth_top.v] - Diff between revs 22 and 23

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

Rev 22 Rev 23
Line 39... Line 39...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.4  2001/10/19 08:46:53  mohor
 
// eth_timescale.v changed to timescale.v This is done because of the
 
// simulation of the few cores in a one joined project.
 
//
// Revision 1.3  2001/09/24 14:55:49  mohor
// Revision 1.3  2001/09/24 14:55:49  mohor
// Defines changed (All precede with ETH_). Small changes because some
// Defines changed (All precede with ETH_). Small changes because some
// tools generate warnings when two operands are together. Synchronization
// tools generate warnings when two operands are together. Synchronization
// between two clocks domains in eth_wishbonedma.v is changed (due to ASIC
// between two clocks domains in eth_wishbonedma.v is changed (due to ASIC
// demands).
// demands).
Line 131... Line 135...
(
(
  // WISHBONE common
  // WISHBONE common
  .wb_clk_i(WB_CLK_I), .wb_rst_i(WB_RST_I), .wb_dat_i(WB_DAT_I), .wb_dat_o(WB_DAT_O),
  .wb_clk_i(WB_CLK_I), .wb_rst_i(WB_RST_I), .wb_dat_i(WB_DAT_I), .wb_dat_o(WB_DAT_O),
 
 
  // WISHBONE slave
  // WISHBONE slave
        .wb_adr_i(WB_ADR_I), .wb_sel_i(WB_SEL_I), .wb_we_i(WB_WE_I),   .wb_cyc_i(WB_CYC_I),
        .wb_adr_i(WB_ADR_I[11:2]), .wb_sel_i(WB_SEL_I), .wb_we_i(WB_WE_I),   .wb_cyc_i(WB_CYC_I),
        .wb_stb_i(WB_STB_I), .wb_ack_o(WB_ACK_O), .wb_err_o(WB_ERR_O), .wb_req_o(WB_REQ_O),
        .wb_stb_i(WB_STB_I), .wb_ack_o(WB_ACK_O), .wb_err_o(WB_ERR_O), .wb_req_o(WB_REQ_O),
        .wb_ack_i(WB_ACK_I), .wb_nd_o(WB_ND_O),   .wb_rd_o(WB_RD_O),
        .wb_ack_i(WB_ACK_I), .wb_nd_o(WB_ND_O),   .wb_rd_o(WB_RD_O),
 
 
  //TX
  //TX
  .mtx_clk_pad_i(MTxClk), .mtxd_pad_o(MTxD), .mtxen_pad_o(MTxEn), .mtxerr_pad_o(MTxErr),
  .mtx_clk_pad_i(MTxClk), .mtxd_pad_o(MTxD), .mtxen_pad_o(MTxEn), .mtxerr_pad_o(MTxErr),
Line 251... Line 255...
  ReceivePacket(16'h0018, 1'b0);    // Initializes RxBD and then generates traffic on the MRxD[3:0] signals.
  ReceivePacket(16'h0018, 1'b0);    // Initializes RxBD and then generates traffic on the MRxD[3:0] signals.
 
 
 
 
  WishboneRead({26'h0, `ETH_MODER_ADR});   // Read from MODER register
  WishboneRead({26'h0, `ETH_MODER_ADR});   // Read from MODER register
 
 
  WishboneRead({24'h100, (8'h0<<2)});       // Read from TxBD register
  WishboneRead({24'h04, (8'h0<<2)});       // Read from TxBD register
  WishboneRead({24'h100, (8'h1<<2)});       // Read from TxBD register
  WishboneRead({24'h04, (8'h1<<2)});       // Read from TxBD register
  WishboneRead({24'h100, (8'h2<<2)});       // Read from TxBD register
  WishboneRead({24'h04, (8'h2<<2)});       // Read from TxBD register
  WishboneRead({24'h100, (8'h3<<2)});       // Read from TxBD register
  WishboneRead({24'h04, (8'h3<<2)});       // Read from TxBD register
  WishboneRead({24'h100, (8'h4<<2)});       // Read from TxBD register
  WishboneRead({24'h04, (8'h4<<2)});       // Read from TxBD register
 
 
  WishboneRead({22'h40, (10'h80<<2)});       // Read from RxBD register
  WishboneRead({22'h01, (10'h80<<2)});       // Read from RxBD register
  WishboneRead({22'h40, (10'h81<<2)});       // Read from RxBD register
  WishboneRead({22'h01, (10'h81<<2)});       // Read from RxBD register
  WishboneRead({22'h40, (10'h82<<2)});       // Read from RxBD register
  WishboneRead({22'h01, (10'h82<<2)});       // Read from RxBD register
  WishboneRead({22'h40, (10'h83<<2)});       // Read from RxBD register
  WishboneRead({22'h01, (10'h83<<2)});       // Read from RxBD register
  WishboneRead({22'h40, (10'h84<<2)});       // Read from RxBD register
  WishboneRead({22'h01, (10'h84<<2)});       // Read from RxBD register
 
 
  #10000 $stop;
  #10000 $stop;
end
end
 
 
 
 
Line 305... Line 309...
 
 
    wait(WB_ACK_O);   // waiting for acknowledge response
    wait(WB_ACK_O);   // waiting for acknowledge response
 
 
    // Writing information about the access to the screen
    // Writing information about the access to the screen
    @ (posedge WB_CLK_I);
    @ (posedge WB_CLK_I);
      if(~Address[17] & ~Address[16])
      if(~Address[11] & ~Address[10])
        $write("\nWrite to register (Data: 0x%x, Reg. Addr: 0x%0x)", Data, Address);
        $write("\nWrite to register (Data: 0x%x, Reg. Addr: 0x%0x)", Data, Address);
      else
      else
      if(~Address[17] & Address[16])
      if(~Address[11] & Address[10])
        if(Address[9:2] < tb_eth_top.ethtop.r_RxBDAddress)
        if(Address[9:2] < tb_eth_top.ethtop.r_RxBDAddress)
          begin
          begin
            $write("\nWrite to TxBD (Data: 0x%x, TxBD Addr: 0x%0x)\n", Data, Address);
            $write("\nWrite to TxBD (Data: 0x%x, TxBD Addr: 0x%0x)\n", Data, Address);
            if(Data[13])
            if(Data[9])
              $write("Send Control packet (PAUSE = 0x%0h)\n", Data[31:16]);
              $write("Send Control packet (PAUSE = 0x%0h)\n", Data[31:16]);
          end
          end
        else
        else
          $write("\nWrite to RxBD (Data: 0x%x, RxBD Addr: 0x%0x)", Data, Address);
          $write("\nWrite to RxBD (Data: 0x%x, RxBD Addr: 0x%0x)", Data, Address);
      else
      else
Line 361... Line 365...
          Address, $time);
          Address, $time);
        #50 $stop;
        #50 $stop;
      end
      end
 
 
    @ (posedge WB_CLK_I);
    @ (posedge WB_CLK_I);
      if(~Address[17] & ~Address[16])
      if(~Address[11] & ~Address[10])
        $write("\nRead from register (Data: 0x%x, Reg. Addr: 0x%0x)", Data, Address);
        $write("\nRead from register (Data: 0x%x, Reg. Addr: 0x%0x)", Data, Address);
      else
      else
      if(~Address[17] & Address[16])
      if(~Address[11] & Address[10])
        if(Address[9:2] < tb_eth_top.ethtop.r_RxBDAddress)
        if(Address[9:2] < tb_eth_top.ethtop.r_RxBDAddress)
          begin
          begin
            $write("\nRead from TxBD (Data: 0x%x, TxBD Addr: 0x%0x)", Data, Address);
            $write("\nRead from TxBD (Data: 0x%x, TxBD Addr: 0x%0x)", Data, Address);
          end
          end
        else
        else
Line 399... Line 403...
    if(TxBDIndex == 3)    // Only 4 buffer descriptors are used
    if(TxBDIndex == 3)    // Only 4 buffer descriptors are used
      Wrap = 1'b1;
      Wrap = 1'b1;
    else
    else
      Wrap = 1'b0;
      Wrap = 1'b0;
 
 
    TempAddr = {22'h40, (TxBDIndex<<2)};
    TempAddr = {22'h01, (TxBDIndex<<2)};
    TempData = {Length[15:0], 1'b1, 1'b0, Wrap, 3'h0, ControlFrame, 1'b0, TxBDIndex[7:0]};  // Ready and Wrap = 1
    TempData = {Length[15:0], 1'b1, 1'b0, Wrap, 3'h0, ControlFrame, 1'b0, TxBDIndex[7:0]};  // Ready and Wrap = 1
 
 
    #1;
    #1;
    if(TxBDIndex == 3)    // Only 4 buffer descriptors are used
    if(TxBDIndex == 3)    // Only 4 buffer descriptors are used
      TxBDIndex = 0;
      TxBDIndex = 0;
Line 436... Line 440...
    if(RxBDIndex == 3)    // Only 4 buffer descriptors are used
    if(RxBDIndex == 3)    // Only 4 buffer descriptors are used
      WrapRx = 1'b1;
      WrapRx = 1'b1;
    else
    else
      WrapRx = 1'b0;
      WrapRx = 1'b0;
 
 
    TempRxAddr = {22'h40, ((tb_eth_top.ethtop.r_RxBDAddress + RxBDIndex)<<2)};
    TempRxAddr = {22'h01, ((tb_eth_top.ethtop.r_RxBDAddress + RxBDIndex)<<2)};
 
 
    TempRxData = {LengthRx[15:0], 1'b1, 1'b0, WrapRx, 5'h0, RxBDIndex[7:0]};  // Ready and WrapRx = 1 or 0
    TempRxData = {LengthRx[15:0], 1'b1, 1'b0, WrapRx, 5'h0, RxBDIndex[7:0]};  // Ready and WrapRx = 1 or 0
 
 
    #1;
    #1;
    if(RxBDIndex == 3)    // Only 4 buffer descriptors are used
    if(RxBDIndex == 3)    // Only 4 buffer descriptors are used
Line 489... Line 493...
 
 
    wait (~WishboneBusy);
    wait (~WishboneBusy);
    WishboneBusy = 1;
    WishboneBusy = 1;
    #1;
    #1;
    WB_DAT_I = {a, b, c, d};
    WB_DAT_I = {a, b, c, d};
    WB_ADR_I = {20'h20, pp[11:0]};
//    WB_ADR_I = {20'h20, pp[11:0]};
 
    WB_ADR_I = {22'h02, pp[9:0]};
    $display("task WaitingForTxDMARequest: pp=%0d, WB_ADR_I=0x%0h, WB_DAT_I=0x%0h", pp, WB_ADR_I, WB_DAT_I);
    $display("task WaitingForTxDMARequest: pp=%0d, WB_ADR_I=0x%0h, WB_DAT_I=0x%0h", pp, WB_ADR_I, WB_DAT_I);
 
 
    WB_WE_I  = 1'b1;
    WB_WE_I  = 1'b1;
    WB_CYC_I = 1'b1;
    WB_CYC_I = 1'b1;
    WB_STB_I = 1'b1;
    WB_STB_I = 1'b1;
Line 525... Line 530...
    repeat(Delay) @(posedge WB_CLK_I);
    repeat(Delay) @(posedge WB_CLK_I);
 
 
    wait (~WishboneBusy);
    wait (~WishboneBusy);
    WishboneBusy = 1;
    WishboneBusy = 1;
    #1;
    #1;
    WB_ADR_I = {20'h20, rr[11:0]};
//    WB_ADR_I = {20'h20, rr[11:0]};
 
    WB_ADR_I = {22'h02, rr[9:0]};
    $display("task WaitingForRxDMARequest: rr=%0d, WB_ADR_I=0x%0h, WB_DAT_O=0x%0h", rr, WB_ADR_I, WB_DAT_O);
    $display("task WaitingForRxDMARequest: rr=%0d, WB_ADR_I=0x%0h, WB_DAT_O=0x%0h", rr, WB_ADR_I, WB_DAT_O);
 
 
    WB_WE_I  = 1'b1;
    WB_WE_I  = 1'b1;
    WB_CYC_I = 1'b1;
    WB_CYC_I = 1'b1;
    WB_STB_I = 1'b1;
    WB_STB_I = 1'b1;

powered by: WebSVN 2.1.0

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