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

Subversion Repositories xge_mac

[/] [xge_mac/] [trunk/] [tbench/] [verilog/] [tb_xge_mac.sv] - Diff between revs 16 and 17

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

Rev 16 Rev 17
Line 65... Line 65...
reg           pkt_tx_val;
reg           pkt_tx_val;
reg           pkt_tx_sop;
reg           pkt_tx_sop;
reg           pkt_tx_eop;
reg           pkt_tx_eop;
reg  [2:0]    pkt_tx_mod;
reg  [2:0]    pkt_tx_mod;
 
 
 
integer       tx_count;
 
integer       rx_count;
 
 
/*AUTOWIRE*/
/*AUTOWIRE*/
// Beginning of automatic wires (for undeclared instantiated-module outputs)
// Beginning of automatic wires (for undeclared instantiated-module outputs)
wire                    pkt_rx_avail;           // From dut of xge_mac.v
wire                    pkt_rx_avail;           // From dut of xge_mac.v
wire [63:0]             pkt_rx_data;            // From dut of xge_mac.v
wire [63:0]             pkt_rx_data;            // From dut of xge_mac.v
wire                    pkt_rx_eop;             // From dut of xge_mac.v
wire                    pkt_rx_eop;             // From dut of xge_mac.v
Line 242... Line 245...
assign wb_rst_i = 1'b1;
assign wb_rst_i = 1'b1;
assign wb_stb_i = 1'b0;
assign wb_stb_i = 1'b0;
assign wb_we_i = 1'b0;
assign wb_we_i = 1'b0;
 
 
 
 
 
initial begin
 
    tx_count = 0;
 
    rx_count = 0;
 
end
 
 
//---
//---
// XGMII Loopback
// XGMII Loopback
// This test is done with loopback on XGMII or using one of the tranceiver examples
// This test is done with loopback on XGMII or using one of the tranceiver examples
 
 
`ifndef GXB
`ifndef GXB
Line 368... Line 376...
 
 
        pkt_tx_val = 1'b0;
        pkt_tx_val = 1'b0;
        pkt_tx_eop = 1'b0;
        pkt_tx_eop = 1'b0;
        pkt_tx_mod = 3'b0;
        pkt_tx_mod = 3'b0;
 
 
 
        tx_count = tx_count + 1;
 
 
    end
    end
 
 
endtask
endtask
 
 
 
 
Line 469... Line 479...
 
 
            if (pkt_rx_val) begin
            if (pkt_rx_val) begin
 
 
                if (pkt_rx_sop) begin
                if (pkt_rx_sop) begin
                    $display("\n\n------------------------");
                    $display("\n\n------------------------");
 
                    $display("Received Packet");
 
                    $display("------------------------");
                end
                end
 
 
                $display("%x", pkt_rx_data);
                $display("%x", pkt_rx_data);
 
 
                if (pkt_rx_eop) begin
                if (pkt_rx_eop) begin
Line 488... Line 500...
 
 
            @(posedge clk_156m25);
            @(posedge clk_156m25);
 
 
        end
        end
 
 
 
        rx_count = rx_count + 1;
 
 
    end
    end
endtask
endtask
 
 
initial begin
initial begin
 
 
    forever begin
    forever begin
 
 
        if (pkt_rx_avail) begin
        if (pkt_rx_avail) begin
 
 
            RxPacket();
            RxPacket();
 
 
 
            if (rx_count == tx_count) begin
 
                $display("All packets received. Sumulation done!!!\n");
 
            end
 
 
        end
        end
 
 
        @(posedge clk_156m25);
        @(posedge clk_156m25);
 
 
    end
    end

powered by: WebSVN 2.1.0

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