af42634a8ef178ca336540cf25554949e5d53942
[debian/gnuradio] / usrp2 / fpga / eth / bench / verilog / error.scr
1 // This tests sends 5 packets, injecting a bit error in two of them\r
2 // to verify the Rx CRC check works. The corresponding RMON statistics\r
3 // counter is finally checked to verify that the error was registered\r
4 \r
5 // Read from register 24 to confirm that Rx CRC check is enabled\r
6 03 00 18 00 01 ff ff\r
7 \r
8 // Set speed to 1000 Mbps\r
9 01 00 22 00 04\r
10 \r
11 // Setup Tx and Rx MAC addresses and type field to "IP"\r
12 // Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800\r
13 10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00\r
14 \r
15 //--- Packets #0 & 1 --------------------------------------------------------\r
16 \r
17 // Transmit a 200-byte frame 1 time - and expect it to be received again!\r
18 20 00 C8 00 01\r
19 \r
20 // Wait (indefinitely) for missing Rx packets\r
21 22 00 00 \r
22 \r
23 // Transmit a 200-byte frame 1 time - but expect to receive it with error!\r
24 25 00 C8 00 01\r
25 \r
26 // Inject a single bit error in the packet (data bit 0) - this will cause a CRC error\r
27 23 00 01\r
28 \r
29 // Wait (indefinitely) for missing Rx packets\r
30 22 00 00 \r
31 \r
32 //--- Packets #2 & 3 --------------------------------------------------------\r
33 \r
34 // Transmit a 200-byte frame 1 time - and expect it to be received again!\r
35 20 00 C8 00 01\r
36 \r
37 // Wait (indefinitely) for missing Rx packets\r
38 22 00 00 \r
39 \r
40 // Transmit a 200-byte frame 1 time - but expect to receive it with error!\r
41 25 00 C8 00 01\r
42 \r
43 // Inject a single bit error in the packet (data bit 7) - this will cause a CRC error\r
44 23 00 80\r
45 \r
46 // Wait (indefinitely) for missing Rx packets\r
47 22 00 00 \r
48 \r
49 //--- Packets #4 & 5 --------------------------------------------------------\r
50 \r
51 // Transmit a 200-byte frame 1 time - and expect it to be received again!\r
52 20 00 C8 00 01\r
53 \r
54 // Wait (indefinitely) for missing Rx packets\r
55 22 00 00 \r
56 \r
57 // Transmit a 200-byte frame 1 time - but don't expect it to be received again!\r
58 21 00 C8 00 01\r
59 \r
60 // Inject a single bit error in the packet (RxEn) - this will cause a packet discard!\r
61 // (because it happens early in the packet)\r
62 23 01 00\r
63 \r
64 // Wait (indefinitely) for missing Rx packets\r
65 22 00 00 \r
66 \r
67 //--- Packets #6 & 7 --------------------------------------------------------\r
68 \r
69 // Transmit a 200-byte frame 1 time - and expect it to be received again!\r
70 20 00 C8 00 01\r
71 \r
72 // Wait (indefinitely) for missing Rx packets\r
73 22 00 00 \r
74 \r
75 // Transmit a 200-byte frame 1 time - but don't expect it to be received again!\r
76 21 00 C8 00 01\r
77 \r
78 // Inject a single bit error in the packet (RxEr)\r
79 23 02 00\r
80 \r
81 // Wait (indefinitely) for missing Rx packets\r
82 22 00 00 \r
83 \r
84 //--- Packet #8 -------------------------------------------------------------\r
85 \r
86 // Transmit a 200-byte frame 1 time - and expect it to be received again!\r
87 20 00 C8 00 01\r
88 \r
89 // Wait (indefinitely) for missing Rx packets\r
90 22 00 00 \r
91 \r
92 //---------------------------------------------------------------------------\r
93 \r
94 // Set CPU_rd_addr to address RxCRCErrCounter\r
95 01 00 1C 00 05\r
96 \r
97 // Assert CPU_rd_apply\r
98 01 00 1D 00 01\r
99 \r
100 // Kill a little time while waiting for CPU_rd_grant to assert...\r
101 02 00 1E\r
102 02 00 1E\r
103 02 00 1E\r
104 02 00 1E\r
105 \r
106 // Confirm that CPU_rd_grant is asserted\r
107 03 00 1E 00 01 ff ff\r
108 \r
109 // Read & check low part of RxCRCErrCounter (0x0002)\r
110 03 00 1F 00 02 ff ff\r
111 \r
112 // Read & check high part of RxCRCErrCounter (0x0000)\r
113 03 00 20 00 00 ff ff\r
114 \r
115 // Negate CPU_rd_apply\r
116 01 00 1D 00 00\r
117 \r
118 //---------------------------------------------------------------------------\r
119 \r
120 // Set CPU_rd_addr to address RxTooShortTooLongCounter\r
121 01 00 1C 00 07\r
122 \r
123 // Assert CPU_rd_apply\r
124 01 00 1D 00 01\r
125 \r
126 // Kill a little time while waiting for CPU_rd_grant to assert...\r
127 02 00 1E\r
128 02 00 1E\r
129 02 00 1E\r
130 02 00 1E\r
131 \r
132 // Confirm that CPU_rd_grant is asserted\r
133 03 00 1E 00 01 ff ff\r
134 \r
135 // Read & check low part of RxTooShortTooLongCounter (0x0002)\r
136 03 00 1F 00 02 ff ff\r
137 \r
138 // Read & check high part of RxTooShortTooLongCounter (0x0000)\r
139 03 00 20 00 00 ff ff\r
140 \r
141 // Negate CPU_rd_apply\r
142 01 00 1D 00 00\r
143 \r
144 \r
145 // Halt\r
146 FF\r