-
Notifications
You must be signed in to change notification settings - Fork 0
/
arp.v
601 lines (557 loc) · 16.1 KB
/
arp.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
////////////////////////////////////////////////////////////////////////////////
//
// Filename: rtl/proto/arp.v
// {{{
// Project: KIMOS, a Mercury KX2 demonstration project
//
// Purpose: Scans incoming packet stream for ARP requests, and automatically
// transforms those requests to ARP replies when one is found.
// The ARP reply is then sent on the outgoing network packet stream port.
//
// Incoming packet format -> Outgoing packet format(if successful)
// {{{
// 0: SrcMAC0 Source MAC address, byte #0
// 1: SrcMAC1
// 2: SrcMAC2
// 3: SrcMAC3
// 4: SrcMAC4
// 5: SrcMAC5
// 6: ETYP0 0x08
// 7: ETYP1 0x06
// 8: HTYP0 0x00
// 9: HTYP1 0x01
// 10: PTYP0 0x08
// 11: PTYP1 0x00
// 12: HLEN 0x06
// 13: PLEN 0x04
// 14: OPER0 0x00
// 15: OPER1 0x01 -> 0x02
// 16: SHA0 SrcMAC0 -> MyMAC0
// 17: SHA1 SrcMAC1 -> MyMAC1
// 18: SHA2 SrcMAC2 -> MyMAC2
// 19: SHA3 SrcMAC3 -> MyMAC3
// 20: SHA4 SrcMAC4 -> MyMAC4
// 21: SHA5 SrcMAC5 -> MyMAC5
// 22: SPA0 SrcIP0
// 23: SPA1 SrcIP1
// 24: SPA2 SrcIP2
// 25: SPA3 SrcIP3
// 26: THA0 0xxx -> SrcMAC0
// 27: THA1 0xxx -> SrcMAC1
// 28: THA2 0xxx -> SrcMAC2
// 29: THA3 0xxx -> SrcMAC3
// 30: THA4 0xxx -> SrcMAC4
// 31: THA5 0xxx -> SrcMAC5
// 32: TPA0 MyIP0 -> SrcIP0
// 33: TPA1 MyIP1 -> SrcIP1
// 34: TPA2 MyIP2 -> SrcIP2
// 35: TPA3 MyIP3 -> SrcIP3 -> MATCH (or NONE)
// 36-?? 0xxx -> 0x00
// }}}
//
// Creator: Dan Gisselquist, Ph.D.
// Gisselquist Technology, LLC
//
////////////////////////////////////////////////////////////////////////////////
// }}}
// Copyright (C) 2024, Gisselquist Technology, LLC
// {{{
// This file is part of the KIMOS project.
//
// The KIMOS project is free software and gateware: you can redistribute it
// and/or modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program. (It's in the $(ROOT)/doc directory. Run make with no
// target there if the PDF file isn't present.) If not, see
// <http://www.gnu.org/licenses/> for a copy.
// }}}
// License: GPL, v3, as defined and found on www.gnu.org,
// {{{
// http://www.gnu.org/licenses/gpl.html
//
////////////////////////////////////////////////////////////////////////////////
//
`default_nettype none
// }}}
module arp // #()
(
// {{{
input wire S_AXI_ACLK,
input wire S_AXI_ARESETN,
// Incoming packets--may or may not be ARP requests
// {{{
input wire S_AXIN_VALID,
output reg S_AXIN_READY,
input wire [7:0] S_AXIN_DATA,
input wire S_AXIN_LAST,
input wire S_AXIN_ABORT,
// }}}
// Outgoing packet interface
// {{{
output reg M_AXIN_VALID,
input wire M_AXIN_READY,
output reg [7:0] M_AXIN_DATA,
output reg M_AXIN_LAST,
output reg M_AXIN_ABORT,
// }}}
// Configuration interface
input wire [47:0] i_hwmac,
input wire [31:0] i_ipaddr,
output reg o_match,
output reg o_no_match,
output wire [3:0] o_debug
// }}}
);
// Local declarations
// {{{
reg [47:0] src_mac;
reg [31:0] src_ip;
reg [5:0] addr;
reg mid_packet;
assign o_debug = { mid_packet, addr[5:3] };
// }}}
// S_AXIN_READY
// {{{
always @(*)
S_AXIN_READY = M_AXIN_READY || !M_AXIN_VALID || o_no_match;
// }}}
// mid_packet
// {{{
// Based on the source interface alone
always @(posedge S_AXI_ACLK)
if (!S_AXI_ARESETN)
mid_packet <= 0;
else if (S_AXIN_VALID && S_AXIN_READY)
mid_packet <= !S_AXIN_ABORT && !S_AXIN_LAST;
else if (!S_AXIN_VALID && S_AXIN_ABORT)
mid_packet <= 0;
// }}}
// M_AXIN_VALID
// {{{
initial M_AXIN_VALID = 0;
always @(posedge S_AXI_ACLK)
if (!S_AXI_ARESETN)
M_AXIN_VALID <= 0;
else if (!M_AXIN_VALID || M_AXIN_READY)
M_AXIN_VALID <= S_AXIN_VALID && !o_no_match;
// }}}
// M_AXIN_ABORT
// {{{
always @(posedge S_AXI_ACLK)
if (!S_AXI_ARESETN)
M_AXIN_ABORT <= 0;
else if (!M_AXIN_VALID || M_AXIN_READY)
begin
if (!mid_packet)
M_AXIN_ABORT <= 0;
if (mid_packet || S_AXIN_VALID)
begin
if (o_no_match)
M_AXIN_ABORT <= 1;
if (S_AXIN_ABORT)
M_AXIN_ABORT <= 1;
if (S_AXIN_VALID && S_AXIN_LAST && (addr < 35))
M_AXIN_ABORT <= 1;
end
end else if ((S_AXIN_ABORT || o_no_match) && mid_packet)
M_AXIN_ABORT <= 1;
// }}}
// addr
// {{{
// Based on the source interface alone (again)
always @(posedge S_AXI_ACLK)
if (!S_AXI_ARESETN)
addr <= 0;
else if (S_AXIN_ABORT || (S_AXIN_VALID && S_AXIN_READY && S_AXIN_LAST))
addr <= 0;
else if (S_AXIN_VALID && S_AXIN_READY && (addr < 40))
addr <= addr + 1;
// }}}
// o_no_match, o_match
// {{{
initial { o_no_match, o_match } = 0;
always @(posedge S_AXI_ACLK)
if (!S_AXI_ARESETN)
{ o_no_match, o_match } <= 0;
else if (S_AXIN_ABORT || (S_AXIN_VALID && S_AXIN_READY && S_AXIN_LAST))
{ o_no_match, o_match } <= 0;
else if (S_AXIN_VALID && S_AXIN_READY)
case(addr)
6: if (S_AXIN_DATA != 8'h08) o_no_match <= 1;
7: if (S_AXIN_DATA != 8'h06) o_no_match <= 1;
8: if (S_AXIN_DATA != 8'h00) o_no_match <= 1;
9: if (S_AXIN_DATA != 8'h01) o_no_match <= 1;
10: if (S_AXIN_DATA != 8'h08) o_no_match <= 1;
11: if (S_AXIN_DATA != 8'h00) o_no_match <= 1;
12: if (S_AXIN_DATA != 8'h06) o_no_match <= 1;
13: if (S_AXIN_DATA != 8'h04) o_no_match <= 1;
14: if (S_AXIN_DATA != 8'h00) o_no_match <= 1;
15: if (S_AXIN_DATA != 8'h01) o_no_match <= 1;
16: if (S_AXIN_DATA != src_mac[47:40]) o_no_match <= 1;
17: if (S_AXIN_DATA != src_mac[39:32]) o_no_match <= 1;
18: if (S_AXIN_DATA != src_mac[31:24]) o_no_match <= 1;
19: if (S_AXIN_DATA != src_mac[23:16]) o_no_match <= 1;
20: if (S_AXIN_DATA != src_mac[15: 8]) o_no_match <= 1;
21: if (S_AXIN_DATA != src_mac[ 7: 0]) o_no_match <= 1;
32: if (S_AXIN_DATA != i_ipaddr[31:24]) o_no_match <= 1;
33: if (S_AXIN_DATA != i_ipaddr[23:16]) o_no_match <= 1;
34: if (S_AXIN_DATA != i_ipaddr[15: 8]) o_no_match <= 1;
35: if (S_AXIN_DATA != i_ipaddr[ 7: 0]) o_no_match <= 1;
else o_match <= !o_no_match;
default: begin end
endcase
`ifdef FORMAL
always @(*)
if (S_AXI_ARESETN)
begin
if (addr >= 36)
assert(o_match || o_no_match);
if (addr > 0 && addr < 36)
assert(!o_match);
assert(!o_match || !o_no_match);
if (!mid_packet)
assert(!o_match && !o_no_match);
end
`endif
// }}}
// src_mac
// {{{
always @(posedge S_AXI_ACLK)
if (S_AXIN_VALID && S_AXIN_READY && (addr < 6))
src_mac <= { src_mac[39:0], S_AXIN_DATA };
// }}}
// src_ip
// {{{
always @(posedge S_AXI_ACLK)
if (S_AXIN_VALID && S_AXIN_READY && (addr < 26))
src_ip <= { src_ip[23:0], S_AXIN_DATA };
// }}}
// M_AXIN_LAST
// {{{
always @(posedge S_AXI_ACLK)
if (!M_AXIN_VALID || M_AXIN_READY)
M_AXIN_LAST <= S_AXIN_LAST;
// }}}
// M_AXIN_DATA
// {{{
always @(posedge S_AXI_ACLK)
if (S_AXIN_VALID && (!M_AXIN_VALID || M_AXIN_READY))
case(addr)
15: M_AXIN_DATA <= 8'h02;
16: M_AXIN_DATA <= i_hwmac[47:40];
17: M_AXIN_DATA <= i_hwmac[39:32];
18: M_AXIN_DATA <= i_hwmac[31:24];
19: M_AXIN_DATA <= i_hwmac[23:16];
20: M_AXIN_DATA <= i_hwmac[15: 8];
21: M_AXIN_DATA <= i_hwmac[ 7: 0];
22: M_AXIN_DATA <= i_ipaddr[31:24];
23: M_AXIN_DATA <= i_ipaddr[23:16];
24: M_AXIN_DATA <= i_ipaddr[15: 8];
25: M_AXIN_DATA <= i_ipaddr[ 7: 0];
26: M_AXIN_DATA <= src_mac[47:40];
27: M_AXIN_DATA <= src_mac[39:32];
28: M_AXIN_DATA <= src_mac[31:24];
29: M_AXIN_DATA <= src_mac[23:16];
30: M_AXIN_DATA <= src_mac[15: 8];
31: M_AXIN_DATA <= src_mac[ 7: 0];
32: M_AXIN_DATA <= src_ip[31:24];
33: M_AXIN_DATA <= src_ip[23:16];
34: M_AXIN_DATA <= src_ip[15: 8];
35: M_AXIN_DATA <= src_ip[ 7: 0];
default: if (addr >= 36)
M_AXIN_DATA <= 8'h0;
else
M_AXIN_DATA <= S_AXIN_DATA;
endcase
// }}}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// Formal properties
// {{{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
`ifdef FORMAL
reg f_past_valid;
wire [10:0] s_words, m_words;
(* anyconst *) reg f_never_abort;
initial f_past_valid = 0;
always @(posedge S_AXI_ACLK)
f_past_valid <= 1;
always @(*)
if (!f_past_valid)
assume(!S_AXI_ARESETN);
////////////////////////////////////////////////////////////////////////
//
// Assumptions
// {{{
////////////////////////////////////////////////////////////////////////
//
//
always @(posedge S_AXI_ACLK)
assume($stable(i_hwmac));
always @(posedge S_AXI_ACLK)
assume($stable(i_ipaddr));
// }}}
////////////////////////////////////////////////////////////////////////
//
// Never abort checks
// {{{
////////////////////////////////////////////////////////////////////////
//
//
always @(*)
if (f_never_abort)
begin
assume(!S_AXIN_ABORT);
assume(!o_no_match);
if (M_AXIN_VALID)
assume(M_AXIN_READY);
if (S_AXIN_VALID && s_words < 35)
assume(!S_AXIN_LAST);
if (S_AXI_ARESETN)
assert(!M_AXIN_ABORT);
end
// }}}
////////////////////////////////////////////////////////////////////////
//
// Interface properties
// {{{
////////////////////////////////////////////////////////////////////////
//
//
faxin_slave #(
.DATA_WIDTH(8),
.MIN_LENGTH(24)
) fslv (
// {{{
.S_AXI_ACLK(S_AXI_ACLK),
.S_AXI_ARESETN(S_AXI_ARESETN),
.S_AXIN_VALID(S_AXIN_VALID),
.S_AXIN_READY(S_AXIN_READY),
.S_AXIN_DATA( S_AXIN_DATA),
.S_AXIN_LAST( S_AXIN_LAST),
.S_AXIN_ABORT(S_AXIN_ABORT),
.f_stream_word(s_words)
// }}}
);
faxin_master #(
.DATA_WIDTH(8),
.MIN_LENGTH(24)
) fmst (
// {{{
.S_AXI_ACLK(S_AXI_ACLK),
.S_AXI_ARESETN(S_AXI_ARESETN),
.S_AXIN_VALID(M_AXIN_VALID),
.S_AXIN_READY(M_AXIN_READY),
.S_AXIN_DATA( M_AXIN_DATA),
.S_AXIN_LAST( M_AXIN_LAST),
.S_AXIN_ABORT(M_AXIN_ABORT),
.f_stream_word(m_words)
// }}}
);
always @(posedge S_AXI_ACLK)
if (S_AXI_ARESETN)
assert(S_AXIN_ABORT || mid_packet == (s_words != 0));
always @(posedge S_AXI_ACLK)
if (S_AXI_ARESETN && M_AXIN_VALID)
assert((M_AXIN_ABORT || M_AXIN_LAST) || addr > 0);
always @(posedge S_AXI_ACLK)
if (S_AXI_ARESETN && (!S_AXIN_VALID || !S_AXIN_ABORT))
begin
assert(mid_packet == (addr > 0));
assert(mid_packet == (s_words > 0));
if (addr < 40)
assert(addr == s_words);
else
assert(addr == 40);
end
always @(posedge S_AXI_ACLK)
if (S_AXI_ARESETN && !M_AXIN_ABORT)
begin
if (addr < 40)
assert(s_words == addr);
else begin
assert(addr == 40);
assert(s_words >= addr);
end
if (M_AXIN_VALID && M_AXIN_LAST)
assert(s_words == 0);
if (s_words > 0)
begin
assert(m_words + (M_AXIN_VALID ? 1:0) == s_words);
end else if (m_words != 0)
begin
assert(M_AXIN_VALID && M_AXIN_LAST);
end
end
// }}}
////////////////////////////////////////////////////////////////////////
//
// Contract check
// {{{
////////////////////////////////////////////////////////////////////////
//
//
(* anyconst *) reg f_check_pkt;
(* anyconst *) reg [47:0] f_src_hwmac;
(* anyconst *) reg [31:0] f_src_ipaddr;
reg [5:0] f_addr;
initial f_addr = 0;
always @(posedge S_AXI_ACLK)
if (!S_AXI_ARESETN)
f_addr <= 0;
else if (S_AXIN_VALID && S_AXIN_READY)
f_addr <= addr;
// Assume a valid packet coming in
// {{{
always @(*)
if (f_check_pkt && S_AXIN_VALID && !S_AXIN_ABORT)
case(addr)
0: assume(S_AXIN_DATA == f_src_hwmac[47:40]);
1: assume(S_AXIN_DATA == f_src_hwmac[39:32]);
2: assume(S_AXIN_DATA == f_src_hwmac[31:24]);
3: assume(S_AXIN_DATA == f_src_hwmac[23:16]);
4: assume(S_AXIN_DATA == f_src_hwmac[15: 8]);
5: assume(S_AXIN_DATA == f_src_hwmac[ 7: 0]);
6: assume(S_AXIN_DATA == 8'h08);
7: assume(S_AXIN_DATA == 8'h06);
8: assume(S_AXIN_DATA == 8'h00);
9: assume(S_AXIN_DATA == 8'h01);
10: assume(S_AXIN_DATA == 8'h08);
11: assume(S_AXIN_DATA == 8'h00);
12: assume(S_AXIN_DATA == 8'h06);
13: assume(S_AXIN_DATA == 8'h04);
14: assume(S_AXIN_DATA == 8'h00);
15: assume(S_AXIN_DATA == 8'h01);
16: assume(S_AXIN_DATA == f_src_hwmac[47:40]);
17: assume(S_AXIN_DATA == f_src_hwmac[39:32]);
18: assume(S_AXIN_DATA == f_src_hwmac[31:24]);
19: assume(S_AXIN_DATA == f_src_hwmac[23:16]);
20: assume(S_AXIN_DATA == f_src_hwmac[15: 8]);
21: assume(S_AXIN_DATA == f_src_hwmac[ 7: 0]);
22: assume(S_AXIN_DATA == f_src_ipaddr[31:24]);
23: assume(S_AXIN_DATA == f_src_ipaddr[23:16]);
24: assume(S_AXIN_DATA == f_src_ipaddr[15: 8]);
25: assume(S_AXIN_DATA == f_src_ipaddr[ 7: 0]);
// 26,27,28,29,30,31 --> don't care
32: assume(S_AXIN_DATA == i_ipaddr[31:24]);
33: assume(S_AXIN_DATA == i_ipaddr[23:16]);
34: assume(S_AXIN_DATA == i_ipaddr[15: 8]);
35: assume(S_AXIN_DATA == i_ipaddr[ 7: 0]);
endcase
// }}}
// Check the src mac
// {{{
always @(posedge S_AXI_ACLK)
if (S_AXI_ARESETN && f_check_pkt)
begin
case(addr)
0: begin end
1: assert(src_mac[ 7:0] == f_src_hwmac[47:40]);
2: assert(src_mac[15:0] == f_src_hwmac[47:32]);
3: assert(src_mac[23:0] == f_src_hwmac[47:24]);
4: assert(src_mac[31:0] == f_src_hwmac[47:16]);
5: assert(src_mac[39:0] == f_src_hwmac[47: 8]);
default:
assert(src_mac[47:0] == f_src_hwmac[47:0]);
endcase
end
// }}}
// Check the src IP address
// {{{
always @(posedge S_AXI_ACLK)
if (S_AXI_ARESETN && f_check_pkt)
begin
case(addr)
23: assert(src_ip[ 7:0] == f_src_ipaddr[31:24]);
24: assert(src_ip[15:0] == f_src_ipaddr[31:16]);
25: assert(src_ip[23:0] == f_src_ipaddr[31: 8]);
default: if (addr >= 26)
assert(src_ip[31:0] == f_src_ipaddr[31:0]);
endcase
end
// }}}
// Assert the correct packet going out
// {{{
always @(*)
if (S_AXI_ARESETN && f_check_pkt && M_AXIN_VALID && !M_AXIN_ABORT)
case(f_addr)
0: assert(M_AXIN_DATA == f_src_hwmac[47:40]);
1: assert(M_AXIN_DATA == f_src_hwmac[39:32]);
2: assert(M_AXIN_DATA == f_src_hwmac[31:24]);
3: assert(M_AXIN_DATA == f_src_hwmac[23:16]);
4: assert(M_AXIN_DATA == f_src_hwmac[15: 8]);
5: assert(M_AXIN_DATA == f_src_hwmac[ 7: 0]);
6: assert(M_AXIN_DATA == 8'h08);
7: assert(M_AXIN_DATA == 8'h06);
8: assert(M_AXIN_DATA == 8'h00);
9: assert(M_AXIN_DATA == 8'h01);
10: assert(M_AXIN_DATA == 8'h08);
11: assert(M_AXIN_DATA == 8'h00);
12: assert(M_AXIN_DATA == 8'h06);
13: assert(M_AXIN_DATA == 8'h04);
14: assert(M_AXIN_DATA == 8'h00);
15: assert(M_AXIN_DATA == 8'h02);
16: assert(M_AXIN_DATA == i_hwmac[47:40]);
17: assert(M_AXIN_DATA == i_hwmac[39:32]);
18: assert(M_AXIN_DATA == i_hwmac[31:24]);
19: assert(M_AXIN_DATA == i_hwmac[23:16]);
20: assert(M_AXIN_DATA == i_hwmac[15: 8]);
21: assert(M_AXIN_DATA == i_hwmac[ 7: 0]);
22: assert(M_AXIN_DATA == i_ipaddr[31:24]);
23: assert(M_AXIN_DATA == i_ipaddr[23:16]);
24: assert(M_AXIN_DATA == i_ipaddr[15: 8]);
25: assert(M_AXIN_DATA == i_ipaddr[ 7: 0]);
26: assert(M_AXIN_DATA == f_src_hwmac[47:40]);
27: assert(M_AXIN_DATA == f_src_hwmac[39:32]);
28: assert(M_AXIN_DATA == f_src_hwmac[31:24]);
29: assert(M_AXIN_DATA == f_src_hwmac[23:16]);
30: assert(M_AXIN_DATA == f_src_hwmac[15: 8]);
31: assert(M_AXIN_DATA == f_src_hwmac[ 7: 0]);
32: assert(M_AXIN_DATA == f_src_ipaddr[31:24]);
33: assert(M_AXIN_DATA == f_src_ipaddr[23:16]);
34: assert(M_AXIN_DATA == f_src_ipaddr[15: 8]);
35: assert(M_AXIN_DATA == f_src_ipaddr[ 7: 0]);
default: if (f_addr >= 36)
assert(M_AXIN_DATA == 8'h00);
endcase
// }}}
always @(*)
if (f_check_pkt)
begin
if (f_addr >= 36)
assert(o_match || M_AXIN_LAST || M_AXIN_ABORT || addr == 0);
assert(!o_no_match);
end
always @(*)
if (S_AXI_ARESETN && !M_AXIN_ABORT && addr > 0 && addr < 40)
assert(addr == f_addr + 1);
// }}}
////////////////////////////////////////////////////////////////////////
//
// Cover check
// {{{
////////////////////////////////////////////////////////////////////////
//
//
always @(posedge S_AXI_ACLK)
if (S_AXI_ARESETN)
begin
cover(f_check_pkt && M_AXIN_VALID && M_AXIN_LAST
&& !M_AXIN_ABORT && f_addr == 35);
end
// }}}
`endif
// }}}
endmodule