-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamba5c4unrealy.aag
executable file
·1144 lines (1064 loc) · 28.9 KB
/
amba5c4unrealy.aag
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
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
aag 412 26 43 1 343
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54 1
56 10
58 48
60 14
62 694
64 46
66 18
68 717
70 735
72 6
74 42
76 741
78 26
80 24
82 8
84 34
86 22
88 749
90 752
92 36
94 20
96 52
98 756
100 2
102 38
104 767
106 16
108 778
110 788
112 796
114 805
116 813
118 817
120 604
122 820
124 40
126 12
128 28
130 161
132 824
134 44
136 4
138 50
602
140 35 12
142 37 16
144 143 141
146 39 20
148 147 144
150 41 22
152 151 148
154 45 24
156 155 152
158 130 54
160 159 156
162 51 49
164 162 47
166 138 54
168 58 54
170 169 167
172 64 54
174 173 170
176 175 164
178 174 165
180 179 177
182 181 8
184 50 48
186 184 47
188 40 27
190 41 26
192 191 189
194 193 186
196 51 48
198 196 47
200 38 27
202 39 26
204 203 201
206 205 198
208 34 27
210 35 26
212 211 209
214 213 164
216 50 49
218 216 47
220 36 27
222 37 26
224 223 221
226 225 218
228 162 46
230 44 27
232 45 26
234 233 231
236 235 228
238 68 54
240 70 54
242 241 239
244 76 54
246 245 242
248 88 54
250 128 54
252 250 249
254 252 246
256 255 9
258 72 54
260 258 53
262 259 52
264 263 261
266 66 54
268 267 228
270 266 229
272 271 269
274 60 54
276 275 186
278 274 187
280 279 277
282 56 54
284 283 198
286 282 199
288 287 285
290 100 54
292 290 164
294 291 165
296 295 293
298 136 54
300 299 218
302 298 219
304 303 301
306 304 296
308 306 288
310 308 280
312 310 272
314 312 264
316 315 250
318 317 257
320 318 237
322 320 227
324 322 215
326 324 207
328 326 195
330 328 183
332 169 166
334 332 173
336 335 218
338 334 219
340 339 337
342 341 8
344 343 330
346 168 167
348 346 173
350 349 198
352 348 199
354 353 351
356 355 8
358 357 344
360 168 166
362 360 173
364 363 186
366 362 187
368 367 365
370 369 8
372 371 358
374 172 170
376 375 228
378 374 229
380 379 377
382 381 8
384 383 372
386 96 54
388 387 52
390 386 53
392 391 389
394 393 8
396 395 384
398 126 54
400 74 54
402 401 398
404 402 3
406 404 7
408 407 396
410 401 399
412 410 3
414 412 6
416 415 408
418 106 54
420 418 401
422 420 4
424 422 7
426 425 416
428 419 401
430 428 4
432 430 6
434 433 426
436 94 54
438 436 401
440 438 10
442 440 7
444 443 434
446 437 401
448 446 10
450 448 6
452 451 444
454 86 54
456 454 401
458 456 14
460 458 7
462 461 452
464 455 401
466 464 14
468 466 6
470 469 462
472 80 54
474 472 401
476 474 18
478 476 7
480 479 470
482 473 401
484 482 18
486 484 6
488 487 480
490 291 2
492 290 3
494 493 491
496 495 400
498 497 488
500 298 5
502 299 4
504 503 501
506 505 400
508 507 498
510 282 11
512 283 10
514 513 511
516 515 400
518 517 508
520 274 15
522 275 14
524 523 521
526 525 400
528 527 518
530 266 19
532 267 18
534 533 531
536 535 400
538 537 528
540 258 7
542 259 6
544 543 541
546 545 400
548 547 538
550 90 54
552 37 4
554 552 550
556 555 548
558 98 54
560 39 10
562 560 558
564 563 556
566 122 54
568 41 14
570 568 566
572 571 564
574 132 54
576 45 18
578 576 574
580 579 572
582 135 85
584 125 103
586 584 93
588 586 582
590 589 54
592 591 401
594 592 2
596 595 580
598 112 54
600 599 596
602 601 160
604 120 54
606 118 54
608 114 54
610 116 54
612 610 609
614 612 606
616 614 605
618 229 44
620 619 616
622 612 607
624 622 605
626 165 34
628 627 624
630 611 609
632 630 607
634 632 605
636 634 249
638 611 608
640 638 607
642 640 605
644 642 246
646 645 637
648 646 629
650 638 606
652 650 605
654 187 40
656 655 652
658 630 606
660 658 605
662 199 38
664 663 660
666 610 608
668 666 607
670 668 605
672 219 36
674 673 670
676 675 665
678 676 657
680 678 648
682 680 621
684 62 54
686 104 54
688 687 685
690 684 29
692 691 689
694 693 682
696 52 9
698 696 33
700 698 246
702 700 30
704 702 29
706 245 28
708 707 239
710 706 238
712 711 709
714 712 243
716 715 705
718 702 28
720 240 238
722 720 245
724 722 28
726 725 240
728 241 238
730 728 706
732 731 727
734 732 719
736 242 28
738 737 244
740 739 725
742 248 26
744 249 31
746 744 698
748 747 743
750 551 4
752 751 37
754 559 10
756 755 39
758 687 52
760 33 31
762 760 758
764 686 26
766 765 763
768 684 28
770 108 54
772 770 768
774 771 769
776 775 773
778 776 682
780 110 54
782 781 773
784 780 772
786 785 783
788 786 682
790 785 599
792 784 598
794 793 791
796 794 682
798 682 608
800 665 629
802 800 637
804 802 799
806 682 610
808 657 629
810 808 645
812 810 807
814 682 606
816 815 678
818 567 14
820 819 41
822 575 18
824 823 45
i0 controllable_nhgrant0
i1 controllable_hgrant1
i2 controllable_locked
i3 controllable_nstart
i4 controllable_hgrant2
i5 i_hlock0
i6 controllable_hgrant3
i7 i_hlock1
i8 controllable_hgrant4
i9 i_hlock2
i10 i_hlock3
i11 i_hlock4
i12 controllable_busreq
i13 i_hready
i14 i_hburst1
i15 i_hburst0
i16 i_hbusreq0
i17 i_hbusreq1
i18 i_hbusreq2
i19 i_hbusreq3
i20 controllable_ndecide
i21 i_hbusreq4
i22 controllable_hmaster2
i23 controllable_hmaster1
i24 controllable_hmaster0
i25 controllable_hmastlock
l0 n55
l1 reg_controllable_hgrant2_out
l2 reg_controllable_hmaster1_out
l3 reg_controllable_hgrant3_out
l4 next_env_fair_out
l5 reg_controllable_hmaster2_out
l6 reg_controllable_hgrant4_out
l7 reg_stateG3_0_out
l8 reg_stateG3_1_out
l9 reg_controllable_locked_out
l10 reg_controllable_ndecide_out
l11 reg_stateG3_2_out
l12 reg_controllable_busreq_out
l13 reg_i_hlock4_out
l14 reg_controllable_nstart_out
l15 reg_i_hbusreq0_out
l16 reg_i_hlock3_out
l17 reg_stateG2_out
l18 reg_stateG10_1_out
l19 reg_i_hbusreq1_out
l20 reg_i_hlock2_out
l21 reg_controllable_hmastlock_out
l22 reg_stateG10_2_out
l23 reg_controllable_nhgrant0_out
l24 reg_i_hbusreq2_out
l25 reg_stateA1_out
l26 reg_i_hlock1_out
l27 fair_cnt<0>_out
l28 fair_cnt<1>_out
l29 fair_cnt<2>_out
l30 next_sys_fair<0>_out
l31 next_sys_fair<1>_out
l32 next_sys_fair<2>_out
l33 next_sys_fair<3>_out
l34 reg_stateG10_3_out
l35 reg_i_hbusreq3_out
l36 reg_i_hlock0_out
l37 reg_i_hready_out
l38 env_safe_err_happened_out
l39 reg_stateG10_4_out
l40 reg_i_hbusreq4_out
l41 reg_controllable_hgrant1_out
l42 reg_controllable_hmaster0_out
o0 o_err
c
amba_5_new_4
This file was written by ABC on Sat Aug 31 20:24:50 2013
For information about AIGER format, refer to http://fmv.jku.at/aiger
-------------------------------
This AIGER file has been created by the following sequence of commands:
> vl2mv amba5c4unreal.v ---gives--> amba5c4unreal.mv
> abc -c "read_blif_mv amba5c4unreal.mv; strash; refactor; rewrite; dfraig; rewrite; dfraig; write_aiger -s amba5c4unrealy.aig" ---gives--> amba5c4unrealy.aig
> aigtoaig amba5c4unrealy.aig amba5c4unrealy.aag ---gives--> amba5c4unrealy.aag (this file)
Content of amba5c4unreal.v:
module amba_5_new_4(
o_err,
i_clk,
i_hready,
i_hbusreq0,
i_hlock0,
i_hbusreq1,
i_hlock1,
i_hbusreq2,
i_hlock2,
i_hbusreq3,
i_hlock3,
i_hbusreq4,
i_hlock4,
i_hburst0,
i_hburst1,
controllable_hmaster0,
controllable_hmaster1,
controllable_hmaster2,
controllable_hmastlock,
controllable_nstart,
controllable_ndecide,
controllable_locked,
controllable_nhgrant0,
controllable_hgrant1,
controllable_hgrant2,
controllable_hgrant3,
controllable_hgrant4,
controllable_busreq);
input i_clk;
input i_hready;
input i_hbusreq0;
input i_hlock0;
input i_hbusreq1;
input i_hlock1;
input i_hbusreq2;
input i_hlock2;
input i_hbusreq3;
input i_hlock3;
input i_hbusreq4;
input i_hlock4;
input i_hburst0;
input i_hburst1;
input controllable_hmaster0;
input controllable_hmaster1;
input controllable_hmaster2;
input controllable_hmastlock;
input controllable_nstart;
input controllable_ndecide;
input controllable_locked;
input controllable_nhgrant0;
input controllable_hgrant1;
input controllable_hgrant2;
input controllable_hgrant3;
input controllable_hgrant4;
input controllable_busreq;
output o_err;
reg reg_i_hready;
reg reg_i_hbusreq0;
reg reg_i_hlock0;
reg reg_i_hbusreq1;
reg reg_i_hlock1;
reg reg_i_hbusreq2;
reg reg_i_hlock2;
reg reg_i_hbusreq3;
reg reg_i_hlock3;
reg reg_i_hbusreq4;
reg reg_i_hlock4;
reg reg_controllable_hmaster0;
reg reg_controllable_hmaster1;
reg reg_controllable_hmaster2;
reg reg_controllable_hmastlock;
reg reg_controllable_nstart;
reg reg_controllable_ndecide;
reg reg_controllable_locked;
reg reg_controllable_nhgrant0;
reg reg_controllable_hgrant1;
reg reg_controllable_hgrant2;
reg reg_controllable_hgrant3;
reg reg_controllable_hgrant4;
reg reg_controllable_busreq;
reg reg_stateA1;
reg reg_stateG2;
reg reg_stateG3_0;
reg reg_stateG3_1;
reg reg_stateG3_2;
reg reg_stateG10_1;
reg reg_stateG10_2;
reg reg_stateG10_3;
reg reg_stateG10_4;
reg env_safe_err_happened;
reg next_env_fair;
reg [2:0] fair_cnt;
reg [3:0] next_sys_fair;
wire env_safe_err0;
wire env_safe_err1;
wire env_safe_err2;
wire env_safe_err3;
wire env_safe_err4;
wire env_safe_err;
wire sys_safe_err0;
wire sys_safe_err1;
wire sys_safe_err2;
wire sys_safe_err3;
wire sys_safe_err4;
wire sys_safe_err5;
wire sys_safe_err6;
wire sys_safe_err7;
wire sys_safe_err8;
wire sys_safe_err9;
wire sys_safe_err10;
wire sys_safe_err11;
wire sys_safe_err12;
wire sys_safe_err13;
wire sys_safe_err14;
wire sys_safe_err15;
wire sys_safe_err16;
wire sys_safe_err17;
wire sys_safe_err18;
wire sys_safe_err19;
wire sys_safe_err20;
wire sys_safe_err21;
wire sys_safe_err22;
wire sys_safe_err23;
wire sys_safe_err24;
wire sys_safe_err25;
wire sys_safe_err26;
wire sys_safe_err27;
wire sys_safe_err28;
wire sys_safe_err29;
wire sys_safe_err30;
wire sys_safe_err31;
wire sys_safe_err32;
wire sys_safe_err33;
wire sys_safe_err34;
wire sys_safe_err35;
wire sys_safe_err36;
wire sys_safe_err37;
wire sys_safe_err38;
wire sys_safe_err39;
wire sys_safe_err40;
wire sys_safe_err;
wire env_fair0;
wire env_fair1;
wire sys_fair0;
wire sys_fair1;
wire sys_fair2;
wire sys_fair3;
wire sys_fair4;
wire sys_fair5;
wire sys_fair6;
wire fair_err;
wire o_err;
// =============================================================
// ENV_TRANSITION:
// =============================================================
// Assumption 3:
// G( hlock0=1 -> hbusreq0=1 );
assign env_safe_err0 = ~(~ i_hlock0 | i_hbusreq0);
// Assumption 3:
// G( hlock1=1 -> hbusreq1=1 );
assign env_safe_err1 = ~(~ i_hlock1 | i_hbusreq1);
// Assumption 3:
// G( hlock2=1 -> hbusreq2=1 );
assign env_safe_err2 = ~(~ i_hlock2 | i_hbusreq2);
// Assumption 3:
// G( hlock3=1 -> hbusreq3=1 );
assign env_safe_err3 = ~(~ i_hlock3 | i_hbusreq3);
// Assumption 3:
// G( hlock4=1 -> hbusreq4=1 );
assign env_safe_err4 = ~(~ i_hlock4 | i_hbusreq4);
// collecting together the safety error bits:
assign env_safe_err = env_safe_err0 |
env_safe_err1 |
env_safe_err2 |
env_safe_err3 |
env_safe_err4;
// =============================================================
// SYS_TRANSITION:
// =============================================================
// G((hmaster0=0) * (hmaster1=0) * (hmaster2=0) -> (hbusreq0=0 <-> busreq=0));
assign sys_safe_err0 = ~( ~( ~(controllable_hmaster0) & ~(controllable_hmaster1) & ~(controllable_hmaster2) )|(~i_hbusreq0 ^~ (~controllable_busreq)));
// G((hmaster0=1) * (hmaster1=0) * (hmaster2=0) -> (hbusreq1=0 <-> busreq=0));
assign sys_safe_err1 = ~( ~( controllable_hmaster0 & ~(controllable_hmaster1) & ~(controllable_hmaster2) )|(~i_hbusreq1 ^~ (~controllable_busreq)));
// G((hmaster0=0) * (hmaster1=1) * (hmaster2=0) -> (hbusreq2=0 <-> busreq=0));
assign sys_safe_err2 = ~( ~( ~(controllable_hmaster0) & controllable_hmaster1 & ~(controllable_hmaster2) )|(~i_hbusreq2 ^~ (~controllable_busreq)));
// G((hmaster0=1) * (hmaster1=1) * (hmaster2=0) -> (hbusreq3=0 <-> busreq=0));
assign sys_safe_err3 = ~( ~( controllable_hmaster0 & controllable_hmaster1 & ~(controllable_hmaster2) )|(~i_hbusreq3 ^~ (~controllable_busreq)));
// G((hmaster0=0) * (hmaster1=0) * (hmaster2=1) -> (hbusreq4=0 <-> busreq=0));
assign sys_safe_err4 = ~( ~( ~(controllable_hmaster0) & ~(controllable_hmaster1) & controllable_hmaster2 )|(~i_hbusreq4 ^~ (~controllable_busreq)));
// Guarantee 1:
// G((hready=0) -> X(start=0));
assign sys_safe_err5 = ~( reg_i_hready | controllable_nstart );
// G(((stateG2=1) * (start=1)) -> FALSE;
assign sys_safe_err6 = ~( ~(reg_stateG2 & ~controllable_nstart) | 0 );
// G(((stateG3_0=1) * (stateG3_1=0) * (stateG3_2=0) * ((start=1))) -> FALSE);
// G(((stateG3_0=0) * (stateG3_1=1) * (stateG3_2=0) * ((start=1))) -> FALSE);
// G(((stateG3_0=1) * (stateG3_1=1) * (stateG3_2=0) * ((start=1))) -> FALSE);
// G(((stateG3_0=0) * (stateG3_1=0) * (stateG3_2=1) * ((start=1))) -> FALSE);
// all these rules can be summarized as: only in state 000, start=1 is allowed:
assign sys_safe_err7 = (reg_stateG3_0 | reg_stateG3_1 | reg_stateG3_2) & ~controllable_nstart;
// G( (hready=1) -> ( (hgrant0=1) <-> (X(hmaster0=0) * X(hmaster1=0) * X(hmaster2=0)) ) );
assign sys_safe_err8 = ~( ~(reg_i_hready) | ( ~reg_controllable_nhgrant0 ^~ ( ~(controllable_hmaster0) & ~(controllable_hmaster1) & ~(controllable_hmaster2) ) ) );
// G( (hready=1) -> ( (hgrant1=1) <-> (X(hmaster0=1) * X(hmaster1=0) * X(hmaster2=0)) ) );
assign sys_safe_err9 = ~( ~(reg_i_hready) | ( reg_controllable_hgrant1 ^~ ( controllable_hmaster0 & ~(controllable_hmaster1) & ~(controllable_hmaster2) ) ) );
// G( (hready=1) -> ( (hgrant2=1) <-> (X(hmaster0=0) * X(hmaster1=1) * X(hmaster2=0)) ) );
assign sys_safe_err10 = ~( ~(reg_i_hready) | ( reg_controllable_hgrant2 ^~ ( ~(controllable_hmaster0) & controllable_hmaster1 & ~(controllable_hmaster2) ) ) );
// G( (hready=1) -> ( (hgrant3=1) <-> (X(hmaster0=1) * X(hmaster1=1) * X(hmaster2=0)) ) );
assign sys_safe_err11 = ~( ~(reg_i_hready) | ( reg_controllable_hgrant3 ^~ ( controllable_hmaster0 & controllable_hmaster1 & ~(controllable_hmaster2) ) ) );
// G( (hready=1) -> ( (hgrant4=1) <-> (X(hmaster0=0) * X(hmaster1=0) * X(hmaster2=1)) ) );
assign sys_safe_err12 = ~( ~(reg_i_hready) | ( reg_controllable_hgrant4 ^~ ( ~(controllable_hmaster0) & ~(controllable_hmaster1) & controllable_hmaster2 ) ) );
// HMASTLOCK:
// G( (hready=1) -> (locked=0 <-> X(hmastlock=0) ) );
assign sys_safe_err13 = ~( ~(reg_i_hready) | (~reg_controllable_locked ^~ ~controllable_hmastlock) );
// Master 0:
// G( X(start=0) -> ( ((hmaster0=0) * (hmaster1=0) * (hmaster2=0)) <-> (X(hmaster0=0) * X(hmaster1=0) * X(hmaster2=0)) ) );
assign sys_safe_err14 = ~( ~(controllable_nstart) | ( ( ~(reg_controllable_hmaster0) & ~(reg_controllable_hmaster1) & ~(reg_controllable_hmaster2) ) ^~ ( ~(controllable_hmaster0) & ~(controllable_hmaster1) & ~(controllable_hmaster2) )) );
// Master 1:
// G( X(start=0) -> ( ((hmaster0=1) * (hmaster1=0) * (hmaster2=0)) <-> (X(hmaster0=1) * X(hmaster1=0) * X(hmaster2=0)) ) );
assign sys_safe_err15 = ~( ~(controllable_nstart) | ( ( reg_controllable_hmaster0 & ~(reg_controllable_hmaster1) & ~(reg_controllable_hmaster2) ) ^~ ( controllable_hmaster0 & ~(controllable_hmaster1) & ~(controllable_hmaster2) )) );
// Master 2:
// G( X(start=0) -> ( ((hmaster0=0) * (hmaster1=1) * (hmaster2=0)) <-> (X(hmaster0=0) * X(hmaster1=1) * X(hmaster2=0)) ) );
assign sys_safe_err16 = ~( ~(controllable_nstart) | ( ( ~(reg_controllable_hmaster0) & reg_controllable_hmaster1 & ~(reg_controllable_hmaster2) ) ^~ ( ~(controllable_hmaster0) & controllable_hmaster1 & ~(controllable_hmaster2) )) );
// Master 3:
// G( X(start=0) -> ( ((hmaster0=1) * (hmaster1=1) * (hmaster2=0)) <-> (X(hmaster0=1) * X(hmaster1=1) * X(hmaster2=0)) ) );
assign sys_safe_err17 = ~( ~(controllable_nstart) | ( ( reg_controllable_hmaster0 & reg_controllable_hmaster1 & ~(reg_controllable_hmaster2) ) ^~ ( controllable_hmaster0 & controllable_hmaster1 & ~(controllable_hmaster2) )) );
// Master 4:
// G( X(start=0) -> ( ((hmaster0=0) * (hmaster1=0) * (hmaster2=1)) <-> (X(hmaster0=0) * X(hmaster1=0) * X(hmaster2=1)) ) );
assign sys_safe_err18 = ~( ~(controllable_nstart) | ( ( ~(reg_controllable_hmaster0) & ~(reg_controllable_hmaster1) & reg_controllable_hmaster2 ) ^~ ( ~(controllable_hmaster0) & ~(controllable_hmaster1) & controllable_hmaster2 )) );
// Guarantee 6.2:
// G( ((X(start=0))) -> ( (hmastlock=1) <-> X(hmastlock=1)) );
assign sys_safe_err19 = ~( ~(controllable_nstart) | ( reg_controllable_hmastlock ^~ controllable_hmastlock) );
// G( (decide=1 * hlock0=1 * X(hgrant0=1) )->X(locked=1));
assign sys_safe_err20 = ~( ~(~reg_controllable_ndecide & reg_i_hlock0 & ~controllable_nhgrant0) | (controllable_locked) );
// G((decide=1 * hlock0=0 * X(hgrant0=1))->X(locked=0));
assign sys_safe_err21 = ~( ~(~reg_controllable_ndecide & ~reg_i_hlock0 & ~controllable_nhgrant0) | (~controllable_locked) );
// G( (decide=1 * hlock1=1 * X(hgrant1=1) )->X(locked=1));
assign sys_safe_err22 = ~( ~(~reg_controllable_ndecide & reg_i_hlock1 & controllable_hgrant1) | (controllable_locked) );
// G((decide=1 * hlock1=0 * X(hgrant1=1))->X(locked=0));
assign sys_safe_err23 = ~( ~(~reg_controllable_ndecide & ~reg_i_hlock1 & controllable_hgrant1) | (~controllable_locked) );
// G( (decide=1 * hlock2=1 * X(hgrant2=1) )->X(locked=1));
assign sys_safe_err24 = ~( ~(~reg_controllable_ndecide & reg_i_hlock2 & controllable_hgrant2) | (controllable_locked) );
// G((decide=1 * hlock2=0 * X(hgrant2=1))->X(locked=0));
assign sys_safe_err25 = ~( ~(~reg_controllable_ndecide & ~reg_i_hlock2 & controllable_hgrant2) | (~controllable_locked) );
// G( (decide=1 * hlock3=1 * X(hgrant3=1) )->X(locked=1));
assign sys_safe_err26 = ~( ~(~reg_controllable_ndecide & reg_i_hlock3 & controllable_hgrant3) | (controllable_locked) );
// G((decide=1 * hlock3=0 * X(hgrant3=1))->X(locked=0));
assign sys_safe_err27 = ~( ~(~reg_controllable_ndecide & ~reg_i_hlock3 & controllable_hgrant3) | (~controllable_locked) );
// G( (decide=1 * hlock4=1 * X(hgrant4=1) )->X(locked=1));
assign sys_safe_err28 = ~( ~(~reg_controllable_ndecide & reg_i_hlock4 & controllable_hgrant4) | (controllable_locked) );
// G((decide=1 * hlock4=0 * X(hgrant4=1))->X(locked=0));
assign sys_safe_err29 = ~( ~(~reg_controllable_ndecide & ~reg_i_hlock4 & controllable_hgrant4) | (~controllable_locked) );
// G( (decide=0) -> ( ((hgrant0=0)<->X(hgrant0=0)) ));
assign sys_safe_err30 = ~( ~(reg_controllable_ndecide) | (reg_controllable_nhgrant0 ^~ controllable_nhgrant0) );
// G( (decide=0) -> ( ((hgrant1=0)<->X(hgrant1=0)) ));
assign sys_safe_err31 = ~( ~(reg_controllable_ndecide) | (~reg_controllable_hgrant1 ^~ ~controllable_hgrant1) );
// G( (decide=0) -> ( ((hgrant2=0)<->X(hgrant2=0)) ));
assign sys_safe_err32 = ~( ~(reg_controllable_ndecide) | (~reg_controllable_hgrant2 ^~ ~controllable_hgrant2) );
// G( (decide=0) -> ( ((hgrant3=0)<->X(hgrant3=0)) ));
assign sys_safe_err33 = ~( ~(reg_controllable_ndecide) | (~reg_controllable_hgrant3 ^~ ~controllable_hgrant3) );
// G( (decide=0) -> ( ((hgrant4=0)<->X(hgrant4=0)) ));
assign sys_safe_err34 = ~( ~(reg_controllable_ndecide) | (~reg_controllable_hgrant4 ^~ ~controllable_hgrant4) );
// G((decide=0)->(locked=0 <-> X(locked=0)));
assign sys_safe_err35 = ~( ~(reg_controllable_ndecide) | (~reg_controllable_locked ^~ ~controllable_locked) );
// G(((stateG10_1=1) * (((hgrant1=1)) * (hbusreq1=0)))->FALSE);
assign sys_safe_err36 = ~( ~(reg_stateG10_1 & (controllable_hgrant1 & ~i_hbusreq1)) | 0 );
// G(((stateG10_2=1) * (((hgrant2=1)) * (hbusreq2=0)))->FALSE);
assign sys_safe_err37 = ~( ~(reg_stateG10_2 & (controllable_hgrant2 & ~i_hbusreq2)) | 0 );
// G(((stateG10_3=1) * (((hgrant3=1)) * (hbusreq3=0)))->FALSE);
assign sys_safe_err38 = ~( ~(reg_stateG10_3 & (controllable_hgrant3 & ~i_hbusreq3)) | 0 );
// G(((stateG10_4=1) * (((hgrant4=1)) * (hbusreq4=0)))->FALSE);
assign sys_safe_err39 = ~( ~(reg_stateG10_4 & (controllable_hgrant4 & ~i_hbusreq4)) | 0 );
// default master
// G((decide=1 * hbusreq0=0 * hbusreq1=0 * hbusreq2=0 * hbusreq3=0 * hbusreq4=0) -> X(hgrant0=1));
assign sys_safe_err40 = ~( ~(~reg_controllable_ndecide & (~reg_i_hbusreq0 & ~reg_i_hbusreq1 & ~reg_i_hbusreq2 & ~reg_i_hbusreq3 & ~reg_i_hbusreq4)) | (~controllable_nhgrant0) );
// collecting together the safety error bits:
assign sys_safe_err = sys_safe_err0 |
sys_safe_err1 |
sys_safe_err2 |
sys_safe_err3 |
sys_safe_err4 |
sys_safe_err5 |
sys_safe_err6 |
sys_safe_err7 |
sys_safe_err8 |
sys_safe_err9 |
sys_safe_err10 |
sys_safe_err11 |
sys_safe_err12 |
sys_safe_err13 |
sys_safe_err14 |
sys_safe_err15 |
sys_safe_err16 |
sys_safe_err17 |
sys_safe_err18 |
sys_safe_err19 |
sys_safe_err20 |
sys_safe_err21 |
sys_safe_err22 |
sys_safe_err23 |
sys_safe_err24 |
sys_safe_err25 |
sys_safe_err26 |
sys_safe_err27 |
sys_safe_err28 |
sys_safe_err29 |
sys_safe_err30 |
sys_safe_err31 |
sys_safe_err32 |
sys_safe_err33 |
sys_safe_err34 |
sys_safe_err35 |
sys_safe_err36 |
sys_safe_err37 |
sys_safe_err38 |
sys_safe_err39 |
sys_safe_err40;
// =============================================================
// ENV_FAIRNESS:
// =============================================================
// Assumption 1:
// G(F(stateA1=0));
assign env_fair0 = ~reg_stateA1;
// Assumption 2:
// G(F(hready=1));
assign env_fair1 = i_hready;
// =============================================================
// SYS_FAIRNESS:
// =============================================================
// Guarantee 2:
// G(F(stateG2=0));
assign sys_fair0 = ~reg_stateG2;
// Guarantee 3:
// G(F((stateG3_0=0) * (stateG3_1=0) * (stateG3_2=0)));
assign sys_fair1 = (~reg_stateG3_0 & ~reg_stateG3_1 & ~reg_stateG3_2);
// G(F(((hmaster0=0) * (hmaster1=0) * (hmaster2=0)) | hbusreq0=0));
assign sys_fair2 = ( ~(controllable_hmaster0) & ~(controllable_hmaster1) & ~(controllable_hmaster2) ) | ~i_hbusreq0;
// G(F(((hmaster0=1) * (hmaster1=0) * (hmaster2=0)) | hbusreq1=0));
assign sys_fair3 = ( controllable_hmaster0 & ~(controllable_hmaster1) & ~(controllable_hmaster2) ) | ~i_hbusreq1;
// G(F(((hmaster0=0) * (hmaster1=1) * (hmaster2=0)) | hbusreq2=0));
assign sys_fair4 = ( ~(controllable_hmaster0) & controllable_hmaster1 & ~(controllable_hmaster2) ) | ~i_hbusreq2;
// G(F(((hmaster0=1) * (hmaster1=1) * (hmaster2=0)) | hbusreq3=0));
assign sys_fair5 = ( controllable_hmaster0 & controllable_hmaster1 & ~(controllable_hmaster2) ) | ~i_hbusreq3;
// G(F(((hmaster0=0) * (hmaster1=0) * (hmaster2=1)) | hbusreq4=0));
assign sys_fair6 = ( ~(controllable_hmaster0) & ~(controllable_hmaster1) & controllable_hmaster2 ) | ~i_hbusreq4;
assign fair_err = (fair_cnt >= 3'b100);
// computing the error output bit:
assign o_err = ~env_safe_err & ~env_safe_err_happened & (sys_safe_err | fair_err);
initial
begin
reg_i_hready = 0;
reg_i_hbusreq0 = 0;
reg_i_hlock0 = 0;
reg_i_hbusreq1 = 0;
reg_i_hlock1 = 0;
reg_i_hbusreq2 = 0;
reg_i_hlock2 = 0;
reg_i_hbusreq3 = 0;
reg_i_hlock3 = 0;
reg_i_hbusreq4 = 0;
reg_i_hlock4 = 0;
reg_controllable_hmaster0 = 0;
reg_controllable_hmaster1 = 0;
reg_controllable_hmaster2 = 0;
reg_controllable_hmastlock = 0;
reg_controllable_nstart = 0;
reg_controllable_ndecide = 0;
reg_controllable_locked = 0;
reg_controllable_nhgrant0 = 0;
reg_controllable_hgrant1 = 0;
reg_controllable_hgrant2 = 0;
reg_controllable_hgrant3 = 0;
reg_controllable_hgrant4 = 0;
reg_controllable_busreq = 0;
reg_stateA1 = 0;
reg_stateG2 = 0;
reg_stateG3_0 = 0;
reg_stateG3_1 = 0;
reg_stateG3_2 = 0;
reg_stateG10_1 = 0;
reg_stateG10_2 = 0;
reg_stateG10_3 = 0;
reg_stateG10_4 = 0;
env_safe_err_happened = 0;
next_env_fair = 0;
fair_cnt = 0;
next_sys_fair = 0;
end
always @(posedge i_clk)
begin
// We remember if an environment error occurred:
env_safe_err_happened = env_safe_err_happened | env_safe_err;
// Updating the fairness counters:
if((next_sys_fair == 0) & sys_fair0)
begin
next_sys_fair = 1;
next_env_fair = 0;
fair_cnt = 0;
end
else if((next_sys_fair == 1) & sys_fair1)
begin
next_sys_fair = 2;
next_env_fair = 0;
fair_cnt = 0;
end
else if((next_sys_fair == 2) & sys_fair2)
begin
next_sys_fair = 3;
next_env_fair = 0;
fair_cnt = 0;
end
else if((next_sys_fair == 3) & sys_fair3)
begin
next_sys_fair = 4;
next_env_fair = 0;
fair_cnt = 0;
end
else if((next_sys_fair == 4) & sys_fair4)
begin
next_sys_fair = 5;
next_env_fair = 0;
fair_cnt = 0;
end
else if((next_sys_fair == 5) & sys_fair5)
begin
next_sys_fair = 6;
next_env_fair = 0;
fair_cnt = 0;
end
else if((next_sys_fair == 6) & sys_fair6)
begin
next_sys_fair = 0;
next_env_fair = 0;
fair_cnt = 0;
end
else if(~next_env_fair & env_fair0)