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

Subversion Repositories ethmac10g

[/] [ethmac10g/] [tags/] [V10/] [rxtest.v] - Blame information for rev 72

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 fisher5090
`timescale 1ns / 1ps
2
 
3
////////////////////////////////////////////////////////////////////////////////
4
// Company: 
5
// Engineer:
6
//
7
// Create Date:   15:23:18 12/26/2005
8
// Design Name:   rxReceiveEngine
9
// Module Name:   rxtest.v
10
// Project Name:  ethmac10g
11
// Target Device:  
12
// Tool versions:  
13
// Description: 
14
//
15
// Verilog Test Fixture created by ISE for module: rxReceiveEngine
16
//
17
// Dependencies:
18
// 
19
// Revision:
20
// Revision 0.01 - File Created
21
// Additional Comments:
22
// 
23
////////////////////////////////////////////////////////////////////////////////
24
 
25
module rxtest_v;
26
 
27
        // Inputs
28
        reg rxclk_in;
29
        reg reset_in;
30
        reg [63:0] rxd64;
31
        reg [7:0] rxc8;
32
        reg [52:0] cfgRxRegData;
33
        reg [1:0] link_fault;
34
 
35
        // Outputs
36
        wire [12:0] rxStatRegPlus;
37
        wire [63:0] rx_data;
38
        wire [7:0] rx_data_valid;
39
        wire rx_good_frame;
40
        wire rx_bad_frame;
41
        wire [2:0] rxCfgofRS;
42
        wire [1:0] rxTxLinkFaul;
43
        wire reset_out;
44
 
45
        // Instantiate the Unit Under Test (UUT)
46
        rxReceiveEngine uut (
47
                .rxclk_in(rxclk_in),
48
                .reset_in(reset_in),
49
                .reset_out(reset_out),
50
                .rxd64(rxd64),
51
                .rxc8(rxc8),
52
                .rxStatRegPlus(rxStatRegPlus),
53
                .cfgRxRegData(cfgRxRegData),
54
                .rx_data(rx_data),
55
                .rx_data_valid(rx_data_valid),
56
                .rx_good_frame(rx_good_frame),
57
                .link_fault(link_fault),
58
                .rx_bad_frame(rx_bad_frame),
59
                .rxCfgofRS(rxCfgofRS),
60
                .rxTxLinkFaul(rxTxLinkFaul)
61
        );
62
 
63
        initial begin
64
                // Initialize Inputs
65
                rxclk_in = 0;
66
                rxd64 = 0;
67
                rxc8 = 0;
68
                cfgRxRegData = 0;
69
                cfgRxRegData[35] = 1'b1;//recv_enable
70
                cfgRxRegData[36] = 1'b1;//vlan enable
71
                cfgRxRegData[34] = 1'b0;//inband fcs
72
                cfgRxRegData[52:37] = 16'h00c0;
73
                cfgRxRegData[31:0]=32'h9fe22972;
74
                link_fault = 0;
75
 
76
                // Wait 100 ns for global reset to finish
77
                #100;
78
 
79
                // Add stimulus here
80
 
81
        end
82
 
83
        wire [63:0]testvector1[15:0];  //normal frame
84
        wire [7:0] testvector2[15:0];
85
 
86
   wire [63:0]smallvector1[10:0]; //small frame
87
        wire [7:0] smallvector2[10:0];
88
 
89
        wire [63:0]taggedvector1[15:0];
90
        wire [7:0] taggedvector2[15:0];
91
 
92
 
93
 
94
        assign testvector1[0] = 64'h0707070707070707;
95
        assign testvector1[1] = 64'hfbaaaaaaaaaaaaab;
96
        assign testvector1[2] = 64'h00c09fe229720015;
97
        assign testvector1[3] = 64'h0024ac34004e9889;
98
// assign testvector1[3] = 64'h0024ac3400639889; //length error frame
99
        assign testvector1[4] = 64'h1234567890123456;
100
        assign testvector1[5] = 64'h7890123456789012;
101
        assign testvector1[6] = 64'h3456789012345678;
102
        assign testvector1[7] = 64'h9012345678901234;
103
        assign testvector1[8] = 64'h5678901234567890;
104
        assign testvector1[9] = 64'h1234567890123456;
105
        assign testvector1[10] = 64'h7890123456789012;
106
        assign testvector1[11] = 64'h3456789012345678;
107
        assign testvector1[12] = 64'h9012345678901234;
108
        assign testvector1[13] = 64'h5678901234555555;
109
        assign testvector1[14] = 64'h55fd070707070707;
110
        assign testvector1[15] = 64'h0707070707070707;
111
        assign testvector2[0] = 8'hff;
112
        assign testvector2[1] = 8'h80;
113
        assign testvector2[2] = 8'h00;
114
        assign testvector2[3] = 8'h00;
115
        assign testvector2[4] = 8'h00;
116
        assign testvector2[5] = 8'h00;
117
        assign testvector2[6] = 8'h00;
118
        assign testvector2[7] = 8'h00;
119
        assign testvector2[8] = 8'h00;
120
        assign testvector2[9] = 8'h00;
121
        assign testvector2[10] = 8'h00;
122
        assign testvector2[11] = 8'h00;
123
        assign testvector2[12] = 8'h00;
124
        assign testvector2[13] = 8'h00;
125
        assign testvector2[14] = 8'h4f;
126
        assign testvector2[15] = 8'hff;
127
 
128
        assign smallvector1[0] = 64'h0707070707070707;
129
        assign smallvector1[1] = 64'hfbaaaaaaaaaaaaab;
130
        assign smallvector1[2] = 64'h00c09fe229720015;
131
        assign smallvector1[3] = 64'h0024ac3400039889;
132
        assign smallvector1[4] = 64'h1234567890123456;
133
        assign smallvector1[5] = 64'h7890123456789012;
134
        assign smallvector1[6] = 64'h3456789012345678;
135
        assign smallvector1[7] = 64'h9012345678901234;
136
        assign smallvector1[8] = 64'h5678901234567890;
137
        assign smallvector1[9] = 64'h1234567855555555;
138
        assign smallvector1[10] = 64'hfd07070707070707;
139
 
140
   assign smallvector2[0] = 8'hff;
141
        assign smallvector2[1] = 8'h80;
142
        assign smallvector2[2] = 8'h00;
143
        assign smallvector2[3] = 8'h00;
144
        assign smallvector2[4] = 8'h00;
145
        assign smallvector2[5] = 8'h00;
146
        assign smallvector2[6] = 8'h00;
147
        assign smallvector2[7] = 8'h00;
148
        assign smallvector2[8] = 8'h00;
149
        assign smallvector2[9] = 8'h00;
150
        assign smallvector2[10] = 8'hff;
151
 
152
        assign taggedvector1[0] = 64'h0707070707070707;
153
        assign taggedvector1[1] = 64'hfbaaaaaaaaaaaaab;
154
        assign taggedvector1[2] = 64'h00c09fe229720015;
155
        assign taggedvector1[3] = 64'h0024ac348100004f; // assign taggedvector1[3] = 64'h0024ac3400639889; //length error frame
156
        assign taggedvector1[4] = 64'h004f123456789012;
157
        assign taggedvector1[5] = 64'h3456789012345678;
158
        assign taggedvector1[6] = 64'h9012345678901234;
159
        assign taggedvector1[7] = 64'h5678901234567890;
160
        assign taggedvector1[8] = 64'h1234567890123456;
161
        assign taggedvector1[9] = 64'h7890123456789012;
162
        assign taggedvector1[10] = 64'h7890123456789012;
163
        assign taggedvector1[11] = 64'h3456789012345678;
164
        assign taggedvector1[12] = 64'h9012345678901234;
165
        assign taggedvector1[13] = 64'h5678901234567890;
166
        assign taggedvector1[14] = 64'h1255555555fd0707;
167
        assign taggedvector1[15] = 64'h0707070707070707;
168
        assign taggedvector2[0] = 8'hff;
169
        assign taggedvector2[1] = 8'h80;
170
        assign taggedvector2[2] = 8'h00;
171
        assign taggedvector2[3] = 8'h00;
172
        assign taggedvector2[4] = 8'h00;
173
        assign taggedvector2[5] = 8'h00;
174
        assign taggedvector2[6] = 8'h00;
175
        assign taggedvector2[7] = 8'h00;
176
        assign taggedvector2[8] = 8'h00;
177
        assign taggedvector2[9] = 8'h00;
178
        assign taggedvector2[10] = 8'h00;
179
        assign taggedvector2[11] = 8'h00;
180
        assign taggedvector2[12] = 8'h00;
181
        assign taggedvector2[13] = 8'h00;
182
        assign taggedvector2[14] = 8'h07;
183
        assign taggedvector2[15] = 8'hff;
184
 
185
        initial begin
186
          reset_in = 1;
187
          #100
188
          reset_in = 0;
189
        end
190
 
191
        always rxclk_in =#5 ~rxclk_in;
192
 
193
        reg [3:0]i;
194
        always@(posedge rxclk_in or posedge reset_out) begin
195
              if (reset_out) begin
196
                           i <= 0;
197
                                rxd64 <=0;
198
                                rxc8 <=0;
199
                end
200
                        else begin
201
                           i <= i+1;
202
                                rxd64 <=taggedvector1[i];
203
                rxc8 <=taggedvector2[i];
204
//                              rxd64 <=testvector1[i];
205
//              rxc8 <=testvector2[i];
206
//                              rxd64 <=smallvector1[i];
207
//              rxc8 <=smallvector2[i];
208
                        end
209
        end
210
 
211
 
212
endmodule
213
 

powered by: WebSVN 2.1.0

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