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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
|
(*Generated by Sail from aarch64_duopod.*)
open import Pervasives_extra
open import Sail_instr_kinds
open import Sail_values
open import Sail_operators_bitlists
open import Prompt_monad
open import Prompt
open import State
open import Aarch64_duopod_types
open import Aarch64_extras_embed_sequential
val vcons : forall 'a. 'a -> list 'a -> list 'a
val builtin_and_vec : forall 'n. bits 'n -> bits 'n -> bits 'n
val builtin_or_vec : forall 'n. bits 'n -> bits 'n -> bits 'n
val __raw_SetSlice_int : forall 'w. integer -> ii -> ii -> bits 'w -> ii
val __GetSlice_int : integer -> ii -> ii -> list bitU
let __GetSlice_int n m o = (get_slice_int n m o : list bitU)
val __raw_SetSlice_bits : forall 'n 'w. integer -> integer -> bits 'n -> ii -> bits 'w -> bits 'n
val __raw_GetSlice_bits : forall 'n 'w. integer -> integer -> bits 'n -> ii -> bits 'w
val cast_unit_vec : bitU -> list bitU
let cast_unit_vec b = match b with | B0 -> [B0] | B1 -> [B1] end
val DecStr : ii -> string
val HexStr : ii -> string
val __TraceMemoryWrite : forall 'int8_times_n 'm. integer -> bits 'm -> bits 'int8_times_n -> unit
val __InitRAM : integer -> ii -> list bitU -> list bitU -> unit
let __InitRAM g__289 g__290 g__291 g__292 = ()
val __TraceMemoryRead : forall 'int8_times_n 'm. integer -> bits 'm -> bits 'int8_times_n -> unit
val ex_nat : ii -> integer
let ex_nat n = n
val ex_int : ii -> integer
let ex_int n = n
val ex_range : integer -> integer
val coerce_int_nat : ii -> M ii
let coerce_int_nat x =
assert_exp true "Cannot coerce int to nat" >>
return x
val break : unit -> unit
let break () = ()
val undefined_exception : unit -> exception
let undefined_exception () =
internal_pick
[Error_Undefined;Error_See (undefined_string ());Error_Implementation_Defined (undefined_string
());Error_ReservedEncoding]
val boolean_of_num : integer -> boolean
let boolean_of_num arg_ =
let l__280 = arg_ in
if (eq l__280 (0:ii))
then FALSE
else TRUE
val num_of_boolean : boolean -> integer
let num_of_boolean arg_ = match arg_ with | FALSE -> (0:ii) | TRUE -> (1:ii) end
val undefined_boolean : unit -> boolean
let undefined_boolean () = internal_pick [FALSE;TRUE]
val signal_of_num : integer -> signal
let signal_of_num arg_ =
let l__279 = arg_ in
if (eq l__279 (0:ii))
then LOW
else HIGH
val num_of_signal : signal -> integer
let num_of_signal arg_ = match arg_ with | LOW -> (0:ii) | HIGH -> (1:ii) end
val undefined_signal : unit -> signal
let undefined_signal () = internal_pick [LOW;HIGH]
val __RetCode_of_num : integer -> __RetCode
let __RetCode_of_num arg_ =
let l__271 = arg_ in
if (eq l__271 (0:ii))
then __RC_OK
else
if (eq l__271 (1:ii))
then __RC_UNDEFINED
else
if (eq l__271 (2:ii))
then __RC_UNPREDICTABLE
else
if (eq l__271 (3:ii))
then __RC_SEE
else
if (eq l__271 (4:ii))
then __RC_IMPLEMENTATION_DEFINED
else
if (eq l__271 (5:ii))
then __RC_SUBARCHITECTURE_DEFINED
else
if (eq l__271 (6:ii))
then __RC_EXCEPTION_TAKEN
else if (eq l__271 (7:ii)) then __RC_ASSERT_FAILED else __RC_UNMATCHED_CASE
val num_of___RetCode : __RetCode -> integer
let num_of___RetCode arg_ =
match arg_ with
| __RC_OK -> (0:ii)
| __RC_UNDEFINED -> (1:ii)
| __RC_UNPREDICTABLE -> (2:ii)
| __RC_SEE -> (3:ii)
| __RC_IMPLEMENTATION_DEFINED -> (4:ii)
| __RC_SUBARCHITECTURE_DEFINED -> (5:ii)
| __RC_EXCEPTION_TAKEN -> (6:ii)
| __RC_ASSERT_FAILED -> (7:ii)
| __RC_UNMATCHED_CASE -> (8:ii)
end
val undefined___RetCode : unit -> __RetCode
let undefined___RetCode () =
internal_pick
[__RC_OK;__RC_UNDEFINED;__RC_UNPREDICTABLE;__RC_SEE;__RC_IMPLEMENTATION_DEFINED;__RC_SUBARCHITECTURE_DEFINED;__RC_EXCEPTION_TAKEN;__RC_ASSERT_FAILED;__RC_UNMATCHED_CASE]
val FPConvOp_of_num : integer -> FPConvOp
let FPConvOp_of_num arg_ =
let l__267 = arg_ in
if (eq l__267 (0:ii))
then FPConvOp_CVT_FtoI
else
if (eq l__267 (1:ii))
then FPConvOp_CVT_ItoF
else
if (eq l__267 (2:ii))
then FPConvOp_MOV_FtoI
else if (eq l__267 (3:ii)) then FPConvOp_MOV_ItoF else FPConvOp_CVT_FtoI_JS
val num_of_FPConvOp : FPConvOp -> integer
let num_of_FPConvOp arg_ =
match arg_ with
| FPConvOp_CVT_FtoI -> (0:ii)
| FPConvOp_CVT_ItoF -> (1:ii)
| FPConvOp_MOV_FtoI -> (2:ii)
| FPConvOp_MOV_ItoF -> (3:ii)
| FPConvOp_CVT_FtoI_JS -> (4:ii)
end
val undefined_FPConvOp : unit -> FPConvOp
let undefined_FPConvOp () =
internal_pick
[FPConvOp_CVT_FtoI;FPConvOp_CVT_ItoF;FPConvOp_MOV_FtoI;FPConvOp_MOV_ItoF;FPConvOp_CVT_FtoI_JS]
val Exception_of_num : integer -> Exception
let Exception_of_num arg_ =
let l__239 = arg_ in
if (eq l__239 (0:ii))
then Exception_Uncategorized
else
if (eq l__239 (1:ii))
then Exception_WFxTrap
else
if (eq l__239 (2:ii))
then Exception_CP15RTTrap
else
if (eq l__239 (3:ii))
then Exception_CP15RRTTrap
else
if (eq l__239 (4:ii))
then Exception_CP14RTTrap
else
if (eq l__239 (5:ii))
then Exception_CP14DTTrap
else
if (eq l__239 (6:ii))
then Exception_AdvSIMDFPAccessTrap
else
if (eq l__239 (7:ii))
then Exception_FPIDTrap
else
if (eq l__239 (8:ii))
then Exception_PACTrap
else
if (eq l__239 (9:ii))
then Exception_CP14RRTTrap
else
if (eq l__239 (10:ii))
then Exception_IllegalState
else
if (eq l__239 (11:ii))
then Exception_SupervisorCall
else
if (eq l__239 (12:ii))
then Exception_HypervisorCall
else
if (eq l__239 (13:ii))
then Exception_MonitorCall
else
if (eq l__239 (14:ii))
then Exception_SystemRegisterTrap
else
if (eq l__239 (15:ii))
then Exception_ERetTrap
else
if (eq l__239 (16:ii))
then Exception_InstructionAbort
else
if (eq l__239 (17:ii))
then Exception_PCAlignment
else
if (eq l__239 (18:ii))
then Exception_DataAbort
else
if (eq l__239 (19:ii))
then Exception_SPAlignment
else
if (eq l__239 (20:ii))
then Exception_FPTrappedException
else
if (eq l__239 (21:ii))
then Exception_SError
else
if (eq l__239 (22:ii))
then Exception_Breakpoint
else
if (eq l__239 (23:ii))
then Exception_SoftwareStep
else
if (eq l__239 (24:ii))
then Exception_Watchpoint
else
if (eq l__239 (25:ii))
then Exception_SoftwareBreakpoint
else
if (eq l__239 (26:ii))
then Exception_VectorCatch
else if (eq l__239 (27:ii)) then Exception_IRQ else Exception_FIQ
val num_of_Exception : Exception -> integer
let num_of_Exception arg_ =
match arg_ with
| Exception_Uncategorized -> (0:ii)
| Exception_WFxTrap -> (1:ii)
| Exception_CP15RTTrap -> (2:ii)
| Exception_CP15RRTTrap -> (3:ii)
| Exception_CP14RTTrap -> (4:ii)
| Exception_CP14DTTrap -> (5:ii)
| Exception_AdvSIMDFPAccessTrap -> (6:ii)
| Exception_FPIDTrap -> (7:ii)
| Exception_PACTrap -> (8:ii)
| Exception_CP14RRTTrap -> (9:ii)
| Exception_IllegalState -> (10:ii)
| Exception_SupervisorCall -> (11:ii)
| Exception_HypervisorCall -> (12:ii)
| Exception_MonitorCall -> (13:ii)
| Exception_SystemRegisterTrap -> (14:ii)
| Exception_ERetTrap -> (15:ii)
| Exception_InstructionAbort -> (16:ii)
| Exception_PCAlignment -> (17:ii)
| Exception_DataAbort -> (18:ii)
| Exception_SPAlignment -> (19:ii)
| Exception_FPTrappedException -> (20:ii)
| Exception_SError -> (21:ii)
| Exception_Breakpoint -> (22:ii)
| Exception_SoftwareStep -> (23:ii)
| Exception_Watchpoint -> (24:ii)
| Exception_SoftwareBreakpoint -> (25:ii)
| Exception_VectorCatch -> (26:ii)
| Exception_IRQ -> (27:ii)
| Exception_FIQ -> (28:ii)
end
val undefined_Exception : unit -> Exception
let undefined_Exception () =
internal_pick
[Exception_Uncategorized;Exception_WFxTrap;Exception_CP15RTTrap;Exception_CP15RRTTrap;Exception_CP14RTTrap;Exception_CP14DTTrap;Exception_AdvSIMDFPAccessTrap;Exception_FPIDTrap;Exception_PACTrap;Exception_CP14RRTTrap;Exception_IllegalState;Exception_SupervisorCall;Exception_HypervisorCall;Exception_MonitorCall;Exception_SystemRegisterTrap;Exception_ERetTrap;Exception_InstructionAbort;Exception_PCAlignment;Exception_DataAbort;Exception_SPAlignment;Exception_FPTrappedException;Exception_SError;Exception_Breakpoint;Exception_SoftwareStep;Exception_Watchpoint;Exception_SoftwareBreakpoint;Exception_VectorCatch;Exception_IRQ;Exception_FIQ]
val ArchVersion_of_num : integer -> ArchVersion
let ArchVersion_of_num arg_ =
let l__236 = arg_ in
if (eq l__236 (0:ii))
then ARMv8p0
else if (eq l__236 (1:ii)) then ARMv8p1 else if (eq l__236 (2:ii)) then ARMv8p2 else ARMv8p3
val num_of_ArchVersion : ArchVersion -> integer
let num_of_ArchVersion arg_ =
match arg_ with
| ARMv8p0 -> (0:ii)
| ARMv8p1 -> (1:ii)
| ARMv8p2 -> (2:ii)
| ARMv8p3 -> (3:ii)
end
val undefined_ArchVersion : unit -> ArchVersion
let undefined_ArchVersion () = internal_pick [ARMv8p0;ARMv8p1;ARMv8p2;ARMv8p3]
val Unpredictable_of_num : integer -> Unpredictable
let Unpredictable_of_num arg_ =
let l__192 = arg_ in
if (eq l__192 (0:ii))
then Unpredictable_WBOVERLAPLD
else
if (eq l__192 (1:ii))
then Unpredictable_WBOVERLAPST
else
if (eq l__192 (2:ii))
then Unpredictable_LDPOVERLAP
else
if (eq l__192 (3:ii))
then Unpredictable_BASEOVERLAP
else
if (eq l__192 (4:ii))
then Unpredictable_DATAOVERLAP
else
if (eq l__192 (5:ii))
then Unpredictable_DEVPAGE2
else
if (eq l__192 (6:ii))
then Unpredictable_INSTRDEVICE
else
if (eq l__192 (7:ii))
then Unpredictable_RESCPACR
else
if (eq l__192 (8:ii))
then Unpredictable_RESMAIR
else
if (eq l__192 (9:ii))
then Unpredictable_RESTEXCB
else
if (eq l__192 (10:ii))
then Unpredictable_RESPRRR
else
if (eq l__192 (11:ii))
then Unpredictable_RESDACR
else
if (eq l__192 (12:ii))
then Unpredictable_RESVTCRS
else
if (eq l__192 (13:ii))
then Unpredictable_RESTnSZ
else
if (eq l__192 (14:ii))
then Unpredictable_OORTnSZ
else
if (eq l__192 (15:ii))
then Unpredictable_LARGEIPA
else
if (eq l__192 (16:ii))
then Unpredictable_ESRCONDPASS
else
if (eq l__192 (17:ii))
then Unpredictable_ILZEROIT
else
if (eq l__192 (18:ii))
then Unpredictable_ILZEROT
else
if (eq l__192 (19:ii))
then Unpredictable_BPVECTORCATCHPRI
else
if (eq l__192 (20:ii))
then Unpredictable_VCMATCHHALF
else
if (eq l__192 (21:ii))
then Unpredictable_VCMATCHDAPA
else
if (eq l__192 (22:ii))
then Unpredictable_WPMASKANDBAS
else
if (eq l__192 (23:ii))
then Unpredictable_WPBASCONTIGUOUS
else
if (eq l__192 (24:ii))
then Unpredictable_RESWPMASK
else
if (eq l__192 (25:ii))
then Unpredictable_WPMASKEDBITS
else
if (eq l__192 (26:ii))
then Unpredictable_RESBPWPCTRL
else
if (eq l__192 (27:ii))
then Unpredictable_BPNOTIMPL
else
if (eq l__192 (28:ii))
then Unpredictable_RESBPTYPE
else
if (eq l__192 (29:ii))
then Unpredictable_BPNOTCTXCMP
else
if (eq l__192 (30:ii))
then Unpredictable_BPMATCHHALF
else
if (eq l__192 (31:ii))
then Unpredictable_BPMISMATCHHALF
else
if (eq l__192 (32:ii))
then Unpredictable_RESTARTALIGNPC
else
if (eq l__192 (33:ii))
then Unpredictable_RESTARTZEROUPPERPC
else
if (eq l__192 (34:ii))
then Unpredictable_ZEROUPPER
else
if (eq l__192 (35:ii))
then Unpredictable_ERETZEROUPPERPC
else
if (eq l__192 (36:ii))
then Unpredictable_A32FORCEALIGNPC
else
if (eq l__192 (37:ii))
then Unpredictable_SMD
else
if (eq l__192 (38:ii))
then Unpredictable_AFUPDATE
else
if (eq l__192 (39:ii))
then Unpredictable_IESBinDebug
else
if (eq l__192 (40:ii))
then Unpredictable_ZEROPMSEVFR
else
if (eq l__192 (41:ii))
then Unpredictable_NOOPTYPES
else
if (eq l__192 (42:ii))
then Unpredictable_ZEROMINLATENCY
else if (eq l__192 (43:ii)) then Unpredictable_CLEARERRITEZERO else Unpredictable_TBD
val num_of_Unpredictable : Unpredictable -> integer
let num_of_Unpredictable arg_ =
match arg_ with
| Unpredictable_WBOVERLAPLD -> (0:ii)
| Unpredictable_WBOVERLAPST -> (1:ii)
| Unpredictable_LDPOVERLAP -> (2:ii)
| Unpredictable_BASEOVERLAP -> (3:ii)
| Unpredictable_DATAOVERLAP -> (4:ii)
| Unpredictable_DEVPAGE2 -> (5:ii)
| Unpredictable_INSTRDEVICE -> (6:ii)
| Unpredictable_RESCPACR -> (7:ii)
| Unpredictable_RESMAIR -> (8:ii)
| Unpredictable_RESTEXCB -> (9:ii)
| Unpredictable_RESPRRR -> (10:ii)
| Unpredictable_RESDACR -> (11:ii)
| Unpredictable_RESVTCRS -> (12:ii)
| Unpredictable_RESTnSZ -> (13:ii)
| Unpredictable_OORTnSZ -> (14:ii)
| Unpredictable_LARGEIPA -> (15:ii)
| Unpredictable_ESRCONDPASS -> (16:ii)
| Unpredictable_ILZEROIT -> (17:ii)
| Unpredictable_ILZEROT -> (18:ii)
| Unpredictable_BPVECTORCATCHPRI -> (19:ii)
| Unpredictable_VCMATCHHALF -> (20:ii)
| Unpredictable_VCMATCHDAPA -> (21:ii)
| Unpredictable_WPMASKANDBAS -> (22:ii)
| Unpredictable_WPBASCONTIGUOUS -> (23:ii)
| Unpredictable_RESWPMASK -> (24:ii)
| Unpredictable_WPMASKEDBITS -> (25:ii)
| Unpredictable_RESBPWPCTRL -> (26:ii)
| Unpredictable_BPNOTIMPL -> (27:ii)
| Unpredictable_RESBPTYPE -> (28:ii)
| Unpredictable_BPNOTCTXCMP -> (29:ii)
| Unpredictable_BPMATCHHALF -> (30:ii)
| Unpredictable_BPMISMATCHHALF -> (31:ii)
| Unpredictable_RESTARTALIGNPC -> (32:ii)
| Unpredictable_RESTARTZEROUPPERPC -> (33:ii)
| Unpredictable_ZEROUPPER -> (34:ii)
| Unpredictable_ERETZEROUPPERPC -> (35:ii)
| Unpredictable_A32FORCEALIGNPC -> (36:ii)
| Unpredictable_SMD -> (37:ii)
| Unpredictable_AFUPDATE -> (38:ii)
| Unpredictable_IESBinDebug -> (39:ii)
| Unpredictable_ZEROPMSEVFR -> (40:ii)
| Unpredictable_NOOPTYPES -> (41:ii)
| Unpredictable_ZEROMINLATENCY -> (42:ii)
| Unpredictable_CLEARERRITEZERO -> (43:ii)
| Unpredictable_TBD -> (44:ii)
end
val undefined_Unpredictable : unit -> Unpredictable
let undefined_Unpredictable () =
internal_pick
[Unpredictable_WBOVERLAPLD;Unpredictable_WBOVERLAPST;Unpredictable_LDPOVERLAP;Unpredictable_BASEOVERLAP;Unpredictable_DATAOVERLAP;Unpredictable_DEVPAGE2;Unpredictable_INSTRDEVICE;Unpredictable_RESCPACR;Unpredictable_RESMAIR;Unpredictable_RESTEXCB;Unpredictable_RESPRRR;Unpredictable_RESDACR;Unpredictable_RESVTCRS;Unpredictable_RESTnSZ;Unpredictable_OORTnSZ;Unpredictable_LARGEIPA;Unpredictable_ESRCONDPASS;Unpredictable_ILZEROIT;Unpredictable_ILZEROT;Unpredictable_BPVECTORCATCHPRI;Unpredictable_VCMATCHHALF;Unpredictable_VCMATCHDAPA;Unpredictable_WPMASKANDBAS;Unpredictable_WPBASCONTIGUOUS;Unpredictable_RESWPMASK;Unpredictable_WPMASKEDBITS;Unpredictable_RESBPWPCTRL;Unpredictable_BPNOTIMPL;Unpredictable_RESBPTYPE;Unpredictable_BPNOTCTXCMP;Unpredictable_BPMATCHHALF;Unpredictable_BPMISMATCHHALF;Unpredictable_RESTARTALIGNPC;Unpredictable_RESTARTZEROUPPERPC;Unpredictable_ZEROUPPER;Unpredictable_ERETZEROUPPERPC;Unpredictable_A32FORCEALIGNPC;Unpredictable_SMD;Unpredictable_AFUPDATE;Unpredictable_IESBinDebug;Unpredictable_ZEROPMSEVFR;Unpredictable_NOOPTYPES;Unpredictable_ZEROMINLATENCY;Unpredictable_CLEARERRITEZERO;Unpredictable_TBD]
val Constraint_of_num : integer -> Constraint
let Constraint_of_num arg_ =
let l__178 = arg_ in
if (eq l__178 (0:ii))
then Constraint_NONE
else
if (eq l__178 (1:ii))
then Constraint_UNKNOWN
else
if (eq l__178 (2:ii))
then Constraint_UNDEF
else
if (eq l__178 (3:ii))
then Constraint_UNDEFEL0
else
if (eq l__178 (4:ii))
then Constraint_NOP
else
if (eq l__178 (5:ii))
then Constraint_TRUE
else
if (eq l__178 (6:ii))
then Constraint_FALSE
else
if (eq l__178 (7:ii))
then Constraint_DISABLED
else
if (eq l__178 (8:ii))
then Constraint_UNCOND
else
if (eq l__178 (9:ii))
then Constraint_COND
else
if (eq l__178 (10:ii))
then Constraint_ADDITIONAL_DECODE
else
if (eq l__178 (11:ii))
then Constraint_WBSUPPRESS
else
if (eq l__178 (12:ii))
then Constraint_FAULT
else if (eq l__178 (13:ii)) then Constraint_FORCE else Constraint_FORCENOSLCHECK
val num_of_Constraint : Constraint -> integer
let num_of_Constraint arg_ =
match arg_ with
| Constraint_NONE -> (0:ii)
| Constraint_UNKNOWN -> (1:ii)
| Constraint_UNDEF -> (2:ii)
| Constraint_UNDEFEL0 -> (3:ii)
| Constraint_NOP -> (4:ii)
| Constraint_TRUE -> (5:ii)
| Constraint_FALSE -> (6:ii)
| Constraint_DISABLED -> (7:ii)
| Constraint_UNCOND -> (8:ii)
| Constraint_COND -> (9:ii)
| Constraint_ADDITIONAL_DECODE -> (10:ii)
| Constraint_WBSUPPRESS -> (11:ii)
| Constraint_FAULT -> (12:ii)
| Constraint_FORCE -> (13:ii)
| Constraint_FORCENOSLCHECK -> (14:ii)
end
val undefined_Constraint : unit -> Constraint
let undefined_Constraint () =
internal_pick
[Constraint_NONE;Constraint_UNKNOWN;Constraint_UNDEF;Constraint_UNDEFEL0;Constraint_NOP;Constraint_TRUE;Constraint_FALSE;Constraint_DISABLED;Constraint_UNCOND;Constraint_COND;Constraint_ADDITIONAL_DECODE;Constraint_WBSUPPRESS;Constraint_FAULT;Constraint_FORCE;Constraint_FORCENOSLCHECK]
val InstrSet_of_num : integer -> InstrSet
let InstrSet_of_num arg_ =
let l__176 = arg_ in
if (eq l__176 (0:ii))
then InstrSet_A64
else if (eq l__176 (1:ii)) then InstrSet_A32 else InstrSet_T32
val num_of_InstrSet : InstrSet -> integer
let num_of_InstrSet arg_ =
match arg_ with | InstrSet_A64 -> (0:ii) | InstrSet_A32 -> (1:ii) | InstrSet_T32 -> (2:ii) end
val undefined_InstrSet : unit -> InstrSet
let undefined_InstrSet () = internal_pick [InstrSet_A64;InstrSet_A32;InstrSet_T32]
val undefined_ProcState : unit -> ProcState
let undefined_ProcState () =
<| ProcState_N = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_Z = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_C = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_V = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_D = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_A = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_I = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_F = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_PAN = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_UAO = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_SS = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_IL = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_EL = (undefined_vector (2:ii) (undefined_bit ()) : list bitU);
ProcState_nRW = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_SP = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_Q = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_GE = (undefined_vector (4:ii) (undefined_bit ()) : list bitU);
ProcState_IT = (undefined_vector (8:ii) (undefined_bit ()) : list bitU);
ProcState_J = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_T = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_E = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
ProcState_M = (undefined_vector (5:ii) (undefined_bit ()) : list bitU) |>
val BranchType_of_num : integer -> BranchType
let BranchType_of_num arg_ =
let l__170 = arg_ in
if (eq l__170 (0:ii))
then BranchType_CALL
else
if (eq l__170 (1:ii))
then BranchType_ERET
else
if (eq l__170 (2:ii))
then BranchType_DBGEXIT
else
if (eq l__170 (3:ii))
then BranchType_RET
else
if (eq l__170 (4:ii))
then BranchType_JMP
else if (eq l__170 (5:ii)) then BranchType_EXCEPTION else BranchType_UNKNOWN
val num_of_BranchType : BranchType -> integer
let num_of_BranchType arg_ =
match arg_ with
| BranchType_CALL -> (0:ii)
| BranchType_ERET -> (1:ii)
| BranchType_DBGEXIT -> (2:ii)
| BranchType_RET -> (3:ii)
| BranchType_JMP -> (4:ii)
| BranchType_EXCEPTION -> (5:ii)
| BranchType_UNKNOWN -> (6:ii)
end
val undefined_BranchType : unit -> BranchType
let undefined_BranchType () =
internal_pick
[BranchType_CALL;BranchType_ERET;BranchType_DBGEXIT;BranchType_RET;BranchType_JMP;BranchType_EXCEPTION;BranchType_UNKNOWN]
val undefined_ExceptionRecord : unit -> ExceptionRecord
let undefined_ExceptionRecord () =
<| ExceptionRecord_typ = (undefined_Exception ());
ExceptionRecord_syndrome = (undefined_vector (25:ii) (undefined_bit ()) : list bitU);
ExceptionRecord_vaddress = (undefined_vector (64:ii) (undefined_bit ()) : list bitU);
ExceptionRecord_ipavalid = (undefined_bool ());
ExceptionRecord_ipaddress = (undefined_vector (52:ii) (undefined_bit ()) : list bitU) |>
val Fault_of_num : integer -> Fault
let Fault_of_num arg_ =
let l__152 = arg_ in
if (eq l__152 (0:ii))
then Fault_None
else
if (eq l__152 (1:ii))
then Fault_AccessFlag
else
if (eq l__152 (2:ii))
then Fault_Alignment
else
if (eq l__152 (3:ii))
then Fault_Background
else
if (eq l__152 (4:ii))
then Fault_Domain
else
if (eq l__152 (5:ii))
then Fault_Permission
else
if (eq l__152 (6:ii))
then Fault_Translation
else
if (eq l__152 (7:ii))
then Fault_AddressSize
else
if (eq l__152 (8:ii))
then Fault_SyncExternal
else
if (eq l__152 (9:ii))
then Fault_SyncExternalOnWalk
else
if (eq l__152 (10:ii))
then Fault_SyncParity
else
if (eq l__152 (11:ii))
then Fault_SyncParityOnWalk
else
if (eq l__152 (12:ii))
then Fault_AsyncParity
else
if (eq l__152 (13:ii))
then Fault_AsyncExternal
else
if (eq l__152 (14:ii))
then Fault_Debug
else
if (eq l__152 (15:ii))
then Fault_TLBConflict
else
if (eq l__152 (16:ii))
then Fault_Lockdown
else if (eq l__152 (17:ii)) then Fault_Exclusive else Fault_ICacheMaint
val num_of_Fault : Fault -> integer
let num_of_Fault arg_ =
match arg_ with
| Fault_None -> (0:ii)
| Fault_AccessFlag -> (1:ii)
| Fault_Alignment -> (2:ii)
| Fault_Background -> (3:ii)
| Fault_Domain -> (4:ii)
| Fault_Permission -> (5:ii)
| Fault_Translation -> (6:ii)
| Fault_AddressSize -> (7:ii)
| Fault_SyncExternal -> (8:ii)
| Fault_SyncExternalOnWalk -> (9:ii)
| Fault_SyncParity -> (10:ii)
| Fault_SyncParityOnWalk -> (11:ii)
| Fault_AsyncParity -> (12:ii)
| Fault_AsyncExternal -> (13:ii)
| Fault_Debug -> (14:ii)
| Fault_TLBConflict -> (15:ii)
| Fault_Lockdown -> (16:ii)
| Fault_Exclusive -> (17:ii)
| Fault_ICacheMaint -> (18:ii)
end
val undefined_Fault : unit -> Fault
let undefined_Fault () =
internal_pick
[Fault_None;Fault_AccessFlag;Fault_Alignment;Fault_Background;Fault_Domain;Fault_Permission;Fault_Translation;Fault_AddressSize;Fault_SyncExternal;Fault_SyncExternalOnWalk;Fault_SyncParity;Fault_SyncParityOnWalk;Fault_AsyncParity;Fault_AsyncExternal;Fault_Debug;Fault_TLBConflict;Fault_Lockdown;Fault_Exclusive;Fault_ICacheMaint]
val AccType_of_num : integer -> AccType
let AccType_of_num arg_ =
let l__137 = arg_ in
if (eq l__137 (0:ii))
then AccType_NORMAL
else
if (eq l__137 (1:ii))
then AccType_VEC
else
if (eq l__137 (2:ii))
then AccType_STREAM
else
if (eq l__137 (3:ii))
then AccType_VECSTREAM
else
if (eq l__137 (4:ii))
then AccType_ATOMIC
else
if (eq l__137 (5:ii))
then AccType_ATOMICRW
else
if (eq l__137 (6:ii))
then AccType_ORDERED
else
if (eq l__137 (7:ii))
then AccType_ORDEREDRW
else
if (eq l__137 (8:ii))
then AccType_LIMITEDORDERED
else
if (eq l__137 (9:ii))
then AccType_UNPRIV
else
if (eq l__137 (10:ii))
then AccType_IFETCH
else
if (eq l__137 (11:ii))
then AccType_PTW
else
if (eq l__137 (12:ii))
then AccType_DC
else
if (eq l__137 (13:ii))
then AccType_IC
else if (eq l__137 (14:ii)) then AccType_DCZVA else AccType_AT
val num_of_AccType : AccType -> integer
let num_of_AccType arg_ =
match arg_ with
| AccType_NORMAL -> (0:ii)
| AccType_VEC -> (1:ii)
| AccType_STREAM -> (2:ii)
| AccType_VECSTREAM -> (3:ii)
| AccType_ATOMIC -> (4:ii)
| AccType_ATOMICRW -> (5:ii)
| AccType_ORDERED -> (6:ii)
| AccType_ORDEREDRW -> (7:ii)
| AccType_LIMITEDORDERED -> (8:ii)
| AccType_UNPRIV -> (9:ii)
| AccType_IFETCH -> (10:ii)
| AccType_PTW -> (11:ii)
| AccType_DC -> (12:ii)
| AccType_IC -> (13:ii)
| AccType_DCZVA -> (14:ii)
| AccType_AT -> (15:ii)
end
val undefined_AccType : unit -> AccType
let undefined_AccType () =
internal_pick
[AccType_NORMAL;AccType_VEC;AccType_STREAM;AccType_VECSTREAM;AccType_ATOMIC;AccType_ATOMICRW;AccType_ORDERED;AccType_ORDEREDRW;AccType_LIMITEDORDERED;AccType_UNPRIV;AccType_IFETCH;AccType_PTW;AccType_DC;AccType_IC;AccType_DCZVA;AccType_AT]
val undefined_FaultRecord : unit -> FaultRecord
let undefined_FaultRecord () =
<| FaultRecord_typ = (undefined_Fault ());
FaultRecord_acctype = (undefined_AccType ());
FaultRecord_ipaddress = (undefined_vector (52:ii) (undefined_bit ()) : list bitU);
FaultRecord_s2fs1walk = (undefined_bool ());
FaultRecord_write = (undefined_bool ());
FaultRecord_level = (undefined_int ());
FaultRecord_extflag = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
FaultRecord_secondstage = (undefined_bool ());
FaultRecord_domain = (undefined_vector (4:ii) (undefined_bit ()) : list bitU);
FaultRecord_errortype = (undefined_vector (2:ii) (undefined_bit ()) : list bitU);
FaultRecord_debugmoe = (undefined_vector (4:ii) (undefined_bit ()) : list bitU) |>
val MBReqDomain_of_num : integer -> MBReqDomain
let MBReqDomain_of_num arg_ =
let l__134 = arg_ in
if (eq l__134 (0:ii))
then MBReqDomain_Nonshareable
else
if (eq l__134 (1:ii))
then MBReqDomain_InnerShareable
else if (eq l__134 (2:ii)) then MBReqDomain_OuterShareable else MBReqDomain_FullSystem
val num_of_MBReqDomain : MBReqDomain -> integer
let num_of_MBReqDomain arg_ =
match arg_ with
| MBReqDomain_Nonshareable -> (0:ii)
| MBReqDomain_InnerShareable -> (1:ii)
| MBReqDomain_OuterShareable -> (2:ii)
| MBReqDomain_FullSystem -> (3:ii)
end
val undefined_MBReqDomain : unit -> MBReqDomain
let undefined_MBReqDomain () =
internal_pick
[MBReqDomain_Nonshareable;MBReqDomain_InnerShareable;MBReqDomain_OuterShareable;MBReqDomain_FullSystem]
val MBReqTypes_of_num : integer -> MBReqTypes
let MBReqTypes_of_num arg_ =
let l__132 = arg_ in
if (eq l__132 (0:ii))
then MBReqTypes_Reads
else if (eq l__132 (1:ii)) then MBReqTypes_Writes else MBReqTypes_All
val num_of_MBReqTypes : MBReqTypes -> integer
let num_of_MBReqTypes arg_ =
match arg_ with
| MBReqTypes_Reads -> (0:ii)
| MBReqTypes_Writes -> (1:ii)
| MBReqTypes_All -> (2:ii)
end
val undefined_MBReqTypes : unit -> MBReqTypes
let undefined_MBReqTypes () = internal_pick [MBReqTypes_Reads;MBReqTypes_Writes;MBReqTypes_All]
val MemType_of_num : integer -> MemType
let MemType_of_num arg_ =
let l__131 = arg_ in
if (eq l__131 (0:ii))
then MemType_Normal
else MemType_Device
val num_of_MemType : MemType -> integer
let num_of_MemType arg_ = match arg_ with | MemType_Normal -> (0:ii) | MemType_Device -> (1:ii) end
val undefined_MemType : unit -> MemType
let undefined_MemType () = internal_pick [MemType_Normal;MemType_Device]
val DeviceType_of_num : integer -> DeviceType
let DeviceType_of_num arg_ =
let l__128 = arg_ in
if (eq l__128 (0:ii))
then DeviceType_GRE
else
if (eq l__128 (1:ii))
then DeviceType_nGRE
else if (eq l__128 (2:ii)) then DeviceType_nGnRE else DeviceType_nGnRnE
val num_of_DeviceType : DeviceType -> integer
let num_of_DeviceType arg_ =
match arg_ with
| DeviceType_GRE -> (0:ii)
| DeviceType_nGRE -> (1:ii)
| DeviceType_nGnRE -> (2:ii)
| DeviceType_nGnRnE -> (3:ii)
end
val undefined_DeviceType : unit -> DeviceType
let undefined_DeviceType () =
internal_pick [DeviceType_GRE;DeviceType_nGRE;DeviceType_nGnRE;DeviceType_nGnRnE]
val undefined_MemAttrHints : unit -> MemAttrHints
let undefined_MemAttrHints () =
<| MemAttrHints_attrs = (undefined_vector (2:ii) (undefined_bit ()) : list bitU);
MemAttrHints_hints = (undefined_vector (2:ii) (undefined_bit ()) : list bitU);
MemAttrHints_transient = (undefined_bool ()) |>
val undefined_MemoryAttributes : unit -> MemoryAttributes
let undefined_MemoryAttributes () =
<| MemoryAttributes_typ = (undefined_MemType ());
MemoryAttributes_device = (undefined_DeviceType ());
MemoryAttributes_inner = (undefined_MemAttrHints ());
MemoryAttributes_outer = (undefined_MemAttrHints ());
MemoryAttributes_shareable = (undefined_bool ());
MemoryAttributes_outershareable = (undefined_bool ()) |>
val undefined_FullAddress : unit -> FullAddress
let undefined_FullAddress () =
<| FullAddress_physicaladdress = (undefined_vector (52:ii) (undefined_bit ()) : list bitU);
FullAddress_NS = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) |>
val undefined_AddressDescriptor : unit -> AddressDescriptor
let undefined_AddressDescriptor () =
<| AddressDescriptor_fault = (undefined_FaultRecord ());
AddressDescriptor_memattrs = (undefined_MemoryAttributes ());
AddressDescriptor_paddress = (undefined_FullAddress ());
AddressDescriptor_vaddress = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) |>
val undefined_DescriptorUpdate : unit -> DescriptorUpdate
let undefined_DescriptorUpdate () =
<| DescriptorUpdate_AF = (undefined_bool ());
DescriptorUpdate_AP = (undefined_bool ());
DescriptorUpdate_descaddr = (undefined_AddressDescriptor ()) |>
val MemAtomicOp_of_num : integer -> MemAtomicOp
let MemAtomicOp_of_num arg_ =
let l__120 = arg_ in
if (eq l__120 (0:ii))
then MemAtomicOp_ADD
else
if (eq l__120 (1:ii))
then MemAtomicOp_BIC
else
if (eq l__120 (2:ii))
then MemAtomicOp_EOR
else
if (eq l__120 (3:ii))
then MemAtomicOp_ORR
else
if (eq l__120 (4:ii))
then MemAtomicOp_SMAX
else
if (eq l__120 (5:ii))
then MemAtomicOp_SMIN
else
if (eq l__120 (6:ii))
then MemAtomicOp_UMAX
else if (eq l__120 (7:ii)) then MemAtomicOp_UMIN else MemAtomicOp_SWP
val num_of_MemAtomicOp : MemAtomicOp -> integer
let num_of_MemAtomicOp arg_ =
match arg_ with
| MemAtomicOp_ADD -> (0:ii)
| MemAtomicOp_BIC -> (1:ii)
| MemAtomicOp_EOR -> (2:ii)
| MemAtomicOp_ORR -> (3:ii)
| MemAtomicOp_SMAX -> (4:ii)
| MemAtomicOp_SMIN -> (5:ii)
| MemAtomicOp_UMAX -> (6:ii)
| MemAtomicOp_UMIN -> (7:ii)
| MemAtomicOp_SWP -> (8:ii)
end
val undefined_MemAtomicOp : unit -> MemAtomicOp
let undefined_MemAtomicOp () =
internal_pick
[MemAtomicOp_ADD;MemAtomicOp_BIC;MemAtomicOp_EOR;MemAtomicOp_ORR;MemAtomicOp_SMAX;MemAtomicOp_SMIN;MemAtomicOp_UMAX;MemAtomicOp_UMIN;MemAtomicOp_SWP]
val FPType_of_num : integer -> FPType
let FPType_of_num arg_ =
let l__116 = arg_ in
if (eq l__116 (0:ii))
then FPType_Nonzero
else
if (eq l__116 (1:ii))
then FPType_Zero
else
if (eq l__116 (2:ii))
then FPType_Infinity
else if (eq l__116 (3:ii)) then FPType_QNaN else FPType_SNaN
val num_of_FPType : FPType -> integer
let num_of_FPType arg_ =
match arg_ with
| FPType_Nonzero -> (0:ii)
| FPType_Zero -> (1:ii)
| FPType_Infinity -> (2:ii)
| FPType_QNaN -> (3:ii)
| FPType_SNaN -> (4:ii)
end
val undefined_FPType : unit -> FPType
let undefined_FPType () =
internal_pick [FPType_Nonzero;FPType_Zero;FPType_Infinity;FPType_QNaN;FPType_SNaN]
val FPExc_of_num : integer -> FPExc
let FPExc_of_num arg_ =
let l__111 = arg_ in
if (eq l__111 (0:ii))
then FPExc_InvalidOp
else
if (eq l__111 (1:ii))
then FPExc_DivideByZero
else
if (eq l__111 (2:ii))
then FPExc_Overflow
else
if (eq l__111 (3:ii))
then FPExc_Underflow
else if (eq l__111 (4:ii)) then FPExc_Inexact else FPExc_InputDenorm
val num_of_FPExc : FPExc -> integer
let num_of_FPExc arg_ =
match arg_ with
| FPExc_InvalidOp -> (0:ii)
| FPExc_DivideByZero -> (1:ii)
| FPExc_Overflow -> (2:ii)
| FPExc_Underflow -> (3:ii)
| FPExc_Inexact -> (4:ii)
| FPExc_InputDenorm -> (5:ii)
end
val undefined_FPExc : unit -> FPExc
let undefined_FPExc () =
internal_pick
[FPExc_InvalidOp;FPExc_DivideByZero;FPExc_Overflow;FPExc_Underflow;FPExc_Inexact;FPExc_InputDenorm]
val FPRounding_of_num : integer -> FPRounding
let FPRounding_of_num arg_ =
let l__106 = arg_ in
if (eq l__106 (0:ii))
then FPRounding_TIEEVEN
else
if (eq l__106 (1:ii))
then FPRounding_POSINF
else
if (eq l__106 (2:ii))
then FPRounding_NEGINF
else
if (eq l__106 (3:ii))
then FPRounding_ZERO
else if (eq l__106 (4:ii)) then FPRounding_TIEAWAY else FPRounding_ODD
val num_of_FPRounding : FPRounding -> integer
let num_of_FPRounding arg_ =
match arg_ with
| FPRounding_TIEEVEN -> (0:ii)
| FPRounding_POSINF -> (1:ii)
| FPRounding_NEGINF -> (2:ii)
| FPRounding_ZERO -> (3:ii)
| FPRounding_TIEAWAY -> (4:ii)
| FPRounding_ODD -> (5:ii)
end
val undefined_FPRounding : unit -> FPRounding
let undefined_FPRounding () =
internal_pick
[FPRounding_TIEEVEN;FPRounding_POSINF;FPRounding_NEGINF;FPRounding_ZERO;FPRounding_TIEAWAY;FPRounding_ODD]
val SysRegAccess_of_num : integer -> SysRegAccess
let SysRegAccess_of_num arg_ =
let l__102 = arg_ in
if (eq l__102 (0:ii))
then SysRegAccess_OK
else
if (eq l__102 (1:ii))
then SysRegAccess_UNDEFINED
else
if (eq l__102 (2:ii))
then SysRegAccess_TrapToEL1
else if (eq l__102 (3:ii)) then SysRegAccess_TrapToEL2 else SysRegAccess_TrapToEL3
val num_of_SysRegAccess : SysRegAccess -> integer
let num_of_SysRegAccess arg_ =
match arg_ with
| SysRegAccess_OK -> (0:ii)
| SysRegAccess_UNDEFINED -> (1:ii)
| SysRegAccess_TrapToEL1 -> (2:ii)
| SysRegAccess_TrapToEL2 -> (3:ii)
| SysRegAccess_TrapToEL3 -> (4:ii)
end
val undefined_SysRegAccess : unit -> SysRegAccess
let undefined_SysRegAccess () =
internal_pick
[SysRegAccess_OK;SysRegAccess_UNDEFINED;SysRegAccess_TrapToEL1;SysRegAccess_TrapToEL2;SysRegAccess_TrapToEL3]
val SRType_of_num : integer -> SRType
let SRType_of_num arg_ =
let l__98 = arg_ in
if (eq l__98 (0:ii))
then SRType_LSL
else
if (eq l__98 (1:ii))
then SRType_LSR
else
if (eq l__98 (2:ii))
then SRType_ASR
else if (eq l__98 (3:ii)) then SRType_ROR else SRType_RRX
val num_of_SRType : SRType -> integer
let num_of_SRType arg_ =
match arg_ with
| SRType_LSL -> (0:ii)
| SRType_LSR -> (1:ii)
| SRType_ASR -> (2:ii)
| SRType_ROR -> (3:ii)
| SRType_RRX -> (4:ii)
end
val undefined_SRType : unit -> SRType
let undefined_SRType () = internal_pick [SRType_LSL;SRType_LSR;SRType_ASR;SRType_ROR;SRType_RRX]
val ShiftType_of_num : integer -> ShiftType
let ShiftType_of_num arg_ =
let l__95 = arg_ in
if (eq l__95 (0:ii))
then ShiftType_LSL
else
if (eq l__95 (1:ii))
then ShiftType_LSR
else if (eq l__95 (2:ii)) then ShiftType_ASR else ShiftType_ROR
val num_of_ShiftType : ShiftType -> integer
let num_of_ShiftType arg_ =
match arg_ with
| ShiftType_LSL -> (0:ii)
| ShiftType_LSR -> (1:ii)
| ShiftType_ASR -> (2:ii)
| ShiftType_ROR -> (3:ii)
end
val undefined_ShiftType : unit -> ShiftType
let undefined_ShiftType () = internal_pick [ShiftType_LSL;ShiftType_LSR;ShiftType_ASR;ShiftType_ROR]
val PrefetchHint_of_num : integer -> PrefetchHint
let PrefetchHint_of_num arg_ =
let l__93 = arg_ in
if (eq l__93 (0:ii))
then Prefetch_READ
else if (eq l__93 (1:ii)) then Prefetch_WRITE else Prefetch_EXEC
val num_of_PrefetchHint : PrefetchHint -> integer
let num_of_PrefetchHint arg_ =
match arg_ with
| Prefetch_READ -> (0:ii)
| Prefetch_WRITE -> (1:ii)
| Prefetch_EXEC -> (2:ii)
end
val undefined_PrefetchHint : unit -> PrefetchHint
let undefined_PrefetchHint () = internal_pick [Prefetch_READ;Prefetch_WRITE;Prefetch_EXEC]
val InterruptID_of_num : integer -> InterruptID
let InterruptID_of_num arg_ =
let l__89 = arg_ in
if (eq l__89 (0:ii))
then InterruptID_PMUIRQ
else
if (eq l__89 (1:ii))
then InterruptID_COMMIRQ
else
if (eq l__89 (2:ii))
then InterruptID_CTIIRQ
else if (eq l__89 (3:ii)) then InterruptID_COMMRX else InterruptID_COMMTX
val num_of_InterruptID : InterruptID -> integer
let num_of_InterruptID arg_ =
match arg_ with
| InterruptID_PMUIRQ -> (0:ii)
| InterruptID_COMMIRQ -> (1:ii)
| InterruptID_CTIIRQ -> (2:ii)
| InterruptID_COMMRX -> (3:ii)
| InterruptID_COMMTX -> (4:ii)
end
val undefined_InterruptID : unit -> InterruptID
let undefined_InterruptID () =
internal_pick
[InterruptID_PMUIRQ;InterruptID_COMMIRQ;InterruptID_CTIIRQ;InterruptID_COMMRX;InterruptID_COMMTX]
val CrossTriggerOut_of_num : integer -> CrossTriggerOut
let CrossTriggerOut_of_num arg_ =
let l__82 = arg_ in
if (eq l__82 (0:ii))
then CrossTriggerOut_DebugRequest
else
if (eq l__82 (1:ii))
then CrossTriggerOut_RestartRequest
else
if (eq l__82 (2:ii))
then CrossTriggerOut_IRQ
else
if (eq l__82 (3:ii))
then CrossTriggerOut_RSVD3
else
if (eq l__82 (4:ii))
then CrossTriggerOut_TraceExtIn0
else
if (eq l__82 (5:ii))
then CrossTriggerOut_TraceExtIn1
else if (eq l__82 (6:ii)) then CrossTriggerOut_TraceExtIn2 else CrossTriggerOut_TraceExtIn3
val num_of_CrossTriggerOut : CrossTriggerOut -> integer
let num_of_CrossTriggerOut arg_ =
match arg_ with
| CrossTriggerOut_DebugRequest -> (0:ii)
| CrossTriggerOut_RestartRequest -> (1:ii)
| CrossTriggerOut_IRQ -> (2:ii)
| CrossTriggerOut_RSVD3 -> (3:ii)
| CrossTriggerOut_TraceExtIn0 -> (4:ii)
| CrossTriggerOut_TraceExtIn1 -> (5:ii)
| CrossTriggerOut_TraceExtIn2 -> (6:ii)
| CrossTriggerOut_TraceExtIn3 -> (7:ii)
end
val undefined_CrossTriggerOut : unit -> CrossTriggerOut
let undefined_CrossTriggerOut () =
internal_pick
[CrossTriggerOut_DebugRequest;CrossTriggerOut_RestartRequest;CrossTriggerOut_IRQ;CrossTriggerOut_RSVD3;CrossTriggerOut_TraceExtIn0;CrossTriggerOut_TraceExtIn1;CrossTriggerOut_TraceExtIn2;CrossTriggerOut_TraceExtIn3]
val CrossTriggerIn_of_num : integer -> CrossTriggerIn
let CrossTriggerIn_of_num arg_ =
let l__75 = arg_ in
if (eq l__75 (0:ii))
then CrossTriggerIn_CrossHalt
else
if (eq l__75 (1:ii))
then CrossTriggerIn_PMUOverflow
else
if (eq l__75 (2:ii))
then CrossTriggerIn_RSVD2
else
if (eq l__75 (3:ii))
then CrossTriggerIn_RSVD3
else
if (eq l__75 (4:ii))
then CrossTriggerIn_TraceExtOut0
else
if (eq l__75 (5:ii))
then CrossTriggerIn_TraceExtOut1
else if (eq l__75 (6:ii)) then CrossTriggerIn_TraceExtOut2 else CrossTriggerIn_TraceExtOut3
val num_of_CrossTriggerIn : CrossTriggerIn -> integer
let num_of_CrossTriggerIn arg_ =
match arg_ with
| CrossTriggerIn_CrossHalt -> (0:ii)
| CrossTriggerIn_PMUOverflow -> (1:ii)
| CrossTriggerIn_RSVD2 -> (2:ii)
| CrossTriggerIn_RSVD3 -> (3:ii)
| CrossTriggerIn_TraceExtOut0 -> (4:ii)
| CrossTriggerIn_TraceExtOut1 -> (5:ii)
| CrossTriggerIn_TraceExtOut2 -> (6:ii)
| CrossTriggerIn_TraceExtOut3 -> (7:ii)
end
val undefined_CrossTriggerIn : unit -> CrossTriggerIn
let undefined_CrossTriggerIn () =
internal_pick
[CrossTriggerIn_CrossHalt;CrossTriggerIn_PMUOverflow;CrossTriggerIn_RSVD2;CrossTriggerIn_RSVD3;CrossTriggerIn_TraceExtOut0;CrossTriggerIn_TraceExtOut1;CrossTriggerIn_TraceExtOut2;CrossTriggerIn_TraceExtOut3]
val MemBarrierOp_of_num : integer -> MemBarrierOp
let MemBarrierOp_of_num arg_ =
let l__73 = arg_ in
if (eq l__73 (0:ii))
then MemBarrierOp_DSB
else if (eq l__73 (1:ii)) then MemBarrierOp_DMB else MemBarrierOp_ISB
val num_of_MemBarrierOp : MemBarrierOp -> integer
let num_of_MemBarrierOp arg_ =
match arg_ with
| MemBarrierOp_DSB -> (0:ii)
| MemBarrierOp_DMB -> (1:ii)
| MemBarrierOp_ISB -> (2:ii)
end
val undefined_MemBarrierOp : unit -> MemBarrierOp
let undefined_MemBarrierOp () = internal_pick [MemBarrierOp_DSB;MemBarrierOp_DMB;MemBarrierOp_ISB]
val undefined_AccessDescriptor : unit -> AccessDescriptor
let undefined_AccessDescriptor () =
<| AccessDescriptor_acctype = (undefined_AccType ());
AccessDescriptor_page_table_walk = (undefined_bool ());
AccessDescriptor_secondstage = (undefined_bool ());
AccessDescriptor_s2fs1walk = (undefined_bool ());
AccessDescriptor_level = (undefined_int ()) |>
val undefined_Permissions : unit -> Permissions
let undefined_Permissions () =
<| Permissions_ap = (undefined_vector (3:ii) (undefined_bit ()) : list bitU);
Permissions_xn = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
Permissions_xxn = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
Permissions_pxn = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) |>
val undefined_TLBRecord : unit -> TLBRecord
let undefined_TLBRecord () =
<| TLBRecord_perms = (undefined_Permissions ());
TLBRecord_nG = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
TLBRecord_domain = (undefined_vector (4:ii) (undefined_bit ()) : list bitU);
TLBRecord_contiguous = (undefined_bool ());
TLBRecord_level = (undefined_int ());
TLBRecord_blocksize = (undefined_int ());
TLBRecord_descupdate = (undefined_DescriptorUpdate ());
TLBRecord_CnP = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
TLBRecord_addrdesc = (undefined_AddressDescriptor ()) |>
val ImmediateOp_of_num : integer -> ImmediateOp
let ImmediateOp_of_num arg_ =
let l__70 = arg_ in
if (eq l__70 (0:ii))
then ImmediateOp_MOVI
else
if (eq l__70 (1:ii))
then ImmediateOp_MVNI
else if (eq l__70 (2:ii)) then ImmediateOp_ORR else ImmediateOp_BIC
val num_of_ImmediateOp : ImmediateOp -> integer
let num_of_ImmediateOp arg_ =
match arg_ with
| ImmediateOp_MOVI -> (0:ii)
| ImmediateOp_MVNI -> (1:ii)
| ImmediateOp_ORR -> (2:ii)
| ImmediateOp_BIC -> (3:ii)
end
val undefined_ImmediateOp : unit -> ImmediateOp
let undefined_ImmediateOp () =
internal_pick [ImmediateOp_MOVI;ImmediateOp_MVNI;ImmediateOp_ORR;ImmediateOp_BIC]
val MoveWideOp_of_num : integer -> MoveWideOp
let MoveWideOp_of_num arg_ =
let l__68 = arg_ in
if (eq l__68 (0:ii))
then MoveWideOp_N
else if (eq l__68 (1:ii)) then MoveWideOp_Z else MoveWideOp_K
val num_of_MoveWideOp : MoveWideOp -> integer
let num_of_MoveWideOp arg_ =
match arg_ with | MoveWideOp_N -> (0:ii) | MoveWideOp_Z -> (1:ii) | MoveWideOp_K -> (2:ii) end
val undefined_MoveWideOp : unit -> MoveWideOp
let undefined_MoveWideOp () = internal_pick [MoveWideOp_N;MoveWideOp_Z;MoveWideOp_K]
val SystemAccessType_of_num : integer -> SystemAccessType
let SystemAccessType_of_num arg_ =
let l__66 = arg_ in
if (eq l__66 (0:ii))
then SystemAccessType_RT
else if (eq l__66 (1:ii)) then SystemAccessType_RRT else SystemAccessType_DT
val num_of_SystemAccessType : SystemAccessType -> integer
let num_of_SystemAccessType arg_ =
match arg_ with
| SystemAccessType_RT -> (0:ii)
| SystemAccessType_RRT -> (1:ii)
| SystemAccessType_DT -> (2:ii)
end
val undefined_SystemAccessType : unit -> SystemAccessType
let undefined_SystemAccessType () =
internal_pick [SystemAccessType_RT;SystemAccessType_RRT;SystemAccessType_DT]
val VBitOp_of_num : integer -> VBitOp
let VBitOp_of_num arg_ =
let l__63 = arg_ in
if (eq l__63 (0:ii))
then VBitOp_VBIF
else
if (eq l__63 (1:ii))
then VBitOp_VBIT
else if (eq l__63 (2:ii)) then VBitOp_VBSL else VBitOp_VEOR
val num_of_VBitOp : VBitOp -> integer
let num_of_VBitOp arg_ =
match arg_ with
| VBitOp_VBIF -> (0:ii)
| VBitOp_VBIT -> (1:ii)
| VBitOp_VBSL -> (2:ii)
| VBitOp_VEOR -> (3:ii)
end
val undefined_VBitOp : unit -> VBitOp
let undefined_VBitOp () = internal_pick [VBitOp_VBIF;VBitOp_VBIT;VBitOp_VBSL;VBitOp_VEOR]
val TimeStamp_of_num : integer -> TimeStamp
let TimeStamp_of_num arg_ =
let l__61 = arg_ in
if (eq l__61 (0:ii))
then TimeStamp_None
else if (eq l__61 (1:ii)) then TimeStamp_Virtual else TimeStamp_Physical
val num_of_TimeStamp : TimeStamp -> integer
let num_of_TimeStamp arg_ =
match arg_ with
| TimeStamp_None -> (0:ii)
| TimeStamp_Virtual -> (1:ii)
| TimeStamp_Physical -> (2:ii)
end
val undefined_TimeStamp : unit -> TimeStamp
let undefined_TimeStamp () = internal_pick [TimeStamp_None;TimeStamp_Virtual;TimeStamp_Physical]
val PrivilegeLevel_of_num : integer -> PrivilegeLevel
let PrivilegeLevel_of_num arg_ =
let l__58 = arg_ in
if (eq l__58 (0:ii))
then PL3
else if (eq l__58 (1:ii)) then PL2 else if (eq l__58 (2:ii)) then PL1 else PL0
val num_of_PrivilegeLevel : PrivilegeLevel -> integer
let num_of_PrivilegeLevel arg_ =
match arg_ with | PL3 -> (0:ii) | PL2 -> (1:ii) | PL1 -> (2:ii) | PL0 -> (3:ii) end
val undefined_PrivilegeLevel : unit -> PrivilegeLevel
let undefined_PrivilegeLevel () = internal_pick [PL3;PL2;PL1;PL0]
val undefined_AArch32_SErrorSyndrome : unit -> AArch32_SErrorSyndrome
let undefined_AArch32_SErrorSyndrome () =
<| AArch32_SErrorSyndrome_AET = (undefined_vector (2:ii) (undefined_bit ()) : list bitU);
AArch32_SErrorSyndrome_ExT = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) |>
val SystemOp_of_num : integer -> SystemOp
let SystemOp_of_num arg_ =
let l__54 = arg_ in
if (eq l__54 (0:ii))
then Sys_AT
else
if (eq l__54 (1:ii))
then Sys_DC
else if (eq l__54 (2:ii)) then Sys_IC else if (eq l__54 (3:ii)) then Sys_TLBI else Sys_SYS
val num_of_SystemOp : SystemOp -> integer
let num_of_SystemOp arg_ =
match arg_ with
| Sys_AT -> (0:ii)
| Sys_DC -> (1:ii)
| Sys_IC -> (2:ii)
| Sys_TLBI -> (3:ii)
| Sys_SYS -> (4:ii)
end
val undefined_SystemOp : unit -> SystemOp
let undefined_SystemOp () = internal_pick [Sys_AT;Sys_DC;Sys_IC;Sys_TLBI;Sys_SYS]
val undefined_PCSample : unit -> PCSample
let undefined_PCSample () =
<| PCSample_valid_name = (undefined_bool ());
PCSample_pc = (undefined_vector (64:ii) (undefined_bit ()) : list bitU);
PCSample_el = (undefined_vector (2:ii) (undefined_bit ()) : list bitU);
PCSample_rw = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
PCSample_ns = (undefined_vector (1:ii) (undefined_bit ()) : list bitU);
PCSample_contextidr = (undefined_vector (32:ii) (undefined_bit ()) : list bitU);
PCSample_contextidr_el2 = (undefined_vector (32:ii) (undefined_bit ()) : list bitU);
PCSample_vmid = (undefined_vector (16:ii) (undefined_bit ()) : list bitU) |>
val ReduceOp_of_num : integer -> ReduceOp
let ReduceOp_of_num arg_ =
let l__49 = arg_ in
if (eq l__49 (0:ii))
then ReduceOp_FMINNUM
else
if (eq l__49 (1:ii))
then ReduceOp_FMAXNUM
else
if (eq l__49 (2:ii))
then ReduceOp_FMIN
else
if (eq l__49 (3:ii))
then ReduceOp_FMAX
else if (eq l__49 (4:ii)) then ReduceOp_FADD else ReduceOp_ADD
val num_of_ReduceOp : ReduceOp -> integer
let num_of_ReduceOp arg_ =
match arg_ with
| ReduceOp_FMINNUM -> (0:ii)
| ReduceOp_FMAXNUM -> (1:ii)
| ReduceOp_FMIN -> (2:ii)
| ReduceOp_FMAX -> (3:ii)
| ReduceOp_FADD -> (4:ii)
| ReduceOp_ADD -> (5:ii)
end
val undefined_ReduceOp : unit -> ReduceOp
let undefined_ReduceOp () =
internal_pick
[ReduceOp_FMINNUM;ReduceOp_FMAXNUM;ReduceOp_FMIN;ReduceOp_FMAX;ReduceOp_FADD;ReduceOp_ADD]
val LogicalOp_of_num : integer -> LogicalOp
let LogicalOp_of_num arg_ =
let l__47 = arg_ in
if (eq l__47 (0:ii))
then LogicalOp_AND
else if (eq l__47 (1:ii)) then LogicalOp_EOR else LogicalOp_ORR
val num_of_LogicalOp : LogicalOp -> integer
let num_of_LogicalOp arg_ =
match arg_ with | LogicalOp_AND -> (0:ii) | LogicalOp_EOR -> (1:ii) | LogicalOp_ORR -> (2:ii) end
val undefined_LogicalOp : unit -> LogicalOp
let undefined_LogicalOp () = internal_pick [LogicalOp_AND;LogicalOp_EOR;LogicalOp_ORR]
val ExtendType_of_num : integer -> ExtendType
let ExtendType_of_num arg_ =
let l__40 = arg_ in
if (eq l__40 (0:ii))
then ExtendType_SXTB
else
if (eq l__40 (1:ii))
then ExtendType_SXTH
else
if (eq l__40 (2:ii))
then ExtendType_SXTW
else
if (eq l__40 (3:ii))
then ExtendType_SXTX
else
if (eq l__40 (4:ii))
then ExtendType_UXTB
else
if (eq l__40 (5:ii))
then ExtendType_UXTH
else if (eq l__40 (6:ii)) then ExtendType_UXTW else ExtendType_UXTX
val num_of_ExtendType : ExtendType -> integer
let num_of_ExtendType arg_ =
match arg_ with
| ExtendType_SXTB -> (0:ii)
| ExtendType_SXTH -> (1:ii)
| ExtendType_SXTW -> (2:ii)
| ExtendType_SXTX -> (3:ii)
| ExtendType_UXTB -> (4:ii)
| ExtendType_UXTH -> (5:ii)
| ExtendType_UXTW -> (6:ii)
| ExtendType_UXTX -> (7:ii)
end
val undefined_ExtendType : unit -> ExtendType
let undefined_ExtendType () =
internal_pick
[ExtendType_SXTB;ExtendType_SXTH;ExtendType_SXTW;ExtendType_SXTX;ExtendType_UXTB;ExtendType_UXTH;ExtendType_UXTW;ExtendType_UXTX]
val SystemHintOp_of_num : integer -> SystemHintOp
let SystemHintOp_of_num arg_ =
let l__33 = arg_ in
if (eq l__33 (0:ii))
then SystemHintOp_NOP
else
if (eq l__33 (1:ii))
then SystemHintOp_YIELD
else
if (eq l__33 (2:ii))
then SystemHintOp_WFE
else
if (eq l__33 (3:ii))
then SystemHintOp_WFI
else
if (eq l__33 (4:ii))
then SystemHintOp_SEV
else
if (eq l__33 (5:ii))
then SystemHintOp_SEVL
else if (eq l__33 (6:ii)) then SystemHintOp_ESB else SystemHintOp_PSB
val num_of_SystemHintOp : SystemHintOp -> integer
let num_of_SystemHintOp arg_ =
match arg_ with
| SystemHintOp_NOP -> (0:ii)
| SystemHintOp_YIELD -> (1:ii)
| SystemHintOp_WFE -> (2:ii)
| SystemHintOp_WFI -> (3:ii)
| SystemHintOp_SEV -> (4:ii)
| SystemHintOp_SEVL -> (5:ii)
| SystemHintOp_ESB -> (6:ii)
| SystemHintOp_PSB -> (7:ii)
end
val undefined_SystemHintOp : unit -> SystemHintOp
let undefined_SystemHintOp () =
internal_pick
[SystemHintOp_NOP;SystemHintOp_YIELD;SystemHintOp_WFE;SystemHintOp_WFI;SystemHintOp_SEV;SystemHintOp_SEVL;SystemHintOp_ESB;SystemHintOp_PSB]
val MemOp_of_num : integer -> MemOp
let MemOp_of_num arg_ =
let l__31 = arg_ in
if (eq l__31 (0:ii))
then MemOp_LOAD
else if (eq l__31 (1:ii)) then MemOp_STORE else MemOp_PREFETCH
val num_of_MemOp : MemOp -> integer
let num_of_MemOp arg_ =
match arg_ with | MemOp_LOAD -> (0:ii) | MemOp_STORE -> (1:ii) | MemOp_PREFETCH -> (2:ii) end
val undefined_MemOp : unit -> MemOp
let undefined_MemOp () = internal_pick [MemOp_LOAD;MemOp_STORE;MemOp_PREFETCH]
val OpType_of_num : integer -> OpType
let OpType_of_num arg_ =
let l__27 = arg_ in
if (eq l__27 (0:ii))
then OpType_Load
else
if (eq l__27 (1:ii))
then OpType_Store
else
if (eq l__27 (2:ii))
then OpType_LoadAtomic
else if (eq l__27 (3:ii)) then OpType_Branch else OpType_Other
val num_of_OpType : OpType -> integer
let num_of_OpType arg_ =
match arg_ with
| OpType_Load -> (0:ii)
| OpType_Store -> (1:ii)
| OpType_LoadAtomic -> (2:ii)
| OpType_Branch -> (3:ii)
| OpType_Other -> (4:ii)
end
val undefined_OpType : unit -> OpType
let undefined_OpType () =
internal_pick [OpType_Load;OpType_Store;OpType_LoadAtomic;OpType_Branch;OpType_Other]
val FPUnaryOp_of_num : integer -> FPUnaryOp
let FPUnaryOp_of_num arg_ =
let l__24 = arg_ in
if (eq l__24 (0:ii))
then FPUnaryOp_ABS
else
if (eq l__24 (1:ii))
then FPUnaryOp_MOV
else if (eq l__24 (2:ii)) then FPUnaryOp_NEG else FPUnaryOp_SQRT
val num_of_FPUnaryOp : FPUnaryOp -> integer
let num_of_FPUnaryOp arg_ =
match arg_ with
| FPUnaryOp_ABS -> (0:ii)
| FPUnaryOp_MOV -> (1:ii)
| FPUnaryOp_NEG -> (2:ii)
| FPUnaryOp_SQRT -> (3:ii)
end
val undefined_FPUnaryOp : unit -> FPUnaryOp
let undefined_FPUnaryOp () =
internal_pick [FPUnaryOp_ABS;FPUnaryOp_MOV;FPUnaryOp_NEG;FPUnaryOp_SQRT]
val CompareOp_of_num : integer -> CompareOp
let CompareOp_of_num arg_ =
let l__20 = arg_ in
if (eq l__20 (0:ii))
then CompareOp_GT
else
if (eq l__20 (1:ii))
then CompareOp_GE
else
if (eq l__20 (2:ii))
then CompareOp_EQ
else if (eq l__20 (3:ii)) then CompareOp_LE else CompareOp_LT
val num_of_CompareOp : CompareOp -> integer
let num_of_CompareOp arg_ =
match arg_ with
| CompareOp_GT -> (0:ii)
| CompareOp_GE -> (1:ii)
| CompareOp_EQ -> (2:ii)
| CompareOp_LE -> (3:ii)
| CompareOp_LT -> (4:ii)
end
val undefined_CompareOp : unit -> CompareOp
let undefined_CompareOp () =
internal_pick [CompareOp_GT;CompareOp_GE;CompareOp_EQ;CompareOp_LE;CompareOp_LT]
val PSTATEField_of_num : integer -> PSTATEField
let PSTATEField_of_num arg_ =
let l__16 = arg_ in
if (eq l__16 (0:ii))
then PSTATEField_DAIFSet
else
if (eq l__16 (1:ii))
then PSTATEField_DAIFClr
else
if (eq l__16 (2:ii))
then PSTATEField_PAN
else if (eq l__16 (3:ii)) then PSTATEField_UAO else PSTATEField_SP
val num_of_PSTATEField : PSTATEField -> integer
let num_of_PSTATEField arg_ =
match arg_ with
| PSTATEField_DAIFSet -> (0:ii)
| PSTATEField_DAIFClr -> (1:ii)
| PSTATEField_PAN -> (2:ii)
| PSTATEField_UAO -> (3:ii)
| PSTATEField_SP -> (4:ii)
end
val undefined_PSTATEField : unit -> PSTATEField
let undefined_PSTATEField () =
internal_pick
[PSTATEField_DAIFSet;PSTATEField_DAIFClr;PSTATEField_PAN;PSTATEField_UAO;PSTATEField_SP]
val FPMaxMinOp_of_num : integer -> FPMaxMinOp
let FPMaxMinOp_of_num arg_ =
let l__13 = arg_ in
if (eq l__13 (0:ii))
then FPMaxMinOp_MAX
else
if (eq l__13 (1:ii))
then FPMaxMinOp_MIN
else if (eq l__13 (2:ii)) then FPMaxMinOp_MAXNUM else FPMaxMinOp_MINNUM
val num_of_FPMaxMinOp : FPMaxMinOp -> integer
let num_of_FPMaxMinOp arg_ =
match arg_ with
| FPMaxMinOp_MAX -> (0:ii)
| FPMaxMinOp_MIN -> (1:ii)
| FPMaxMinOp_MAXNUM -> (2:ii)
| FPMaxMinOp_MINNUM -> (3:ii)
end
val undefined_FPMaxMinOp : unit -> FPMaxMinOp
let undefined_FPMaxMinOp () =
internal_pick [FPMaxMinOp_MAX;FPMaxMinOp_MIN;FPMaxMinOp_MAXNUM;FPMaxMinOp_MINNUM]
val CountOp_of_num : integer -> CountOp
let CountOp_of_num arg_ =
let l__11 = arg_ in
if (eq l__11 (0:ii))
then CountOp_CLZ
else if (eq l__11 (1:ii)) then CountOp_CLS else CountOp_CNT
val num_of_CountOp : CountOp -> integer
let num_of_CountOp arg_ =
match arg_ with | CountOp_CLZ -> (0:ii) | CountOp_CLS -> (1:ii) | CountOp_CNT -> (2:ii) end
val undefined_CountOp : unit -> CountOp
let undefined_CountOp () = internal_pick [CountOp_CLZ;CountOp_CLS;CountOp_CNT]
val VFPNegMul_of_num : integer -> VFPNegMul
let VFPNegMul_of_num arg_ =
let l__9 = arg_ in
if (eq l__9 (0:ii))
then VFPNegMul_VNMLA
else if (eq l__9 (1:ii)) then VFPNegMul_VNMLS else VFPNegMul_VNMUL
val num_of_VFPNegMul : VFPNegMul -> integer
let num_of_VFPNegMul arg_ =
match arg_ with
| VFPNegMul_VNMLA -> (0:ii)
| VFPNegMul_VNMLS -> (1:ii)
| VFPNegMul_VNMUL -> (2:ii)
end
val undefined_VFPNegMul : unit -> VFPNegMul
let undefined_VFPNegMul () = internal_pick [VFPNegMul_VNMLA;VFPNegMul_VNMLS;VFPNegMul_VNMUL]
val VBitOps_of_num : integer -> VBitOps
let VBitOps_of_num arg_ =
let l__7 = arg_ in
if (eq l__7 (0:ii))
then VBitOps_VBIF
else if (eq l__7 (1:ii)) then VBitOps_VBIT else VBitOps_VBSL
val num_of_VBitOps : VBitOps -> integer
let num_of_VBitOps arg_ =
match arg_ with | VBitOps_VBIF -> (0:ii) | VBitOps_VBIT -> (1:ii) | VBitOps_VBSL -> (2:ii) end
val undefined_VBitOps : unit -> VBitOps
let undefined_VBitOps () = internal_pick [VBitOps_VBIF;VBitOps_VBIT;VBitOps_VBSL]
val VCGEtype_of_num : integer -> VCGEtype
let VCGEtype_of_num arg_ =
let l__5 = arg_ in
if (eq l__5 (0:ii))
then VCGEtype_signed
else if (eq l__5 (1:ii)) then VCGEtype_unsigned else VCGEtype_fp
val num_of_VCGEtype : VCGEtype -> integer
let num_of_VCGEtype arg_ =
match arg_ with
| VCGEtype_signed -> (0:ii)
| VCGEtype_unsigned -> (1:ii)
| VCGEtype_fp -> (2:ii)
end
val undefined_VCGEtype : unit -> VCGEtype
let undefined_VCGEtype () = internal_pick [VCGEtype_signed;VCGEtype_unsigned;VCGEtype_fp]
val VCGTtype_of_num : integer -> VCGTtype
let VCGTtype_of_num arg_ =
let l__3 = arg_ in
if (eq l__3 (0:ii))
then VCGTtype_signed
else if (eq l__3 (1:ii)) then VCGTtype_unsigned else VCGTtype_fp
val num_of_VCGTtype : VCGTtype -> integer
let num_of_VCGTtype arg_ =
match arg_ with
| VCGTtype_signed -> (0:ii)
| VCGTtype_unsigned -> (1:ii)
| VCGTtype_fp -> (2:ii)
end
val undefined_VCGTtype : unit -> VCGTtype
let undefined_VCGTtype () = internal_pick [VCGTtype_signed;VCGTtype_unsigned;VCGTtype_fp]
val __InstrEnc_of_num : integer -> __InstrEnc
let __InstrEnc_of_num arg_ =
let l__0 = arg_ in
if (eq l__0 (0:ii))
then __A64
else if (eq l__0 (1:ii)) then __A32 else if (eq l__0 (2:ii)) then __T16 else __T32
val num_of___InstrEnc : __InstrEnc -> integer
let num_of___InstrEnc arg_ =
match arg_ with | __A64 -> (0:ii) | __A32 -> (1:ii) | __T16 -> (2:ii) | __T32 -> (3:ii) end
val undefined___InstrEnc : unit -> __InstrEnc
let undefined___InstrEnc () = internal_pick [__A64;__A32;__T16;__T32]
val __UNKNOWN_integer : unit -> ii
let __UNKNOWN_integer () = (0:ii)
val ThisInstrAddr : integer -> unit -> M (list bitU)
let ThisInstrAddr (N__tv : integer) () =
(read_reg _PC_ref : M (list bitU)) >>= fun (w__0 : bits ty64) ->
return (slice w__0 (0:ii) N__tv : list bitU)
val ThisInstr : unit -> M (list bitU)
let ThisInstr () = (read_reg __ThisInstr_ref : M (list bitU))
val SynchronizeContext : unit -> unit
let SynchronizeContext () = ()
val ProcessorID : unit -> ii
let ProcessorID () = (0:ii)
val __UNKNOWN_PrefetchHint : unit -> PrefetchHint
let __UNKNOWN_PrefetchHint () = Prefetch_READ
val __UNKNOWN_MemType : unit -> MemType
let __UNKNOWN_MemType () = MemType_Normal
val __UNKNOWN_MemOp : unit -> MemOp
let __UNKNOWN_MemOp () = MemOp_LOAD
let (M32_User : list bitU) = [B1;B0;B0;B0;B0]
let (M32_Undef : list bitU) = [B1;B1;B0;B1;B1]
let (M32_System : list bitU) = [B1;B1;B1;B1;B1]
let (M32_Svc : list bitU) = [B1;B0;B0;B1;B1]
let (M32_Monitor : list bitU) = [B1;B0;B1;B1;B0]
let (M32_IRQ : list bitU) = [B1;B0;B0;B1;B0]
let (M32_Hyp : list bitU) = [B1;B1;B0;B1;B0]
let (M32_FIQ : list bitU) = [B1;B0;B0;B0;B1]
let (M32_Abort : list bitU) = [B1;B0;B1;B1;B1]
val __UNKNOWN_InstrSet : unit -> InstrSet
let __UNKNOWN_InstrSet () = InstrSet_A64
val Hint_Prefetch : list bitU -> PrefetchHint -> ii -> bool -> unit
let Hint_Prefetch address hint target stream = ()
val Hint_Branch : BranchType -> unit
let Hint_Branch hint = ()
val HaveAnyAArch32 : unit -> bool
let HaveAnyAArch32 () = false
val __UNKNOWN_Fault : unit -> Fault
let __UNKNOWN_Fault () = Fault_None
val __UNKNOWN_boolean : unit -> bool
let __UNKNOWN_boolean () = false
val Unreachable : unit -> M unit
let Unreachable () = assert_exp false "FALSE"
val RBankSelect : list bitU -> ii -> ii -> ii -> ii -> ii -> ii -> ii -> M ii
let RBankSelect mode usr fiq irq svc abt und hyp =
let (result : ii) = undefined_int () in
let _pat_ = mode in
(if (eq_vec _pat_ M32_User)
then
let (result : ii) = usr in
return result
else
(if (eq_vec _pat_ M32_FIQ)
then
let (result : ii) = fiq in
return result
else
(if (eq_vec _pat_ M32_IRQ)
then
let (result : ii) = irq in
return result
else
(if (eq_vec _pat_ M32_Svc)
then
let (result : ii) = svc in
return result
else
(if (eq_vec _pat_ M32_Abort)
then
let (result : ii) = abt in
return result
else
(if (eq_vec _pat_ M32_Hyp)
then
let (result : ii) = hyp in
return result
else
(if (eq_vec _pat_ M32_Undef)
then
let (result : ii) = und in
return result
else
(if (eq_vec _pat_ M32_System)
then
let (result : ii) = usr in
return result
else
Unreachable () >>
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result
val TakeUnmaskedPhysicalSErrorInterrupts : bool -> M unit
let TakeUnmaskedPhysicalSErrorInterrupts iesb_req = assert_exp false "FALSE"
val __UNKNOWN_Exception : unit -> Exception
let __UNKNOWN_Exception () = Exception_Uncategorized
val ErrorSynchronizationBarrier : MBReqDomain -> MBReqTypes -> unit
let ErrorSynchronizationBarrier domain types = ()
val EndOfInstruction : unit -> unit
let EndOfInstruction () = ()
let (EL3 : list bitU) = [B1;B1]
let (EL2 : list bitU) = [B1;B0]
let (EL1 : list bitU) = [B0;B1]
let (EL0 : list bitU) = [B0;B0]
val __UNKNOWN_DeviceType : unit -> DeviceType
let __UNKNOWN_DeviceType () = DeviceType_GRE
let (DebugException_VectorCatch : list bitU) = [B0;B1;B0;B1]
val __UNKNOWN_Constraint : unit -> Constraint
let __UNKNOWN_Constraint () = Constraint_NONE
val ConstrainUnpredictable : Unpredictable -> Constraint
let ConstrainUnpredictable which =
match which with
| Unpredictable_WBOVERLAPLD -> Constraint_WBSUPPRESS
| Unpredictable_WBOVERLAPST -> Constraint_NONE
| Unpredictable_LDPOVERLAP -> Constraint_UNDEF
| Unpredictable_BASEOVERLAP -> Constraint_NONE
| Unpredictable_DATAOVERLAP -> Constraint_NONE
| Unpredictable_DEVPAGE2 -> Constraint_FAULT
| Unpredictable_INSTRDEVICE -> Constraint_NONE
| Unpredictable_RESCPACR -> Constraint_UNKNOWN
| Unpredictable_RESMAIR -> Constraint_UNKNOWN
| Unpredictable_RESTEXCB -> Constraint_UNKNOWN
| Unpredictable_RESDACR -> Constraint_UNKNOWN
| Unpredictable_RESPRRR -> Constraint_UNKNOWN
| Unpredictable_RESVTCRS -> Constraint_UNKNOWN
| Unpredictable_RESTnSZ -> Constraint_FORCE
| Unpredictable_OORTnSZ -> Constraint_FORCE
| Unpredictable_LARGEIPA -> Constraint_FORCE
| Unpredictable_ESRCONDPASS -> Constraint_FALSE
| Unpredictable_ILZEROIT -> Constraint_FALSE
| Unpredictable_ILZEROT -> Constraint_FALSE
| Unpredictable_BPVECTORCATCHPRI -> Constraint_TRUE
| Unpredictable_VCMATCHHALF -> Constraint_FALSE
| Unpredictable_VCMATCHDAPA -> Constraint_FALSE
| Unpredictable_WPMASKANDBAS -> Constraint_FALSE
| Unpredictable_WPBASCONTIGUOUS -> Constraint_FALSE
| Unpredictable_RESWPMASK -> Constraint_DISABLED
| Unpredictable_WPMASKEDBITS -> Constraint_FALSE
| Unpredictable_RESBPWPCTRL -> Constraint_DISABLED
| Unpredictable_BPNOTIMPL -> Constraint_DISABLED
| Unpredictable_RESBPTYPE -> Constraint_DISABLED
| Unpredictable_BPNOTCTXCMP -> Constraint_DISABLED
| Unpredictable_BPMATCHHALF -> Constraint_FALSE
| Unpredictable_BPMISMATCHHALF -> Constraint_FALSE
| Unpredictable_RESTARTALIGNPC -> Constraint_FALSE
| Unpredictable_RESTARTZEROUPPERPC -> Constraint_TRUE
| Unpredictable_ZEROUPPER -> Constraint_TRUE
| Unpredictable_ERETZEROUPPERPC -> Constraint_TRUE
| Unpredictable_A32FORCEALIGNPC -> Constraint_FALSE
| Unpredictable_SMD -> Constraint_UNDEF
| Unpredictable_AFUPDATE -> Constraint_TRUE
| Unpredictable_IESBinDebug -> Constraint_TRUE
| Unpredictable_CLEARERRITEZERO -> Constraint_FALSE
end
val ClearExclusiveByAddress : FullAddress -> ii -> ii -> unit
let ClearExclusiveByAddress paddress processorid size = ()
val __UNKNOWN_AccType : unit -> AccType
let __UNKNOWN_AccType () = AccType_NORMAL
val CreateAccessDescriptor : AccType -> AccessDescriptor
let CreateAccessDescriptor acctype =
let (accdesc : AccessDescriptor) = undefined_AccessDescriptor () in
let (accdesc : AccessDescriptor) = <|accdesc with AccessDescriptor_acctype = acctype|> in
let (accdesc : AccessDescriptor) = <|accdesc with AccessDescriptor_page_table_walk = false|> in
accdesc
val AArch64_CreateFaultRecord : Fault -> list bitU -> ii -> AccType -> bool -> list bitU -> list bitU -> bool -> bool -> FaultRecord
let AArch64_CreateFaultRecord typ ipaddress level acctype write extflag errortype secondstage s2fs1walk =
let (fault : FaultRecord) = undefined_FaultRecord () in
let (fault : FaultRecord) = <|fault with FaultRecord_typ = typ|> in
let (fault : FaultRecord) =
<|fault with FaultRecord_domain = (undefined_vector (4:ii) (undefined_bit ()) : list bitU)|> in
let (fault : FaultRecord) =
<|fault with FaultRecord_debugmoe = (undefined_vector (4:ii) (undefined_bit ()) : list bitU)|> in
let (fault : FaultRecord) = <|fault with FaultRecord_errortype = errortype|> in
let (fault : FaultRecord) = <|fault with FaultRecord_ipaddress = ipaddress|> in
let (fault : FaultRecord) = <|fault with FaultRecord_level = level|> in
let (fault : FaultRecord) = <|fault with FaultRecord_acctype = acctype|> in
let (fault : FaultRecord) = <|fault with FaultRecord_write = write|> in
let (fault : FaultRecord) = <|fault with FaultRecord_extflag = extflag|> in
let (fault : FaultRecord) = <|fault with FaultRecord_secondstage = secondstage|> in
let (fault : FaultRecord) = <|fault with FaultRecord_s2fs1walk = s2fs1walk|> in
fault
val AArch64_AlignmentFault : AccType -> bool -> bool -> FaultRecord
let AArch64_AlignmentFault acctype iswrite secondstage =
let (ipaddress : bits ty52) = (undefined_vector (52:ii) (undefined_bit ()) : list bitU) in
let (level : ii) = undefined_int () in
let (extflag : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
let (errortype : bits ty2) = (undefined_vector (2:ii) (undefined_bit ()) : list bitU) in
let (s2fs1walk : bool) = undefined_bool () in
AArch64_CreateFaultRecord
Fault_Alignment
ipaddress
level
acctype
iswrite
extflag
errortype
secondstage
s2fs1walk
val aget_SP : integer -> unit -> M (list bitU)
let aget_SP (width__tv : integer) () =
assert_exp (or_bool
(eq width__tv (8:ii))
(or_bool
(eq width__tv (16:ii))
(or_bool (eq width__tv (32:ii)) (eq width__tv (64:ii))))) "((width == 8) || ((width == 16) || ((width == 32) || (width == 64))))" >>
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
if (eq_vec w__0.ProcState_SP ([B0]))
then
(read_reg SP_EL0_ref : M (list bitU)) >>= fun (w__1 : bits ty64) ->
return (slice w__1 (0:ii) width__tv : list bitU)
else
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
let p__288 = w__2.ProcState_EL in
let _pat_ = p__288 in
if (eq_vec _pat_ EL0)
then
(read_reg SP_EL0_ref : M (list bitU)) >>= fun (w__3 : bits ty64) ->
return (slice w__3 (0:ii) width__tv : list bitU)
else
if (eq_vec _pat_ EL1)
then
(read_reg SP_EL1_ref : M (list bitU)) >>= fun (w__4 : bits ty64) ->
return (slice w__4 (0:ii) width__tv : list bitU)
else
if (eq_vec _pat_ EL2)
then
(read_reg SP_EL2_ref : M (list bitU)) >>= fun (w__5 : bits ty64) ->
return (slice w__5 (0:ii) width__tv : list bitU)
else
(read_reg SP_EL3_ref : M (list bitU)) >>= fun (w__6 : bits ty64) ->
return (slice w__6 (0:ii) width__tv : list bitU)
val __IMPDEF_boolean : string -> bool
let __IMPDEF_boolean x =
if (eq x "Condition valid for trapped T32")
then true
else
if (eq x "Has Dot Product extension")
then true
else
if (eq x "Has RAS extension")
then true
else
if (eq x "Has SHA512 and SHA3 Crypto instructions")
then true
else
if (eq x "Has SM3 and SM4 Crypto instructions")
then true
else
if (eq x "Has basic Crypto instructions")
then true
else
if (eq x "Have CRC extension")
then true
else
if (eq x "Report I-cache maintenance fault in IFSR")
then true
else
if (eq x "Reserved Control Space EL0 Trapped")
then true
else
if (eq x "Translation fault on misprogrammed contiguous bit")
then true
else
if (eq x "UNDEF unallocated CP15 access at NS EL0")
then true
else if (eq x "UNDEF unallocated CP15 access at NS EL0") then true else false
val ThisInstrLength : unit -> M ii
let ThisInstrLength () =
read_reg __ThisInstrEnc_ref >>= fun (w__0 : __InstrEnc) ->
return (if (eq w__0 __T16)
then (16:ii)
else (32:ii))
val HaveEL : list bitU -> bool
let HaveEL el = if (or_bool (eq_vec el EL1) (eq_vec el EL0)) then true else true
val HighestEL : unit -> list bitU
let HighestEL () = if (HaveEL EL3) then EL3 else if (HaveEL EL2) then EL2 else EL1
val HasArchVersion : ArchVersion -> bool
let HasArchVersion version =
or_bool
(eq version ARMv8p0)
(or_bool (eq version ARMv8p1) (or_bool (eq version ARMv8p2) (eq version ARMv8p3)))
val HaveVirtHostExt : unit -> bool
let HaveVirtHostExt () = HasArchVersion ARMv8p1
val HaveUAOExt : unit -> bool
let HaveUAOExt () = HasArchVersion ARMv8p2
val HaveRASExt : unit -> bool
let HaveRASExt () = or_bool (HasArchVersion ARMv8p2) (__IMPDEF_boolean "Has RAS extension")
val HavePANExt : unit -> bool
let HavePANExt () = HasArchVersion ARMv8p1
val HavePACExt : unit -> bool
let HavePACExt () = HasArchVersion ARMv8p3
val ConstrainUnpredictableBool : Unpredictable -> M bool
let ConstrainUnpredictableBool which =
let (c : Constraint) = ConstrainUnpredictable which in
assert_exp (or_bool (eq c Constraint_TRUE) (eq c Constraint_FALSE)) "((c == Constraint_TRUE) || (c == Constraint_FALSE))" >>
return (eq c Constraint_TRUE)
val LookUpRIndex : ii -> list bitU -> M ii
let LookUpRIndex n mode =
assert_exp (and_bool (gteq n (0:ii)) (lteq n (14:ii))) "((n >= 0) && (n <= 14))" >>
let (result : ii) = undefined_int () in
let v_0 = n in
(if (eq v_0 (8:ii))
then
RBankSelect mode (8:ii) (24:ii) (8:ii) (8:ii) (8:ii) (8:ii) (8:ii) >>= fun (w__0 : ii) ->
let (result : ii) = w__0 in
return result
else
(if (eq v_0 (9:ii))
then
RBankSelect mode (9:ii) (25:ii) (9:ii) (9:ii) (9:ii) (9:ii) (9:ii) >>= fun (w__1 : ii) ->
let (result : ii) = w__1 in
return result
else
(if (eq v_0 (10:ii))
then
RBankSelect mode (10:ii) (26:ii) (10:ii) (10:ii) (10:ii) (10:ii) (10:ii) >>= fun (w__2 :
ii) ->
let (result : ii) = w__2 in
return result
else
(if (eq v_0 (11:ii))
then
RBankSelect mode (11:ii) (27:ii) (11:ii) (11:ii) (11:ii) (11:ii) (11:ii) >>= fun (w__3 :
ii) ->
let (result : ii) = w__3 in
return result
else
(if (eq v_0 (12:ii))
then
RBankSelect mode (12:ii) (28:ii) (12:ii) (12:ii) (12:ii) (12:ii) (12:ii) >>= fun (w__4 :
ii) ->
let (result : ii) = w__4 in
return result
else
(if (eq v_0 (13:ii))
then
RBankSelect mode (13:ii) (29:ii) (17:ii) (19:ii) (21:ii) (23:ii) (15:ii) >>= fun (w__5 :
ii) ->
let (result : ii) = w__5 in
return result
else
(if (eq v_0 (14:ii))
then
RBankSelect mode (14:ii) (30:ii) (16:ii) (18:ii) (20:ii) (22:ii) (14:ii) >>= fun (w__6 :
ii) ->
let (result : ii) = w__6 in
return result
else
let (result : ii) = n in
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result) >>= fun (result : ii) ->
return result
val AArch32_ExceptionClass : Exception -> M (ii * list bitU)
let AArch32_ExceptionClass typ =
ThisInstrLength () >>= fun (w__0 : ii) ->
let (il : bits ty1) = if (eq (ex_int w__0) (32:ii)) then [B1] else [B0] in
let (ec : ii) = undefined_int () in
match typ with
| Exception_Uncategorized ->
let (ec : ii) = (0:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_WFxTrap ->
let (ec : ii) = (1:ii) in
return (ec,il)
| Exception_CP15RTTrap ->
let (ec : ii) = (3:ii) in
return (ec,il)
| Exception_CP15RRTTrap ->
let (ec : ii) = (4:ii) in
return (ec,il)
| Exception_CP14RTTrap ->
let (ec : ii) = (5:ii) in
return (ec,il)
| Exception_CP14DTTrap ->
let (ec : ii) = (6:ii) in
return (ec,il)
| Exception_AdvSIMDFPAccessTrap ->
let (ec : ii) = (7:ii) in
return (ec,il)
| Exception_FPIDTrap ->
let (ec : ii) = (8:ii) in
return (ec,il)
| Exception_CP14RRTTrap ->
let (ec : ii) = (12:ii) in
return (ec,il)
| Exception_IllegalState ->
let (ec : ii) = (14:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_SupervisorCall ->
let (ec : ii) = (17:ii) in
return (ec,il)
| Exception_HypervisorCall ->
let (ec : ii) = (18:ii) in
return (ec,il)
| Exception_MonitorCall ->
let (ec : ii) = (19:ii) in
return (ec,il)
| Exception_InstructionAbort ->
let (ec : ii) = (32:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_PCAlignment ->
let (ec : ii) = (34:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_DataAbort ->
let (ec : ii) = (36:ii) in
return (ec,il)
| Exception_FPTrappedException ->
let (ec : ii) = (40:ii) in
return (ec,il)
| _ ->
Unreachable () >>
return (ec,il)
end >>= fun ((ec : ii), (il : bits ty1)) ->
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
let (ec : ii) =
if (and_bool
(or_bool (eq (ex_int ec) (32:ii)) (eq (ex_int ec) (36:ii)))
(eq_vec w__1.ProcState_EL EL2))
then
let (ec : ii) = integerAdd (ex_int ec) (1:ii) in
ec
else ec in
return (ec,il)
val EncodeLDFSC : Fault -> ii -> M (list bitU)
let EncodeLDFSC typ level =
let (result : bits ty6) = (undefined_vector (6:ii) (undefined_bit ()) : list bitU) in
match typ with
| Fault_AddressSize ->
let result =
(concat_vec ([B0;B0;B0;B0]) (__GetSlice_int (2:ii) level (0:ii) : list bitU) : list bitU) in
assert_exp (or_bool
(eq level (0:ii))
(or_bool (eq level (1:ii)) (or_bool (eq level (2:ii)) (eq level (3:ii))))) "((level == 0) || ((level == 1) || ((level == 2) || (level == 3))))" >>
return result
| Fault_AccessFlag ->
let result =
(concat_vec ([B0;B0;B1;B0]) (__GetSlice_int (2:ii) level (0:ii) : list bitU) : list bitU) in
assert_exp (or_bool (eq level (1:ii)) (or_bool (eq level (2:ii)) (eq level (3:ii)))) "((level == 1) || ((level == 2) || (level == 3)))" >>
return result
| Fault_Permission ->
let result =
(concat_vec ([B0;B0;B1;B1]) (__GetSlice_int (2:ii) level (0:ii) : list bitU) : list bitU) in
assert_exp (or_bool (eq level (1:ii)) (or_bool (eq level (2:ii)) (eq level (3:ii)))) "((level == 1) || ((level == 2) || (level == 3)))" >>
return result
| Fault_Translation ->
let result =
(concat_vec ([B0;B0;B0;B1]) (__GetSlice_int (2:ii) level (0:ii) : list bitU) : list bitU) in
assert_exp (or_bool
(eq level (0:ii))
(or_bool (eq level (1:ii)) (or_bool (eq level (2:ii)) (eq level (3:ii))))) "((level == 0) || ((level == 1) || ((level == 2) || (level == 3))))" >>
return result
| Fault_SyncExternal ->
let (result : bits ty6) = [B0;B1;B0;B0;B0;B0] in
return result
| Fault_SyncExternalOnWalk ->
let result =
(concat_vec ([B0;B1;B0;B1]) (__GetSlice_int (2:ii) level (0:ii) : list bitU) : list bitU) in
assert_exp (or_bool
(eq level (0:ii))
(or_bool (eq level (1:ii)) (or_bool (eq level (2:ii)) (eq level (3:ii))))) "((level == 0) || ((level == 1) || ((level == 2) || (level == 3))))" >>
return result
| Fault_SyncParity ->
let (result : bits ty6) = [B0;B1;B1;B0;B0;B0] in
return result
| Fault_SyncParityOnWalk ->
let result =
(concat_vec ([B0;B1;B1;B1]) (__GetSlice_int (2:ii) level (0:ii) : list bitU) : list bitU) in
assert_exp (or_bool
(eq level (0:ii))
(or_bool (eq level (1:ii)) (or_bool (eq level (2:ii)) (eq level (3:ii))))) "((level == 0) || ((level == 1) || ((level == 2) || (level == 3))))" >>
return result
| Fault_AsyncParity ->
let (result : bits ty6) = [B0;B1;B1;B0;B0;B1] in
return result
| Fault_AsyncExternal ->
let (result : bits ty6) = [B0;B1;B0;B0;B0;B1] in
return result
| Fault_Alignment ->
let (result : bits ty6) = [B1;B0;B0;B0;B0;B1] in
return result
| Fault_Debug ->
let (result : bits ty6) = [B1;B0;B0;B0;B1;B0] in
return result
| Fault_TLBConflict ->
let (result : bits ty6) = [B1;B1;B0;B0;B0;B0] in
return result
| Fault_Lockdown ->
let (result : bits ty6) = [B1;B1;B0;B1;B0;B0] in
return result
| Fault_Exclusive ->
let (result : bits ty6) = [B1;B1;B0;B1;B0;B1] in
return result
| _ ->
Unreachable () >>
return result
end >>= fun (result : bits ty6) ->
return result
val BigEndianReverse : list bitU -> M (list bitU)
let rec BigEndianReverse value_name =
assert_exp (or_bool
(eq (length value_name) (8:ii))
(or_bool
(eq (length value_name) (16:ii))
(or_bool
(eq (length value_name) (32:ii))
(or_bool (eq (length value_name) (64:ii)) (eq (length value_name) (128:ii)))))) "" >>
let half = integerDiv (length value_name) (2:ii) in
assert_exp true "" >>
if (eq (length value_name) (8:ii))
then return value_name
else
(BigEndianReverse (slice value_name (0:ii) half : list bitU) : M (list bitU)) >>= fun (w__0 :
list bitU) ->
(BigEndianReverse (slice value_name half (integerMinus (length value_name) half) : list bitU) : M (list bitU)) >>= fun (w__1 :
list bitU) ->
return (concat_vec w__0 w__1 : list bitU)
val AArch32_ReportHypEntry : ExceptionRecord -> M unit
let AArch32_ReportHypEntry exception =
let (typ : Exception) = exception.ExceptionRecord_typ in
let (il : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
let (ec : ii) = undefined_int () in
(AArch32_ExceptionClass typ : M ((ii * list bitU))) >>= fun (tup__0, tup__1) ->
let ec = tup__0 in
let il = tup__1 in
let (iss : bits ty25) = exception.ExceptionRecord_syndrome in
let (il : bits ty1) =
if (and_bool
(or_bool (eq (ex_int ec) (36:ii)) (eq (ex_int ec) (37:ii)))
(eq_vec ([access_vec_dec iss (24:ii)]) ([B0])))
then
let (il : bits ty1) = [B1] in
il
else il in
write_reg
HSR_ref
(concat_vec (concat_vec (__GetSlice_int (6:ii) ec (0:ii) : list bitU) il : list bitU) iss : list bitU) >>
(if (or_bool (eq typ Exception_InstructionAbort) (eq typ Exception_PCAlignment))
then
write_reg HIFAR_ref (slice exception.ExceptionRecord_vaddress (0:ii) (32:ii) : list bitU) >>
write_reg HDFAR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU)
else
if (eq typ Exception_DataAbort)
then
write_reg HIFAR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HDFAR_ref (slice exception.ExceptionRecord_vaddress (0:ii) (32:ii) : list bitU)
else return ()) >>
if exception.ExceptionRecord_ipavalid
then
(read_reg HPFAR_ref : M (list bitU)) >>= fun (w__0 : list bitU) ->
write_reg
HPFAR_ref
(set_slice
(32:ii)
(28:ii)
w__0
(4:ii)
(slice exception.ExceptionRecord_ipaddress (12:ii) (28:ii) : list bitU) : list bitU)
else
(read_reg HPFAR_ref : M (list bitU)) >>= fun (w__1 : list bitU) ->
write_reg
HPFAR_ref
(set_slice
(32:ii)
(28:ii)
w__1
(4:ii)
(undefined_vector (28:ii) (undefined_bit ()) : list bitU) : list bitU)
val Replicate : integer -> list bitU -> M (list bitU)
let Replicate (N__tv : integer) x =
assert_exp (eq (ex_int (hardware_mod N__tv (length x))) (0:ii)) "((N MOD M) == 0)" >>
let p = ex_int (integerDiv N__tv (length x)) in
assert_exp true "" >>
return (replicate_bits x p : list bitU)
val Zeros__0 : integer -> list bitU
val Zeros__1 : integer -> unit -> list bitU
let Zeros__0 N = (replicate_bits ([B0]) N : list bitU)
let Zeros__1 (N__tv : integer) () = (Zeros__0 N__tv : list bitU)
val ZeroExtend__0 : list bitU -> integer -> M (list bitU)
val ZeroExtend__1 : integer -> list bitU -> M (list bitU)
let ZeroExtend__0 x N =
assert_exp (gteq N (length x)) "" >>
return (concat_vec (Zeros__0 (integerMinus N (length x)) : list bitU) x : list bitU)
let ZeroExtend__1 (N__tv : integer) x = (ZeroExtend__0 x N__tv : M (list bitU))
val aset_SP : list bitU -> M unit
let aset_SP value_name =
assert_exp (or_bool (eq (length value_name) (32:ii)) (eq (length value_name) (64:ii))) "((width == 32) || (width == 64))" >>
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
if (eq_vec w__0.ProcState_SP ([B0]))
then
(ZeroExtend__1 (64:ii) value_name : M (list bitU)) >>= fun (w__1 : bits ty64) ->
write_reg SP_EL0_ref w__1
else
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
let p__287 = w__2.ProcState_EL in
let _pat_ = p__287 in
if (eq_vec _pat_ EL0)
then
(ZeroExtend__1 (64:ii) value_name : M (list bitU)) >>= fun (w__3 : bits ty64) ->
write_reg SP_EL0_ref w__3
else
if (eq_vec _pat_ EL1)
then
(ZeroExtend__1 (64:ii) value_name : M (list bitU)) >>= fun (w__4 : bits ty64) ->
write_reg SP_EL1_ref w__4
else
if (eq_vec _pat_ EL2)
then
(ZeroExtend__1 (64:ii) value_name : M (list bitU)) >>= fun (w__5 : bits ty64) ->
write_reg SP_EL2_ref w__5
else
(ZeroExtend__1 (64:ii) value_name : M (list bitU)) >>= fun (w__6 : bits ty64) ->
write_reg SP_EL3_ref w__6
val LSL_C : list bitU -> ii -> M (list bitU * list bitU)
let LSL_C x shift =
assert_exp (gt shift (0:ii)) "(shift > 0)" >>
let extended_x = (concat_vec x (Zeros__0 shift : list bitU) : list bitU) in
let result = (slice extended_x (0:ii) (length x) : list bitU) in
let (carry_out : bits ty1) = [access_vec_dec extended_x (length result)] in
return (result,carry_out)
val LSL : list bitU -> ii -> M (list bitU)
let LSL x shift =
assert_exp (gteq shift (0:ii)) "(shift >= 0)" >>
let (__anon1 : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
let result = (undefined_vector (length x) (undefined_bit ()) : list bitU) in
(if (eq shift (0:ii))
then
let result = x in
return (__anon1,result)
else
(LSL_C x shift : M ((list bitU * list bitU))) >>= fun (tup__0, tup__1) ->
let result = tup__0 in
let (__anon1 : bits ty1) = tup__1 in
return (__anon1,result)) >>= fun ((__anon1 : bits ty1), result) ->
return result
val LSInstructionSyndrome : unit -> M (list bitU)
let LSInstructionSyndrome () =
assert_exp false "FALSE" >>
return (Zeros__0 (11:ii) : list bitU)
val IsZero : list bitU -> bool
let IsZero x = eq_vec x (Zeros__0 (length x) : list bitU)
val AddWithCarry : list bitU -> list bitU -> list bitU -> (list bitU * list bitU)
let AddWithCarry x y carry_in =
let (unsigned_sum : ii) = integerAdd (integerAdd (uint x) (uint y)) (uint carry_in) in
let (signed_sum : ii) = integerAdd (integerAdd (sint x) (sint y)) (uint carry_in) in
let result = (__GetSlice_int (length x) unsigned_sum (0:ii) : list bitU) in
let (n : bits ty1) = [access_vec_dec result (integerMinus (length result) (1:ii))] in
let (z : bits ty1) = if (IsZero result) then [B1] else [B0] in
let (c : bits ty1) = if (eq (uint result) (ex_int unsigned_sum)) then [B0] else [B1] in
let (v : bits ty1) = if (eq (sint result) (ex_int signed_sum)) then [B0] else [B1] in
(result,(concat_vec (concat_vec (concat_vec n z : list bitU) c : list bitU) v : list bitU))
val GetPSRFromPSTATE : unit -> M (list bitU)
let GetPSRFromPSTATE () =
let (spsr : bits ty32) = (Zeros__1 (32:ii) () : list bitU) in
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (31:ii) (31:ii) w__0.ProcState_N : list bitU) in
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (30:ii) (30:ii) w__1.ProcState_Z : list bitU) in
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (29:ii) (29:ii) w__2.ProcState_C : list bitU) in
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (28:ii) (28:ii) w__3.ProcState_V : list bitU) in
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (21:ii) (21:ii) w__4.ProcState_SS : list bitU) in
read_reg PSTATE_ref >>= fun (w__5 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (20:ii) (20:ii) w__5.ProcState_IL : list bitU) in
read_reg PSTATE_ref >>= fun (w__6 : ProcState) ->
(if (eq_vec w__6.ProcState_nRW ([B1]))
then
read_reg PSTATE_ref >>= fun (w__7 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (27:ii) (27:ii) w__7.ProcState_Q : list bitU) in
read_reg PSTATE_ref >>= fun (w__8 : ProcState) ->
let spsr =
(update_subrange_vec_dec
spsr
(26:ii)
(25:ii)
(subrange_vec_dec w__8.ProcState_IT (1:ii) (0:ii) : list bitU) : list bitU) in
read_reg PSTATE_ref >>= fun (w__9 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (19:ii) (16:ii) w__9.ProcState_GE : list bitU) in
read_reg PSTATE_ref >>= fun (w__10 : ProcState) ->
let spsr =
(update_subrange_vec_dec
spsr
(15:ii)
(10:ii)
(subrange_vec_dec w__10.ProcState_IT (7:ii) (2:ii) : list bitU) : list bitU) in
read_reg PSTATE_ref >>= fun (w__11 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (9:ii) (9:ii) w__11.ProcState_E : list bitU) in
read_reg PSTATE_ref >>= fun (w__12 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (8:ii) (8:ii) w__12.ProcState_A : list bitU) in
read_reg PSTATE_ref >>= fun (w__13 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (7:ii) (7:ii) w__13.ProcState_I : list bitU) in
read_reg PSTATE_ref >>= fun (w__14 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (6:ii) (6:ii) w__14.ProcState_F : list bitU) in
read_reg PSTATE_ref >>= fun (w__15 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (5:ii) (5:ii) w__15.ProcState_T : list bitU) in
read_reg PSTATE_ref >>= fun (w__16 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__17 : ProcState) ->
assert_exp (eq_vec ([access_vec_dec w__16.ProcState_M (4:ii)]) w__17.ProcState_nRW) "(((PSTATE).M)<4> == (PSTATE).nRW)" >>
read_reg PSTATE_ref >>= fun (w__18 : ProcState) ->
let (spsr : bits ty32) =
(update_subrange_vec_dec spsr (4:ii) (0:ii) w__18.ProcState_M : list bitU) in
return spsr
else
read_reg PSTATE_ref >>= fun (w__19 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (9:ii) (9:ii) w__19.ProcState_D : list bitU) in
read_reg PSTATE_ref >>= fun (w__20 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (8:ii) (8:ii) w__20.ProcState_A : list bitU) in
read_reg PSTATE_ref >>= fun (w__21 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (7:ii) (7:ii) w__21.ProcState_I : list bitU) in
read_reg PSTATE_ref >>= fun (w__22 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (6:ii) (6:ii) w__22.ProcState_F : list bitU) in
read_reg PSTATE_ref >>= fun (w__23 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (4:ii) (4:ii) w__23.ProcState_nRW : list bitU) in
read_reg PSTATE_ref >>= fun (w__24 : ProcState) ->
let spsr = (update_subrange_vec_dec spsr (3:ii) (2:ii) w__24.ProcState_EL : list bitU) in
read_reg PSTATE_ref >>= fun (w__25 : ProcState) ->
let (spsr : bits ty32) =
(update_subrange_vec_dec spsr (0:ii) (0:ii) w__25.ProcState_SP : list bitU) in
return spsr) >>= fun (spsr : bits ty32) ->
return spsr
val ExceptionSyndrome : Exception -> ExceptionRecord
let ExceptionSyndrome typ =
let (r : ExceptionRecord) = undefined_ExceptionRecord () in
let (r : ExceptionRecord) = <|r with ExceptionRecord_typ = typ|> in
let (r : ExceptionRecord) =
<|r with ExceptionRecord_syndrome = (Zeros__1 (25:ii) () : list bitU)|> in
let (r : ExceptionRecord) =
<|r with ExceptionRecord_vaddress = (Zeros__1 (64:ii) () : list bitU)|> in
let (r : ExceptionRecord) = <|r with ExceptionRecord_ipavalid = false|> in
let (r : ExceptionRecord) =
<|r with ExceptionRecord_ipaddress = (Zeros__1 (52:ii) () : list bitU)|> in
r
val SignExtend__0 : list bitU -> integer -> M (list bitU)
val SignExtend__1 : integer -> list bitU -> M (list bitU)
let SignExtend__0 x N =
assert_exp (gteq N (length x)) "" >>
return (concat_vec
(replicate_bits
([access_vec_dec x (integerMinus (length x) (1:ii))])
(integerMinus N (length x)) : list bitU)
x : list bitU)
let SignExtend__1 (N__tv : integer) x = (SignExtend__0 x N__tv : M (list bitU))
val Ones__0 : integer -> list bitU
val Ones__1 : integer -> unit -> list bitU
let Ones__0 N = (replicate_bits ([B1]) N : list bitU)
let Ones__1 (N__tv : integer) () = (Ones__0 N__tv : list bitU)
val ExcVectorBase : unit -> M (list bitU)
let ExcVectorBase () =
(read_reg SCTLR_ref : M (list bitU)) >>= fun (w__0 : bits ty32) ->
if (eq_vec ([access_vec_dec w__0 (13:ii)]) ([B1]))
then return (concat_vec (Ones__0 (16:ii) : list bitU) (Zeros__0 (16:ii) : list bitU) : list bitU)
else
(read_reg VBAR_ref : M (list bitU)) >>= fun (w__1 : bits ty32) ->
return (concat_vec (slice w__1 (5:ii) (27:ii) : list bitU) (Zeros__0 (5:ii) : list bitU) : list bitU)
val Align__0 : ii -> ii -> ii
val Align__1 : list bitU -> ii -> list bitU
let Align__0 x y = integerDiv (integerMult y x) y
let Align__1 x y = (__GetSlice_int (length x) (Align__0 (uint x) y) (0:ii) : list bitU)
val aset__Mem : AddressDescriptor -> integer -> AccessDescriptor -> list bitU -> M unit
let aset__Mem desc size accdesc value_name =
assert_exp (or_bool
(eq size (1:ii))
(or_bool
(eq size (2:ii))
(or_bool (eq size (4:ii)) (or_bool (eq size (8:ii)) (eq size (16:ii)))))) "((size == 1) || ((size == 2) || ((size == 4) || ((size == 8) || (size == 16)))))" >>
let (address : bits ty52) = desc.AddressDescriptor_paddress.FullAddress_physicaladdress in
assert_exp (eq_vec address (Align__1 address size : list bitU)) "(address == Align(address, size))" >>
if (eq_vec address (hex_slice "0x13000000" (52:ii) (0:ii) : list bitU))
then
if (eq (uint value_name) (4:ii))
then
let (_ : unit) = prerr_endline "Program exited by writing ^D to TUBE
" in
exit ()
else return (putchar (uint (slice value_name (0:ii) (8:ii) : list bitU)))
else
(read_reg __Memory_ref : M (list bitU)) >>= fun (w__0 : list bitU) ->
write_ram (52:ii) size w__0 address value_name
val aget__Mem : AddressDescriptor -> integer -> AccessDescriptor -> M (list bitU)
let aget__Mem desc size accdesc =
assert_exp (or_bool
(eq size (1:ii))
(or_bool
(eq size (2:ii))
(or_bool (eq size (4:ii)) (or_bool (eq size (8:ii)) (eq size (16:ii)))))) "((size == 1) || ((size == 2) || ((size == 4) || ((size == 8) || (size == 16)))))" >>
let (address : bits ty52) = desc.AddressDescriptor_paddress.FullAddress_physicaladdress in
assert_exp (eq_vec address (Align__1 address size : list bitU)) "(address == Align(address, size))" >>
(read_reg __Memory_ref : M (list bitU)) >>= fun (w__0 : list bitU) ->
(read_ram (52:ii) size w__0 address : M (list bitU))
val aset_X : ii -> list bitU -> M unit
let aset_X n value_name =
assert_exp (and_bool (gteq (ex_int n) (0:ii)) (lteq (ex_int n) (31:ii))) "((n >= 0) && (n <= 31))" >>
assert_exp (or_bool (eq (length value_name) (32:ii)) (eq (length value_name) (64:ii))) "((width == 32) || (width == 64))" >>
if (neq (ex_int n) (31:ii))
then
read_reg _R_ref >>= fun (w__0 : list (list bitU)) ->
(ZeroExtend__0 value_name (64:ii) : M (list bitU)) >>= fun (w__1 : list bitU) ->
write_reg _R_ref (update_list_dec w__0 n w__1 : list (list bitU))
else return ()
val aset_ELR__0 : list bitU -> list bitU -> M unit
val aset_ELR__1 : list bitU -> M unit
let aset_ELR__0 el value_name =
let (r : bits ty64) = value_name in
let _pat_ = el in
if (eq_vec _pat_ EL1)
then write_reg ELR_EL1_ref r
else
if (eq_vec _pat_ EL2)
then write_reg ELR_EL2_ref r
else if (eq_vec _pat_ EL3) then write_reg ELR_EL3_ref r else Unreachable ()
let aset_ELR__1 value_name =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
assert_exp (neq_vec w__0.ProcState_EL EL0) "" >>
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
aset_ELR__0 w__1.ProcState_EL value_name
val aget_X : integer -> ii -> M (list bitU)
let aget_X (width__tv : integer) n =
assert_exp (and_bool (gteq n (0:ii)) (lteq n (31:ii))) "((n >= 0) && (n <= 31))" >>
assert_exp (or_bool
(eq width__tv (8:ii))
(or_bool
(eq width__tv (16:ii))
(or_bool (eq width__tv (32:ii)) (eq width__tv (64:ii))))) "((width == 8) || ((width == 16) || ((width == 32) || (width == 64))))" >>
if (neq n (31:ii))
then
read_reg _R_ref >>= fun (w__0 : list (bits ty64)) ->
return (slice (access_list_dec w__0 n : list bitU) (0:ii) width__tv : list bitU)
else return (Zeros__0 width__tv : list bitU)
val Prefetch : list bitU -> list bitU -> unit
let Prefetch address prfop =
let (hint : PrefetchHint) = undefined_PrefetchHint () in
let (target : ii) = undefined_int () in
let (stream : bool) = undefined_bool () in
let b__0 = (slice prfop (3:ii) (2:ii) : list bitU) in
let (hint : PrefetchHint) =
if (eq_vec b__0 ([B0;B0]))
then
let (hint : PrefetchHint) = Prefetch_READ in
hint
else
let (hint : PrefetchHint) =
if (eq_vec b__0 ([B0;B1]))
then
let (hint : PrefetchHint) = Prefetch_EXEC in
hint
else
let (hint : PrefetchHint) =
if (eq_vec b__0 ([B1;B0]))
then
let (hint : PrefetchHint) = Prefetch_WRITE in
hint
else hint in
hint in
hint in
let (target : ii) = uint (slice prfop (1:ii) (2:ii) : list bitU) in
let (stream : bool) = neq_vec ([access_vec_dec prfop (0:ii)]) ([B0]) in
let (_ : unit) = Hint_Prefetch address hint target stream in
()
val IsSecondStage : FaultRecord -> M bool
let IsSecondStage fault =
assert_exp (neq fault.FaultRecord_typ Fault_None) "((fault).type != Fault_None)" >>
return fault.FaultRecord_secondstage
val IsFault : AddressDescriptor -> bool
let IsFault addrdesc = neq addrdesc.AddressDescriptor_fault.FaultRecord_typ Fault_None
val IsExternalSyncAbort__0 : Fault -> M bool
val IsExternalSyncAbort__1 : FaultRecord -> M bool
let IsExternalSyncAbort__0 typ =
assert_exp (neq typ Fault_None) "" >>
return (or_bool
(eq typ Fault_SyncExternal)
(or_bool
(eq typ Fault_SyncParity)
(or_bool (eq typ Fault_SyncExternalOnWalk) (eq typ Fault_SyncParityOnWalk))))
let IsExternalSyncAbort__1 fault = IsExternalSyncAbort__0 fault.FaultRecord_typ
val IsExternalAbort__0 : Fault -> M bool
val IsExternalAbort__1 : FaultRecord -> M bool
let IsExternalAbort__0 typ =
assert_exp (neq typ Fault_None) "" >>
return (or_bool
(eq typ Fault_SyncExternal)
(or_bool
(eq typ Fault_SyncParity)
(or_bool
(eq typ Fault_SyncExternalOnWalk)
(or_bool
(eq typ Fault_SyncParityOnWalk)
(or_bool (eq typ Fault_AsyncExternal) (eq typ Fault_AsyncParity))))))
let IsExternalAbort__1 fault = IsExternalAbort__0 fault.FaultRecord_typ
val IsDebugException : FaultRecord -> M bool
let IsDebugException fault =
assert_exp (neq fault.FaultRecord_typ Fault_None) "((fault).type != Fault_None)" >>
return (eq fault.FaultRecord_typ Fault_Debug)
val IPAValid : FaultRecord -> M bool
let IPAValid fault =
assert_exp (neq fault.FaultRecord_typ Fault_None) "((fault).type != Fault_None)" >>
return (if fault.FaultRecord_s2fs1walk
then
or_bool
(eq fault.FaultRecord_typ Fault_AccessFlag)
(or_bool
(eq fault.FaultRecord_typ Fault_Permission)
(or_bool
(eq fault.FaultRecord_typ Fault_Translation)
(eq fault.FaultRecord_typ Fault_AddressSize)))
else
if fault.FaultRecord_secondstage
then
or_bool
(eq fault.FaultRecord_typ Fault_AccessFlag)
(or_bool
(eq fault.FaultRecord_typ Fault_Translation)
(eq fault.FaultRecord_typ Fault_AddressSize))
else false)
val aarch64_integer_arithmetic_addsub_immediate : ii -> integer -> list bitU -> ii -> bool -> bool -> M unit
let aarch64_integer_arithmetic_addsub_immediate d datasize imm n setflags sub_op =
let dbytes = ex_int (integerDiv datasize (8:ii)) in
assert_exp true "datasize constraint" >>
assert_exp true "dbytes constraint" >>
let result = (undefined_vector datasize (undefined_bit ()) : list bitU) in
(if (eq n (31:ii))
then (aget_SP datasize () : M (list bitU))
else (aget_X datasize n : M (list bitU))) >>= fun operand1 ->
let operand2 = imm in
let (nzcv : bits ty4) = (undefined_vector (4:ii) (undefined_bit ()) : list bitU) in
let (carry_in : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
let ((carry_in : bits ty1), operand2) =
if sub_op
then
let operand2 = (not_vec operand2 : list bitU) in
let (carry_in : bits ty1) = [B1] in
(carry_in,operand2)
else
let (carry_in : bits ty1) = [B0] in
(carry_in,operand2) in
let (tup__0, tup__1) = (AddWithCarry operand1 operand2 carry_in : (list bitU * list bitU)) in
let result = tup__0 in
let nzcv = tup__1 in
(if setflags
then
let (tup__0, tup__1, tup__2, tup__3) =
((subrange_vec_dec nzcv (3:ii) (3:ii) : list bitU),(subrange_vec_dec nzcv (2:ii) (2:ii) : list bitU),(subrange_vec_dec
nzcv
(1:ii)
(1:ii) : list bitU),(subrange_vec_dec
nzcv
(0:ii)
(0:ii) : list bitU)) in
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
write_reg PSTATE_ref <|w__2 with ProcState_N = tup__0|> >>
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
write_reg PSTATE_ref <|w__3 with ProcState_Z = tup__1|> >>
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
write_reg PSTATE_ref <|w__4 with ProcState_C = tup__2|> >>
read_reg PSTATE_ref >>= fun (w__5 : ProcState) ->
write_reg PSTATE_ref <|w__5 with ProcState_V = tup__3|>
else return ()) >>
if (and_bool (eq d (31:ii)) (not setflags))
then aset_SP result
else aset_X d result
val HighestELUsingAArch32 : unit -> bool
let HighestELUsingAArch32 () = if (not (HaveAnyAArch32 ())) then false else false
val aget_SCR_GEN : unit -> M (list bitU)
let aget_SCR_GEN () =
assert_exp (HaveEL EL3) "HaveEL(EL3)" >>
let (r : bits ty32) = (undefined_vector (32:ii) (undefined_bit ()) : list bitU) in
(if (HighestELUsingAArch32 ())
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__0 : bits ty32) ->
let (r : bits ty32) = w__0 in
return r
else
(read_reg SCR_EL3_ref : M (list bitU)) >>= fun (w__1 : bits ty32) ->
let (r : bits ty32) = w__1 in
return r) >>= fun (r : bits ty32) ->
return r
val IsSecureBelowEL3 : unit -> M bool
let IsSecureBelowEL3 () =
if (HaveEL EL3)
then
(aget_SCR_GEN () : M (list bitU)) >>= fun (w__0 : list bitU) ->
return (eq_vec ([access_vec_dec w__0 (0:ii)]) ([B0]))
else return (if (HaveEL EL2) then false else false)
val UsingAArch32 : unit -> M bool
let UsingAArch32 () =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
let (aarch32 : bool) = eq_vec w__0.ProcState_nRW ([B1]) in
(if (not (HaveAnyAArch32 ()))
then assert_exp (not aarch32) "!(aarch32)"
else return ()) >>
(if (HighestELUsingAArch32 ())
then assert_exp aarch32 "aarch32"
else return ()) >>
return aarch32
val aset_SPSR : list bitU -> M unit
let aset_SPSR value_name =
UsingAArch32 () >>= fun (w__0 : bool) ->
if w__0
then
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
let p__286 = w__1.ProcState_M in
let _pat_ = p__286 in
if (eq_vec _pat_ M32_FIQ)
then write_reg SPSR_fiq_ref value_name
else
if (eq_vec _pat_ M32_IRQ)
then write_reg SPSR_irq_ref value_name
else
if (eq_vec _pat_ M32_Svc)
then write_reg SPSR_svc_ref value_name
else
if (eq_vec _pat_ M32_Monitor)
then write_reg SPSR_mon_ref value_name
else
if (eq_vec _pat_ M32_Abort)
then write_reg SPSR_abt_ref value_name
else
if (eq_vec _pat_ M32_Hyp)
then write_reg SPSR_hyp_ref value_name
else
if (eq_vec _pat_ M32_Undef)
then write_reg SPSR_und_ref value_name
else Unreachable ()
else
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
let p__285 = w__2.ProcState_EL in
let _pat_ = p__285 in
if (eq_vec _pat_ EL1)
then write_reg SPSR_EL1_ref value_name
else
if (eq_vec _pat_ EL2)
then write_reg SPSR_EL2_ref value_name
else if (eq_vec _pat_ EL3) then write_reg SPSR_EL3_ref value_name else Unreachable ()
val IsSecure : unit -> M bool
let IsSecure () =
UsingAArch32 () >>= fun (w__0 : bool) ->
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
if (and_bool (and_bool (HaveEL EL3) (not w__0)) (eq_vec w__1.ProcState_EL EL3))
then return true
else
UsingAArch32 () >>= fun (w__2 : bool) ->
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
if (and_bool (and_bool (HaveEL EL3) w__2) (eq_vec w__3.ProcState_M M32_Monitor))
then return true
else IsSecureBelowEL3 ()
val CurrentInstrSet : unit -> M InstrSet
let CurrentInstrSet () =
let (result : InstrSet) = undefined_InstrSet () in
UsingAArch32 () >>= fun (w__0 : bool) ->
(if w__0
then
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
let (result : InstrSet) =
if (eq_vec w__1.ProcState_T ([B0]))
then InstrSet_A32
else InstrSet_T32 in
return result
else
let (result : InstrSet) = InstrSet_A64 in
return result) >>= fun (result : InstrSet) ->
return result
val AArch32_ExecutingCP10or11Instr : unit -> M bool
let AArch32_ExecutingCP10or11Instr () =
(ThisInstr () : M (list bitU)) >>= fun (instr : bits ty32) ->
CurrentInstrSet () >>= fun (instr_set : InstrSet) ->
assert_exp (or_bool (eq instr_set InstrSet_A32) (eq instr_set InstrSet_T32)) "((instr_set == InstrSet_A32) || (instr_set == InstrSet_T32))" >>
return (if (eq instr_set InstrSet_A32)
then
and_bool
(or_bool
(eq_vec (slice instr (24:ii) (4:ii) : list bitU) ([B1;B1;B1;B0]))
(eq_vec (slice instr (25:ii) (3:ii) : list bitU) ([B1;B1;B0])))
(eq_vec
(and_vec (slice instr (8:ii) (4:ii) : list bitU) ([B1;B1;B1;B0]) : list bitU)
([B1;B0;B1;B0]))
else
and_bool
(and_bool
(eq_vec
(and_vec (slice instr (28:ii) (4:ii) : list bitU) ([B1;B1;B1;B0]) : list bitU)
([B1;B1;B1;B0]))
(or_bool
(eq_vec (slice instr (24:ii) (4:ii) : list bitU) ([B1;B1;B1;B0]))
(eq_vec (slice instr (25:ii) (3:ii) : list bitU) ([B1;B1;B0]))))
(eq_vec
(and_vec (slice instr (8:ii) (4:ii) : list bitU) ([B1;B1;B1;B0]) : list bitU)
([B1;B0;B1;B0])))
val HaveAArch32EL : list bitU -> bool
let HaveAArch32EL el =
if (not (HaveEL el))
then false
else
if (not (HaveAnyAArch32 ()))
then false
else
if (HighestELUsingAArch32 ())
then true
else
if (eq_vec el (HighestEL () : list bitU))
then false
else if (eq_vec el EL0) then true else true
val ELStateUsingAArch32K : list bitU -> bool -> M (bool * bool)
let ELStateUsingAArch32K el secure =
let (aarch32 : bool) = undefined_bool () in
let (known : bool) = true in
let (aarch32_at_el1 : bool) = undefined_bool () in
let (aarch32_below_el3 : bool) = undefined_bool () in
(if (not (HaveAArch32EL el))
then
let (aarch32 : bool) = false in
return (aarch32,aarch32_at_el1,aarch32_below_el3,known)
else
(if (HighestELUsingAArch32 ())
then
let (aarch32 : bool) = true in
return (aarch32,aarch32_at_el1,aarch32_below_el3,known)
else
(read_reg SCR_EL3_ref : M (list bitU)) >>= fun (w__0 : bits ty32) ->
let aarch32_below_el3 =
and_bool (HaveEL EL3) (eq_vec ([access_vec_dec w__0 (10:ii)]) ([B0])) in
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__1 : bits ty64) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__2 : bits ty64) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__3 : bits ty64) ->
let aarch32_at_el1 =
or_bool
aarch32_below_el3
(and_bool
(and_bool
(and_bool (HaveEL EL2) (not secure))
(eq_vec ([access_vec_dec w__1 (31:ii)]) ([B0])))
(not
(and_bool
(and_bool
(eq_vec ([access_vec_dec w__2 (34:ii)]) ([B1]))
(eq_vec ([access_vec_dec w__3 (27:ii)]) ([B1])))
(HaveVirtHostExt ())))) in
(if (and_bool (eq_vec el EL0) (not aarch32_at_el1))
then
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
(if (eq_vec w__4.ProcState_EL EL0)
then
read_reg PSTATE_ref >>= fun (w__5 : ProcState) ->
let (aarch32 : bool) = eq_vec w__5.ProcState_nRW ([B1]) in
return (aarch32,known)
else
let (known : bool) = false in
return (aarch32,known)) >>= fun ((aarch32 : bool), (known : bool)) ->
return (aarch32,known)
else
let (aarch32 : bool) =
or_bool
(and_bool aarch32_below_el3 (neq_vec el EL3))
(and_bool aarch32_at_el1 (or_bool (eq_vec el EL1) (eq_vec el EL0))) in
return (aarch32,known)) >>= fun ((aarch32 : bool), (known : bool)) ->
return (aarch32,aarch32_at_el1,aarch32_below_el3,known)) >>= fun ((aarch32 : bool), (aarch32_at_el1 :
bool), (aarch32_below_el3 : bool), (known : bool)) ->
return (aarch32,aarch32_at_el1,aarch32_below_el3,known)) >>= fun ((aarch32 : bool), (aarch32_at_el1 :
bool), (aarch32_below_el3 : bool), (known : bool)) ->
let (aarch32 : bool) =
if (not known)
then
let (aarch32 : bool) = undefined_bool () in
aarch32
else aarch32 in
return (known,aarch32)
val ELStateUsingAArch32 : list bitU -> bool -> M bool
let ELStateUsingAArch32 el secure =
let (aarch32 : bool) = undefined_bool () in
let (known : bool) = undefined_bool () in
ELStateUsingAArch32K el secure >>= fun (tup__0, tup__1) ->
let known = tup__0 in
let aarch32 = tup__1 in
assert_exp known "known" >>
return aarch32
val ELUsingAArch32 : list bitU -> M bool
let ELUsingAArch32 el =
IsSecureBelowEL3 () >>= fun (w__0 : bool) ->
ELStateUsingAArch32 el w__0
val ELIsInHost : list bitU -> M bool
let ELIsInHost el =
IsSecureBelowEL3 () >>= fun (w__0 : bool) ->
ELUsingAArch32 EL2 >>= fun (w__1 : bool) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__2 : bits ty64) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__3 : bits ty64) ->
return (and_bool
(and_bool
(and_bool (and_bool (not w__0) (HaveVirtHostExt ())) (not w__1))
(eq_vec ([access_vec_dec w__2 (34:ii)]) ([B1])))
(or_bool
(eq_vec el EL2)
(and_bool (eq_vec el EL0) (eq_vec ([access_vec_dec w__3 (27:ii)]) ([B1])))))
val S1TranslationRegime__0 : list bitU -> M (list bitU)
val S1TranslationRegime__1 : unit -> M (list bitU)
let S1TranslationRegime__0 el =
if (neq_vec el EL0)
then return el
else
ELUsingAArch32 EL3 >>= fun (w__0 : bool) ->
(read_reg SCR_ref : M (list bitU)) >>= fun (w__1 : bits ty32) ->
if (and_bool (and_bool (HaveEL EL3) w__0) (eq_vec ([access_vec_dec w__1 (0:ii)]) ([B0])))
then return EL3
else
ELIsInHost el >>= fun (w__2 : bool) ->
return (if (and_bool (HaveVirtHostExt ()) w__2)
then EL2
else EL1)
let S1TranslationRegime__1 () =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
(S1TranslationRegime__0 w__0.ProcState_EL : M (list bitU))
val aset_FAR__0 : list bitU -> list bitU -> M unit
val aset_FAR__1 : list bitU -> M unit
let aset_FAR__0 regime value_name =
let (r : bits ty64) = value_name in
let _pat_ = regime in
if (eq_vec _pat_ EL1)
then write_reg FAR_EL1_ref r
else
if (eq_vec _pat_ EL2)
then write_reg FAR_EL2_ref r
else if (eq_vec _pat_ EL3) then write_reg FAR_EL3_ref r else Unreachable ()
let aset_FAR__1 value_name =
(S1TranslationRegime__1 () : M (list bitU)) >>= fun (w__0 : list bitU) ->
aset_FAR__0 w__0 value_name
val aset_ESR__0 : list bitU -> list bitU -> M unit
val aset_ESR__1 : list bitU -> M unit
let aset_ESR__0 regime value_name =
let (r : bits ty32) = value_name in
let _pat_ = regime in
if (eq_vec _pat_ EL1)
then write_reg ESR_EL1_ref r
else
if (eq_vec _pat_ EL2)
then write_reg ESR_EL2_ref r
else if (eq_vec _pat_ EL3) then write_reg ESR_EL3_ref r else Unreachable ()
let aset_ESR__1 value_name =
(S1TranslationRegime__1 () : M (list bitU)) >>= fun (w__0 : list bitU) ->
aset_ESR__0 w__0 value_name
val aget_VBAR__0 : list bitU -> M (list bitU)
val aget_VBAR__1 : unit -> M (list bitU)
let aget_VBAR__0 regime =
let (r : bits ty64) = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) in
let _pat_ = regime in
(if (eq_vec _pat_ EL1)
then
(read_reg VBAR_EL1_ref : M (list bitU)) >>= fun (w__0 : bits ty64) ->
let (r : bits ty64) = w__0 in
return r
else
(if (eq_vec _pat_ EL2)
then
(read_reg VBAR_EL2_ref : M (list bitU)) >>= fun (w__1 : bits ty64) ->
let (r : bits ty64) = w__1 in
return r
else
(if (eq_vec _pat_ EL3)
then
(read_reg VBAR_EL3_ref : M (list bitU)) >>= fun (w__2 : bits ty64) ->
let (r : bits ty64) = w__2 in
return r
else
Unreachable () >>
return r) >>= fun (r : bits ty64) ->
return r) >>= fun (r : bits ty64) ->
return r) >>= fun (r : bits ty64) ->
return r
let aget_VBAR__1 () =
(S1TranslationRegime__1 () : M (list bitU)) >>= fun (w__0 : list bitU) ->
(aget_VBAR__0 w__0 : M (list bitU))
val aget_SCTLR__0 : list bitU -> M (list bitU)
val aget_SCTLR__1 : unit -> M (list bitU)
let aget_SCTLR__0 regime =
let (r : bits ty32) = (undefined_vector (32:ii) (undefined_bit ()) : list bitU) in
let _pat_ = regime in
(if (eq_vec _pat_ EL1)
then
(read_reg SCTLR_EL1_ref : M (list bitU)) >>= fun (w__0 : bits ty32) ->
let (r : bits ty32) = w__0 in
return r
else
(if (eq_vec _pat_ EL2)
then
(read_reg SCTLR_EL2_ref : M (list bitU)) >>= fun (w__1 : bits ty32) ->
let (r : bits ty32) = w__1 in
return r
else
(if (eq_vec _pat_ EL3)
then
(read_reg SCTLR_EL3_ref : M (list bitU)) >>= fun (w__2 : bits ty32) ->
let (r : bits ty32) = w__2 in
return r
else
Unreachable () >>
return r) >>= fun (r : bits ty32) ->
return r) >>= fun (r : bits ty32) ->
return r) >>= fun (r : bits ty32) ->
return r
let aget_SCTLR__1 () =
(S1TranslationRegime__1 () : M (list bitU)) >>= fun (w__0 : list bitU) ->
(aget_SCTLR__0 w__0 : M (list bitU))
val BigEndian : unit -> M bool
let BigEndian () =
let (bigend : bool) = undefined_bool () in
UsingAArch32 () >>= fun (w__0 : bool) ->
(if w__0
then
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
let (bigend : bool) = neq_vec w__1.ProcState_E ([B0]) in
return bigend
else
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
(if (eq_vec w__2.ProcState_EL EL0)
then
(aget_SCTLR__1 () : M (list bitU)) >>= fun (w__3 : list bitU) ->
let (bigend : bool) = neq_vec ([access_vec_dec w__3 (24:ii)]) ([B0]) in
return bigend
else
(aget_SCTLR__1 () : M (list bitU)) >>= fun (w__4 : list bitU) ->
let (bigend : bool) = neq_vec ([access_vec_dec w__4 (25:ii)]) ([B0]) in
return bigend) >>= fun (bigend : bool) ->
return bigend) >>= fun (bigend : bool) ->
return bigend
val IsInHost : unit -> M bool
let IsInHost () =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
ELIsInHost w__0.ProcState_EL
val BadMode : list bitU -> bool
let BadMode mode =
let (valid_name : bool) = undefined_bool () in
let _pat_ = mode in
let (valid_name : bool) =
if (eq_vec _pat_ M32_Monitor)
then
let (valid_name : bool) = HaveAArch32EL EL3 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_Hyp)
then
let (valid_name : bool) = HaveAArch32EL EL2 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_FIQ)
then
let (valid_name : bool) = HaveAArch32EL EL1 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_IRQ)
then
let (valid_name : bool) = HaveAArch32EL EL1 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_Svc)
then
let (valid_name : bool) = HaveAArch32EL EL1 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_Abort)
then
let (valid_name : bool) = HaveAArch32EL EL1 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_Undef)
then
let (valid_name : bool) = HaveAArch32EL EL1 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_System)
then
let (valid_name : bool) = HaveAArch32EL EL1 in
valid_name
else
let (valid_name : bool) =
if (eq_vec _pat_ M32_User)
then
let (valid_name : bool) = HaveAArch32EL EL0 in
valid_name
else
let (valid_name : bool) = false in
valid_name in
valid_name in
valid_name in
valid_name in
valid_name in
valid_name in
valid_name in
valid_name in
valid_name in
not valid_name
val aset_Rmode : ii -> list bitU -> list bitU -> M unit
let aset_Rmode n mode value_name =
assert_exp (and_bool (gteq (ex_int n) (0:ii)) (lteq (ex_int n) (14:ii))) "((n >= 0) && (n <= 14))" >>
IsSecure () >>= fun (w__0 : bool) ->
(if (not w__0)
then assert_exp (neq_vec mode M32_Monitor) "(mode != M32_Monitor)"
else return ()) >>
assert_exp (not (BadMode mode)) "!(BadMode(mode))" >>
if (eq_vec mode M32_Monitor)
then
if (eq (ex_int n) (13:ii))
then write_reg SP_mon_ref value_name
else
if (eq (ex_int n) (14:ii))
then write_reg LR_mon_ref value_name
else
read_reg _R_ref >>= fun (w__1 : list (bits ty64)) ->
let (__tmp_1 : bits ty64) = (access_list_dec w__1 n : list bitU) in
let __tmp_1 = (update_subrange_vec_dec __tmp_1 (31:ii) (0:ii) value_name : list bitU) in
read_reg _R_ref >>= fun (w__2 : list (list bitU)) ->
write_reg _R_ref (update_list_dec w__2 n __tmp_1 : list (list bitU))
else
ConstrainUnpredictableBool Unpredictable_ZEROUPPER >>= fun (w__3 : bool) ->
if (and_bool (not (HighestELUsingAArch32 ())) w__3)
then
read_reg _R_ref >>= fun (w__4 : list (list bitU)) ->
LookUpRIndex n mode >>= fun (w__5 : ii) ->
(ZeroExtend__0 value_name (64:ii) : M (list bitU)) >>= fun (w__6 : list bitU) ->
write_reg _R_ref (update_list_dec w__4 w__5 w__6 : list (list bitU))
else
read_reg _R_ref >>= fun (w__7 : list (bits ty64)) ->
LookUpRIndex n mode >>= fun (w__8 : ii) ->
let (__tmp_2 : bits ty64) = (access_list_dec w__7 w__8 : list bitU) in
let __tmp_2 = (update_subrange_vec_dec __tmp_2 (31:ii) (0:ii) value_name : list bitU) in
read_reg _R_ref >>= fun (w__9 : list (list bitU)) ->
LookUpRIndex n mode >>= fun (w__10 : ii) ->
write_reg _R_ref (update_list_dec w__9 w__10 __tmp_2 : list (list bitU))
val aset_R : ii -> list bitU -> M unit
let aset_R n value_name =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
aset_Rmode n w__0.ProcState_M value_name
val ELFromM32 : list bitU -> M (bool * list bitU)
let ELFromM32 mode =
let (el : bits ty2) = (undefined_vector (2:ii) (undefined_bit ()) : list bitU) in
let (valid_name : bool) = not (BadMode mode) in
let _pat_ = mode in
(if (eq_vec _pat_ M32_Monitor)
then
let (el : bits ty2) = EL3 in
return (el,valid_name)
else
(if (eq_vec _pat_ M32_Hyp)
then
let el = EL2 in
(aget_SCR_GEN () : M (list bitU)) >>= fun (w__0 : list bitU) ->
let (valid_name : bool) =
and_bool
valid_name
(or_bool (not (HaveEL EL3)) (eq_vec ([access_vec_dec w__0 (0:ii)]) ([B1]))) in
return (el,valid_name)
else
(if (eq_vec _pat_ M32_FIQ)
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__1 : bits ty32) ->
let (el : bits ty2) =
if (and_bool
(and_bool (HaveEL EL3) (HighestELUsingAArch32 ()))
(eq_vec ([access_vec_dec w__1 (0:ii)]) ([B0])))
then EL3
else EL1 in
return (el,valid_name)
else
(if (eq_vec _pat_ M32_IRQ)
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__2 : bits ty32) ->
let (el : bits ty2) =
if (and_bool
(and_bool (HaveEL EL3) (HighestELUsingAArch32 ()))
(eq_vec ([access_vec_dec w__2 (0:ii)]) ([B0])))
then EL3
else EL1 in
return (el,valid_name)
else
(if (eq_vec _pat_ M32_Svc)
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__3 : bits ty32) ->
let (el : bits ty2) =
if (and_bool
(and_bool (HaveEL EL3) (HighestELUsingAArch32 ()))
(eq_vec ([access_vec_dec w__3 (0:ii)]) ([B0])))
then EL3
else EL1 in
return (el,valid_name)
else
(if (eq_vec _pat_ M32_Abort)
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__4 : bits ty32) ->
let (el : bits ty2) =
if (and_bool
(and_bool (HaveEL EL3) (HighestELUsingAArch32 ()))
(eq_vec ([access_vec_dec w__4 (0:ii)]) ([B0])))
then EL3
else EL1 in
return (el,valid_name)
else
(if (eq_vec _pat_ M32_Undef)
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__5 : bits ty32) ->
let (el : bits ty2) =
if (and_bool
(and_bool (HaveEL EL3) (HighestELUsingAArch32 ()))
(eq_vec ([access_vec_dec w__5 (0:ii)]) ([B0])))
then EL3
else EL1 in
return (el,valid_name)
else
(if (eq_vec _pat_ M32_System)
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__6 : bits ty32) ->
let (el : bits ty2) =
if (and_bool
(and_bool (HaveEL EL3) (HighestELUsingAArch32 ()))
(eq_vec ([access_vec_dec w__6 (0:ii)]) ([B0])))
then EL3
else EL1 in
return (el,valid_name)
else
let ((el : bits ty2), (valid_name : bool)) =
if (eq_vec _pat_ M32_User)
then
let (el : bits ty2) = EL0 in
(el,valid_name)
else
let (valid_name : bool) = false in
(el,valid_name) in
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
return (el,valid_name)) >>= fun ((el : bits ty2), (valid_name : bool)) ->
let (el : bits ty2) =
if (not valid_name)
then
let (el : bits ty2) = (undefined_vector (2:ii) (undefined_bit ()) : list bitU) in
el
else el in
return (valid_name,el)
val AArch32_WriteMode : list bitU -> M unit
let AArch32_WriteMode mode =
let (el : bits ty2) = (undefined_vector (2:ii) (undefined_bit ()) : list bitU) in
let (valid_name : bool) = undefined_bool () in
(ELFromM32 mode : M ((bool * list bitU))) >>= fun (tup__0, tup__1) ->
let valid_name = tup__0 in
let el = tup__1 in
assert_exp valid_name "valid" >>
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
write_reg PSTATE_ref <|w__0 with ProcState_M = mode|> >>
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
write_reg PSTATE_ref <|w__1 with ProcState_EL = el|> >>
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
write_reg PSTATE_ref <|w__2 with ProcState_nRW = ([B1])|> >>
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
write_reg
PSTATE_ref
<|w__3 with
ProcState_SP =
(if (or_bool (eq_vec mode M32_User) (eq_vec mode M32_System))
then [B0]
else [B1])|>
val AddrTop : list bitU -> bool -> list bitU -> M ii
let AddrTop address IsInstr el =
assert_exp (HaveEL el) "HaveEL(el)" >>
(S1TranslationRegime__0 el : M (list bitU)) >>= fun (regime : bits ty2) ->
let (tbid : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
let (tbi : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
ELUsingAArch32 regime >>= fun (w__0 : bool) ->
(if w__0
then return ((31:ii),tbi,tbid)
else
let _pat_ = regime in
(if (eq_vec _pat_ EL1)
then
(if (eq_vec ([access_vec_dec address (55:ii)]) ([B1]))
then
(read_reg TCR_EL1_ref : M (list bitU)) >>= fun (w__1 : bits ty64) ->
return ([access_vec_dec w__1 (38:ii)])
else
(read_reg TCR_EL1_ref : M (list bitU)) >>= fun (w__2 : bits ty64) ->
return ([access_vec_dec w__2 (37:ii)])) >>= fun (w__3 : list bitU) ->
let tbi = w__3 in
(if (HavePACExt ())
then
(if (eq_vec ([access_vec_dec address (55:ii)]) ([B1]))
then
(read_reg TCR_EL1_ref : M (list bitU)) >>= fun (w__4 : bits ty64) ->
return ([access_vec_dec w__4 (52:ii)])
else
(read_reg TCR_EL1_ref : M (list bitU)) >>= fun (w__5 : bits ty64) ->
return ([access_vec_dec w__5 (51:ii)])) >>= fun (w__6 : list bitU) ->
let (tbid : bits ty1) = w__6 in
return tbid
else return tbid) >>= fun (tbid : bits ty1) ->
return (tbi,tbid)
else
(if (eq_vec _pat_ EL2)
then
ELIsInHost el >>= fun (w__7 : bool) ->
(if (and_bool (HaveVirtHostExt ()) w__7)
then
(if (eq_vec ([access_vec_dec address (55:ii)]) ([B1]))
then
(read_reg TCR_EL2_ref : M (list bitU)) >>= fun (w__8 : bits ty64) ->
return ([access_vec_dec w__8 (38:ii)])
else
(read_reg TCR_EL2_ref : M (list bitU)) >>= fun (w__9 : bits ty64) ->
return ([access_vec_dec w__9 (37:ii)])) >>= fun (w__10 : list bitU) ->
let tbi = w__10 in
(if (HavePACExt ())
then
(if (eq_vec ([access_vec_dec address (55:ii)]) ([B1]))
then
(read_reg TCR_EL2_ref : M (list bitU)) >>= fun (w__11 : bits ty64) ->
return ([access_vec_dec w__11 (52:ii)])
else
(read_reg TCR_EL2_ref : M (list bitU)) >>= fun (w__12 : bits ty64) ->
return ([access_vec_dec w__12 (51:ii)])) >>= fun (w__13 : list bitU) ->
let (tbid : bits ty1) = w__13 in
return tbid
else return tbid) >>= fun (tbid : bits ty1) ->
return (tbi,tbid)
else
(read_reg TCR_EL2_ref : M (list bitU)) >>= fun (w__14 : bits ty64) ->
let tbi = [access_vec_dec w__14 (20:ii)] in
(if (HavePACExt ())
then
(read_reg TCR_EL2_ref : M (list bitU)) >>= fun (w__15 : bits ty64) ->
let (tbid : bits ty1) = [access_vec_dec w__15 (29:ii)] in
return tbid
else return tbid) >>= fun (tbid : bits ty1) ->
return (tbi,tbid)) >>= fun ((tbi : bits ty1), (tbid : bits ty1)) ->
return (tbi,tbid)
else
(read_reg TCR_EL3_ref : M (list bitU)) >>= fun (w__16 : bits ty32) ->
let tbi = [access_vec_dec w__16 (20:ii)] in
(if (HavePACExt ())
then
(read_reg TCR_EL3_ref : M (list bitU)) >>= fun (w__17 : bits ty32) ->
let (tbid : bits ty1) = [access_vec_dec w__17 (29:ii)] in
return tbid
else return tbid) >>= fun (tbid : bits ty1) ->
return (tbi,tbid)) >>= fun ((tbi : bits ty1), (tbid : bits ty1)) ->
return (tbi,tbid)) >>= fun ((tbi : bits ty1), (tbid : bits ty1)) ->
return (if (and_bool
(eq_vec tbi ([B1]))
(or_bool (or_bool (not (HavePACExt ())) (eq_vec tbid ([B0]))) (not IsInstr)))
then (55:ii)
else (63:ii),tbi,tbid)) >>= fun ((w__18 : ii), (tbi : bits ty1), (tbid : bits ty1)) ->
return w__18
val AArch64_TranslateAddress : list bitU -> AccType -> bool -> bool -> ii -> M AddressDescriptor
val AArch64_NoFault : unit -> FaultRecord
let AArch64_NoFault () =
let (ipaddress : bits ty52) = (undefined_vector (52:ii) (undefined_bit ()) : list bitU) in
let (level : ii) = undefined_int () in
let (acctype : AccType) = AccType_NORMAL in
let (iswrite : bool) = undefined_bool () in
let (extflag : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
let (errortype : bits ty2) = (undefined_vector (2:ii) (undefined_bit ()) : list bitU) in
let (secondstage : bool) = false in
let (s2fs1walk : bool) = false in
AArch64_CreateFaultRecord
Fault_None
ipaddress
level
acctype
iswrite
extflag
errortype
secondstage
s2fs1walk
let AArch64_TranslateAddress vaddress acctype iswrite wasaligned size =
(ZeroExtend__1 (64:ii) vaddress : M (list bitU)) >>= fun (w__0 : bits ty64) ->
return (<| AddressDescriptor_fault = (AArch64_NoFault ());
AddressDescriptor_memattrs =
(<| MemoryAttributes_typ = MemType_Normal;
MemoryAttributes_device = DeviceType_GRE;
MemoryAttributes_inner =
(<| MemAttrHints_attrs = ([B0;B0]);
MemAttrHints_hints = ([B0;B0]);
MemAttrHints_transient = false |>);
MemoryAttributes_outer =
(<| MemAttrHints_attrs = ([B0;B0]);
MemAttrHints_hints = ([B0;B0]);
MemAttrHints_transient = false |>);
MemoryAttributes_shareable = true;
MemoryAttributes_outershareable = true |>);
AddressDescriptor_paddress =
(<| FullAddress_physicaladdress = (slice vaddress (0:ii) (52:ii) : list bitU) |>);
AddressDescriptor_vaddress = w__0 |>)
val AArch64_MaybeZeroRegisterUppers : unit -> M unit
let AArch64_MaybeZeroRegisterUppers () =
UsingAArch32 () >>= fun (w__0 : bool) ->
assert_exp w__0 "UsingAArch32()" >>
let (include_R15_name : bool) = undefined_bool () in
let (last : integer) = undefined_range (14:ii) (30:ii) in
let (first : integer) = (0:ii) in
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
ELUsingAArch32 EL1 >>= fun (w__2 : bool) ->
(if (and_bool (eq_vec w__1.ProcState_EL EL0) (not w__2))
then
let (first : integer) = (0:ii) in
let (last : integer) = (14:ii) in
let (include_R15_name : bool) = false in
return (first,include_R15_name,last)
else
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
IsSecure () >>= fun (w__5 : bool) ->
ELUsingAArch32 EL2 >>= fun (w__6 : bool) ->
let ((first : integer), (include_R15_name : bool), (last : integer)) =
if (and_bool
(and_bool
(and_bool
(or_bool (eq_vec w__3.ProcState_EL EL0) (eq_vec w__4.ProcState_EL EL1))
(HaveEL EL2))
(not w__5))
(not w__6))
then
let (first : integer) = (0:ii) in
let (last : integer) = (30:ii) in
let (include_R15_name : bool) = false in
(first,include_R15_name,last)
else
let (first : integer) = (0:ii) in
let (last : integer) = (30:ii) in
let (include_R15_name : bool) = true in
(first,include_R15_name,last) in
return (first,include_R15_name,last)) >>= fun ((first : integer), (include_R15_name : bool), (last :
integer)) ->
(foreachM (index_list first last (1:ii)) ()
(fun n () ->
ConstrainUnpredictableBool Unpredictable_ZEROUPPER >>= fun (w__7 : bool) ->
if (and_bool (or_bool (neq (ex_int n) (ex_int (15:ii))) include_R15_name) w__7)
then
read_reg _R_ref >>= fun (w__8 : list (bits ty64)) ->
let (__tmp_3 : bits ty64) = (access_list_dec w__8 n : list bitU) in
let __tmp_3 =
(update_subrange_vec_dec __tmp_3 (63:ii) (32:ii) (Zeros__0 (32:ii) : list bitU) : list bitU) in
read_reg _R_ref >>= fun (w__9 : list (list bitU)) ->
write_reg _R_ref (update_list_dec w__9 n __tmp_3 : list (list bitU))
else return ()))
val AArch64_FaultSyndrome : bool -> FaultRecord -> M (list bitU)
let AArch64_FaultSyndrome d_side fault =
assert_exp (neq fault.FaultRecord_typ Fault_None) "((fault).type != Fault_None)" >>
let (iss : bits ty25) = (Zeros__1 (25:ii) () : list bitU) in
IsExternalSyncAbort__1 fault >>= fun (w__0 : bool) ->
let (iss : bits ty25) =
if (and_bool (HaveRASExt ()) w__0)
then
let (iss : bits ty25) =
(set_slice (25:ii) (2:ii) iss (11:ii) fault.FaultRecord_errortype : list bitU) in
iss
else iss in
(if d_side
then
IsSecondStage fault >>= fun (w__1 : bool) ->
(if (and_bool w__1 (not fault.FaultRecord_s2fs1walk))
then
(LSInstructionSyndrome () : M (list bitU)) >>= fun (w__2 : list bitU) ->
let (iss : bits ty25) = (set_slice (25:ii) (11:ii) iss (14:ii) w__2 : list bitU) in
return iss
else return iss) >>= fun (iss : bits ty25) ->
let (iss : bits ty25) =
if (or_bool
(eq fault.FaultRecord_acctype AccType_DC)
(or_bool
(eq fault.FaultRecord_acctype AccType_IC)
(eq fault.FaultRecord_acctype AccType_AT)))
then
let (iss : bits ty25) = (set_slice (25:ii) (1:ii) iss (8:ii) ([B1]) : list bitU) in
let (iss : bits ty25) = (set_slice (25:ii) (1:ii) iss (6:ii) ([B1]) : list bitU) in
iss
else
let (iss : bits ty25) =
(set_slice (25:ii) (1:ii) iss (6:ii) (if fault.FaultRecord_write then [B1] else [B0]) : list bitU) in
iss in
return iss
else return iss) >>= fun (iss : bits ty25) ->
IsExternalAbort__1 fault >>= fun (w__3 : bool) ->
let (iss : bits ty25) =
if w__3
then
let (iss : bits ty25) =
(set_slice (25:ii) (1:ii) iss (9:ii) fault.FaultRecord_extflag : list bitU) in
iss
else iss in
let iss =
(set_slice (25:ii) (1:ii) iss (7:ii) (if fault.FaultRecord_s2fs1walk then [B1] else [B0]) : list bitU) in
(EncodeLDFSC fault.FaultRecord_typ fault.FaultRecord_level : M (list bitU)) >>= fun (w__4 :
list bitU) ->
let (iss : bits ty25) = (set_slice (25:ii) (6:ii) iss (0:ii) w__4 : list bitU) in
return iss
val AArch64_AbortSyndrome : Exception -> FaultRecord -> list bitU -> M ExceptionRecord
let AArch64_AbortSyndrome typ fault vaddress =
let (exception : ExceptionRecord) = ExceptionSyndrome typ in
let (d_side : bool) = or_bool (eq typ Exception_DataAbort) (eq typ Exception_Watchpoint) in
(AArch64_FaultSyndrome d_side fault : M (list bitU)) >>= fun (w__0 : bits ty25) ->
let exception = <|exception with ExceptionRecord_syndrome = w__0|> in
(ZeroExtend__1 (64:ii) vaddress : M (list bitU)) >>= fun (w__1 : bits ty64) ->
let exception = <|exception with ExceptionRecord_vaddress = w__1|> in
IPAValid fault >>= fun (w__2 : bool) ->
let (exception : ExceptionRecord) =
if w__2
then
let (exception : ExceptionRecord) = <|exception with ExceptionRecord_ipavalid = true|> in
let (exception : ExceptionRecord) =
<|exception with ExceptionRecord_ipaddress = fault.FaultRecord_ipaddress|> in
exception
else
let (exception : ExceptionRecord) = <|exception with ExceptionRecord_ipavalid = false|> in
exception in
return exception
val AArch64_ExceptionClass : Exception -> list bitU -> M (ii * list bitU)
let AArch64_ExceptionClass typ target_el =
ThisInstrLength () >>= fun (w__0 : ii) ->
let (il : bits ty1) = if (eq (ex_int w__0) (32:ii)) then [B1] else [B0] in
UsingAArch32 () >>= fun (from_32 : bool) ->
assert_exp (or_bool from_32 (eq_vec il ([B1]))) "(from_32 || (il == '1'))" >>
let (ec : ii) = undefined_int () in
match typ with
| Exception_Uncategorized ->
let (ec : ii) = (0:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_WFxTrap ->
let (ec : ii) = (1:ii) in
return (ec,il)
| Exception_CP15RTTrap ->
let ec = (3:ii) in
assert_exp from_32 "from_32" >>
return (ec,il)
| Exception_CP15RRTTrap ->
let ec = (4:ii) in
assert_exp from_32 "from_32" >>
return (ec,il)
| Exception_CP14RTTrap ->
let ec = (5:ii) in
assert_exp from_32 "from_32" >>
return (ec,il)
| Exception_CP14DTTrap ->
let ec = (6:ii) in
assert_exp from_32 "from_32" >>
return (ec,il)
| Exception_AdvSIMDFPAccessTrap ->
let (ec : ii) = (7:ii) in
return (ec,il)
| Exception_FPIDTrap ->
let (ec : ii) = (8:ii) in
return (ec,il)
| Exception_CP14RRTTrap ->
let ec = (12:ii) in
assert_exp from_32 "from_32" >>
return (ec,il)
| Exception_IllegalState ->
let (ec : ii) = (14:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_SupervisorCall ->
let (ec : ii) = (17:ii) in
return (ec,il)
| Exception_HypervisorCall ->
let (ec : ii) = (18:ii) in
return (ec,il)
| Exception_MonitorCall ->
let (ec : ii) = (19:ii) in
return (ec,il)
| Exception_SystemRegisterTrap ->
let ec = (24:ii) in
assert_exp (not from_32) "!(from_32)" >>
return (ec,il)
| Exception_InstructionAbort ->
let (ec : ii) = (32:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_PCAlignment ->
let (ec : ii) = (34:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_DataAbort ->
let (ec : ii) = (36:ii) in
return (ec,il)
| Exception_SPAlignment ->
let ec = (38:ii) in
let il = [B1] in
assert_exp (not from_32) "!(from_32)" >>
return (ec,il)
| Exception_FPTrappedException ->
let (ec : ii) = (40:ii) in
return (ec,il)
| Exception_SError ->
let (ec : ii) = (47:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_Breakpoint ->
let (ec : ii) = (48:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_SoftwareStep ->
let (ec : ii) = (50:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_Watchpoint ->
let (ec : ii) = (52:ii) in
let (il : bits ty1) = [B1] in
return (ec,il)
| Exception_SoftwareBreakpoint ->
let (ec : ii) = (56:ii) in
return (ec,il)
| Exception_VectorCatch ->
let ec = (58:ii) in
let il = [B1] in
assert_exp from_32 "from_32" >>
return (ec,il)
| _ ->
Unreachable () >>
return (ec,il)
end >>= fun ((ec : ii), (il : bits ty1)) ->
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
let (ec : ii) =
if (and_bool
(or_bool
(eq (ex_int ec) (32:ii))
(or_bool
(eq (ex_int ec) (36:ii))
(or_bool
(eq (ex_int ec) (48:ii))
(or_bool (eq (ex_int ec) (50:ii)) (eq (ex_int ec) (52:ii))))))
(eq_vec target_el w__1.ProcState_EL))
then
let (ec : ii) = integerAdd (ex_int ec) (1:ii) in
ec
else ec in
let (ec : ii) =
if (and_bool
(or_bool
(eq (ex_int ec) (17:ii))
(or_bool
(eq (ex_int ec) (18:ii))
(or_bool
(eq (ex_int ec) (19:ii))
(or_bool (eq (ex_int ec) (40:ii)) (eq (ex_int ec) (56:ii))))))
(not from_32))
then
let (ec : ii) = integerAdd (ex_int ec) (4:ii) in
ec
else ec in
return (ec,il)
val AArch64_ReportException : ExceptionRecord -> list bitU -> M unit
let AArch64_ReportException exception target_el =
let (typ : Exception) = exception.ExceptionRecord_typ in
let (il : bits ty1) = (undefined_vector (1:ii) (undefined_bit ()) : list bitU) in
let (ec : ii) = undefined_int () in
(AArch64_ExceptionClass typ target_el : M ((ii * list bitU))) >>= fun (tup__0, tup__1) ->
let ec = tup__0 in
let il = tup__1 in
let (iss : bits ty25) = exception.ExceptionRecord_syndrome in
let (il : bits ty1) =
if (and_bool
(or_bool (eq (ex_int ec) (36:ii)) (eq (ex_int ec) (37:ii)))
(eq_vec ([access_vec_dec iss (24:ii)]) ([B0])))
then
let (il : bits ty1) = [B1] in
il
else il in
aset_ESR__0
target_el
(concat_vec (concat_vec (__GetSlice_int (6:ii) ec (0:ii) : list bitU) il : list bitU) iss : list bitU) >>
(if (or_bool
(eq typ Exception_InstructionAbort)
(or_bool
(eq typ Exception_PCAlignment)
(or_bool (eq typ Exception_DataAbort) (eq typ Exception_Watchpoint))))
then aset_FAR__0 target_el exception.ExceptionRecord_vaddress
else aset_FAR__0 target_el (undefined_vector (64:ii) (undefined_bit ()) : list bitU)) >>
if (eq_vec target_el EL2)
then
if exception.ExceptionRecord_ipavalid
then
(read_reg HPFAR_EL2_ref : M (list bitU)) >>= fun (w__0 : list bitU) ->
write_reg
HPFAR_EL2_ref
(set_slice
(64:ii)
(40:ii)
w__0
(4:ii)
(slice exception.ExceptionRecord_ipaddress (12:ii) (40:ii) : list bitU) : list bitU)
else
(read_reg HPFAR_EL2_ref : M (list bitU)) >>= fun (w__1 : list bitU) ->
write_reg
HPFAR_EL2_ref
(set_slice
(64:ii)
(40:ii)
w__1
(4:ii)
(undefined_vector (40:ii) (undefined_bit ()) : list bitU) : list bitU)
else return ()
val AArch64_BranchAddr : list bitU -> M (list bitU)
let AArch64_BranchAddr vaddress =
UsingAArch32 () >>= fun (w__0 : bool) ->
assert_exp (not w__0) "!(UsingAArch32())" >>
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
AddrTop vaddress true w__1.ProcState_EL >>= fun (w__2 : ii) ->
coerce_int_nat w__2 >>= fun (msbit : ii) ->
if (eq (ex_nat msbit) (63:ii))
then return vaddress
else
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
IsInHost () >>= fun (w__5 : bool) ->
if (and_bool
(or_bool (or_bool (eq_vec w__3.ProcState_EL EL0) (eq_vec w__4.ProcState_EL EL1)) w__5)
(eq_vec ([access_vec_dec vaddress msbit]) ([B1])))
then
(SignExtend__1
(64:ii)
(slice vaddress (0:ii) (integerAdd (ex_nat msbit) (1:ii)) : (list bitU)) : M (list bitU))
else
(ZeroExtend__1
(64:ii)
(slice vaddress (0:ii) (integerAdd (ex_nat msbit) (1:ii)) : (list bitU)) : M (list bitU))
val BranchTo : list bitU -> BranchType -> M unit
let BranchTo target branch_type =
write_reg __BranchTaken_ref true >>
let (_ : unit) = Hint_Branch branch_type in
if (eq (length target) (32:ii))
then
UsingAArch32 () >>= fun (w__0 : bool) ->
assert_exp w__0 "UsingAArch32()" >>
(ZeroExtend__1 (64:ii) target : M (list bitU)) >>= fun (w__1 : bits ty64) ->
write_reg _PC_ref w__1
else
UsingAArch32 () >>= fun (w__2 : bool) ->
assert_exp (and_bool (eq (length target) (64:ii)) (not w__2)) "((N == 64) && !(UsingAArch32()))" >>
(AArch64_BranchAddr (slice target (0:ii) (64:ii) : list bitU) : M (list bitU)) >>= fun (w__3 :
bits ty64) ->
write_reg _PC_ref w__3
val AArch64_TakeException : list bitU -> ExceptionRecord -> list bitU -> ii -> M unit
let AArch64_TakeException target_el exception preferred_exception_return vect_offset__arg =
let vect_offset = vect_offset__arg in
let (_ : unit) = SynchronizeContext () in
ELUsingAArch32 target_el >>= fun (w__0 : bool) ->
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
assert_exp (and_bool
(and_bool (HaveEL target_el) (not w__0))
(gteq (uint target_el) (uint w__1.ProcState_EL))) "((HaveEL(target_el) && !(ELUsingAArch32(target_el))) && (UInt(target_el) >= UInt((PSTATE).EL)))" >>
UsingAArch32 () >>= fun (from_32 : bool) ->
(if from_32
then AArch64_MaybeZeroRegisterUppers ()
else return ()) >>
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
(if (gt (uint target_el) (uint w__2.ProcState_EL))
then
let (lower_32 : bool) = undefined_bool () in
(if (eq_vec target_el EL3)
then
IsSecure () >>= fun (w__3 : bool) ->
(if (and_bool (not w__3) (HaveEL EL2))
then
ELUsingAArch32 EL2 >>= fun (w__4 : bool) ->
let (lower_32 : bool) = w__4 in
return lower_32
else
ELUsingAArch32 EL1 >>= fun (w__5 : bool) ->
let (lower_32 : bool) = w__5 in
return lower_32) >>= fun (lower_32 : bool) ->
return lower_32
else
IsInHost () >>= fun (w__6 : bool) ->
read_reg PSTATE_ref >>= fun (w__7 : ProcState) ->
(if (and_bool (and_bool w__6 (eq_vec w__7.ProcState_EL EL0)) (eq_vec target_el EL2))
then
ELUsingAArch32 EL0 >>= fun (w__8 : bool) ->
let (lower_32 : bool) = w__8 in
return lower_32
else
ELUsingAArch32 (sub_vec_int target_el (1:ii) : list bitU) >>= fun (w__9 : bool) ->
let (lower_32 : bool) = w__9 in
return lower_32) >>= fun (lower_32 : bool) ->
return lower_32) >>= fun (lower_32 : bool) ->
let (vect_offset : ii) = integerAdd vect_offset (if lower_32 then (1536:ii) else (1024:ii)) in
return vect_offset
else
read_reg PSTATE_ref >>= fun (w__10 : ProcState) ->
let (vect_offset : ii) =
if (eq_vec w__10.ProcState_SP ([B1]))
then
let (vect_offset : ii) = integerAdd (ex_int vect_offset) (512:ii) in
vect_offset
else vect_offset in
return vect_offset) >>= fun (vect_offset : ii) ->
(GetPSRFromPSTATE () : M (list bitU)) >>= fun (spsr : bits ty32) ->
(if (HaveUAOExt ())
then
read_reg PSTATE_ref >>= fun (w__11 : ProcState) ->
write_reg PSTATE_ref <|w__11 with ProcState_UAO = ([B0])|>
else return ()) >>
(if (not
(or_bool
(eq exception.ExceptionRecord_typ Exception_IRQ)
(eq exception.ExceptionRecord_typ Exception_FIQ)))
then AArch64_ReportException exception target_el
else return ()) >>
read_reg PSTATE_ref >>= fun (w__12 : ProcState) ->
write_reg PSTATE_ref <|w__12 with ProcState_EL = target_el|> >>
read_reg PSTATE_ref >>= fun (w__13 : ProcState) ->
write_reg PSTATE_ref <|w__13 with ProcState_nRW = ([B0])|> >>
read_reg PSTATE_ref >>= fun (w__14 : ProcState) ->
write_reg PSTATE_ref <|w__14 with ProcState_SP = ([B1])|> >>
aset_SPSR spsr >>
aset_ELR__1 preferred_exception_return >>
read_reg PSTATE_ref >>= fun (w__15 : ProcState) ->
write_reg PSTATE_ref <|w__15 with ProcState_SS = ([B0])|> >>
let split_vec = [B1;B1;B1;B1] in
let (tup__0, tup__1, tup__2, tup__3) =
((subrange_vec_dec split_vec (3:ii) (3:ii) : list bitU),(subrange_vec_dec
split_vec
(2:ii)
(2:ii) : list bitU),(subrange_vec_dec
split_vec
(1:ii)
(1:ii) : list bitU),(subrange_vec_dec
split_vec
(0:ii)
(0:ii) : list bitU)) in
read_reg PSTATE_ref >>= fun (w__16 : ProcState) ->
write_reg PSTATE_ref <|w__16 with ProcState_D = tup__0|> >>
read_reg PSTATE_ref >>= fun (w__17 : ProcState) ->
write_reg PSTATE_ref <|w__17 with ProcState_A = tup__1|> >>
read_reg PSTATE_ref >>= fun (w__18 : ProcState) ->
write_reg PSTATE_ref <|w__18 with ProcState_I = tup__2|> >>
read_reg PSTATE_ref >>= fun (w__19 : ProcState) ->
write_reg PSTATE_ref <|w__19 with ProcState_F = tup__3|> >>
read_reg PSTATE_ref >>= fun (w__20 : ProcState) ->
write_reg PSTATE_ref <|w__20 with ProcState_IL = ([B0])|> >>
(if from_32
then
read_reg PSTATE_ref >>= fun (w__21 : ProcState) ->
write_reg PSTATE_ref <|w__21 with ProcState_IT = ([B0;B0;B0;B0;B0;B0;B0;B0])|> >>
read_reg PSTATE_ref >>= fun (w__22 : ProcState) ->
write_reg PSTATE_ref <|w__22 with ProcState_T = ([B0])|>
else return ()) >>
read_reg PSTATE_ref >>= fun (w__23 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__24 : ProcState) ->
ELIsInHost EL0 >>= fun (w__25 : bool) ->
(aget_SCTLR__1 () : M (list bitU)) >>= fun (w__26 : list bitU) ->
(if (and_bool
(and_bool
(HavePANExt ())
(or_bool
(eq_vec w__23.ProcState_EL EL1)
(and_bool (eq_vec w__24.ProcState_EL EL2) w__25)))
(eq_vec ([access_vec_dec w__26 (23:ii)]) ([B0])))
then
read_reg PSTATE_ref >>= fun (w__27 : ProcState) ->
write_reg PSTATE_ref <|w__27 with ProcState_PAN = ([B1])|>
else return ()) >>
(aget_VBAR__1 () : M (list bitU)) >>= fun (w__28 : list bitU) ->
BranchTo
(concat_vec
(slice w__28 (11:ii) (53:ii) : list bitU)
(__GetSlice_int (11:ii) vect_offset (0:ii) : list bitU) : list bitU)
BranchType_EXCEPTION >>
let (iesb_req : bool) = undefined_bool () in
(aget_SCTLR__1 () : M (list bitU)) >>= fun (w__29 : list bitU) ->
(if (and_bool (HaveRASExt ()) (eq_vec ([access_vec_dec w__29 (21:ii)]) ([B1])))
then
let (_ : unit) = ErrorSynchronizationBarrier MBReqDomain_FullSystem MBReqTypes_All in
let iesb_req = true in
TakeUnmaskedPhysicalSErrorInterrupts iesb_req >>
return iesb_req
else return iesb_req) >>= fun (iesb_req : bool) ->
return (EndOfInstruction ())
val AArch64_WatchpointException : list bitU -> FaultRecord -> M unit
let AArch64_WatchpointException vaddress fault =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
assert_exp (neq_vec w__0.ProcState_EL EL3) "((PSTATE).EL != EL3)" >>
IsSecure () >>= fun (w__1 : bool) ->
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__4 : bits ty64) ->
(read_reg MDCR_EL2_ref : M (list bitU)) >>= fun (w__5 : bits ty32) ->
let (route_to_el2 : bool) =
and_bool
(and_bool
(and_bool (HaveEL EL2) (not w__1))
(or_bool (eq_vec w__2.ProcState_EL EL0) (eq_vec w__3.ProcState_EL EL1)))
(or_bool
(eq_vec ([access_vec_dec w__4 (27:ii)]) ([B1]))
(eq_vec ([access_vec_dec w__5 (8:ii)]) ([B1]))) in
(ThisInstrAddr (64:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty64) ->
let (vect_offset : ii) = (0:ii) in
AArch64_AbortSyndrome Exception_Watchpoint fault vaddress >>= fun (exception : ExceptionRecord) ->
read_reg PSTATE_ref >>= fun (w__6 : ProcState) ->
if (or_bool (eq_vec w__6.ProcState_EL EL2) route_to_el2)
then AArch64_TakeException EL2 exception preferred_exception_return vect_offset
else AArch64_TakeException EL1 exception preferred_exception_return vect_offset
val AArch64_VectorCatchException : FaultRecord -> M unit
let AArch64_VectorCatchException fault =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
assert_exp (neq_vec w__0.ProcState_EL EL2) "((PSTATE).EL != EL2)" >>
IsSecure () >>= fun (w__1 : bool) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__2 : bits ty64) ->
(read_reg MDCR_EL2_ref : M (list bitU)) >>= fun (w__3 : bits ty32) ->
assert_exp (and_bool
(and_bool (HaveEL EL2) (not w__1))
(or_bool
(eq_vec ([access_vec_dec w__2 (27:ii)]) ([B1]))
(eq_vec ([access_vec_dec w__3 (8:ii)]) ([B1])))) "((HaveEL(EL2) && !(IsSecure())) && (((HCR_EL2).TGE == '1') || ((MDCR_EL2).TDE == '1')))" >>
(ThisInstrAddr (64:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty64) ->
let (vect_offset : ii) = (0:ii) in
let (vaddress : bits ty64) = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) in
AArch64_AbortSyndrome Exception_VectorCatch fault vaddress >>= fun (exception : ExceptionRecord) ->
AArch64_TakeException EL2 exception preferred_exception_return vect_offset
val AArch64_UndefinedFault : unit -> M unit
let AArch64_UndefinedFault () =
IsSecure () >>= fun (w__0 : bool) ->
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__2 : bits ty64) ->
let (route_to_el2 : bool) =
and_bool
(and_bool (and_bool (HaveEL EL2) (not w__0)) (eq_vec w__1.ProcState_EL EL0))
(eq_vec ([access_vec_dec w__2 (27:ii)]) ([B1])) in
(ThisInstrAddr (64:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty64) ->
let (vect_offset : ii) = (0:ii) in
let (exception : ExceptionRecord) = ExceptionSyndrome Exception_Uncategorized in
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
if (gt (uint w__3.ProcState_EL) (uint EL1))
then
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
AArch64_TakeException w__4.ProcState_EL exception preferred_exception_return vect_offset
else
if route_to_el2
then AArch64_TakeException EL2 exception preferred_exception_return vect_offset
else AArch64_TakeException EL1 exception preferred_exception_return vect_offset
val AArch64_SPAlignmentFault : unit -> M unit
let AArch64_SPAlignmentFault () =
(ThisInstrAddr (64:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty64) ->
let (vect_offset : ii) = (0:ii) in
let (exception : ExceptionRecord) = ExceptionSyndrome Exception_SPAlignment in
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
if (gt (uint w__0.ProcState_EL) (uint EL1))
then
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
AArch64_TakeException w__1.ProcState_EL exception preferred_exception_return vect_offset
else
IsSecure () >>= fun (w__2 : bool) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__3 : bits ty64) ->
if (and_bool (and_bool (HaveEL EL2) (not w__2)) (eq_vec ([access_vec_dec w__3 (27:ii)]) ([B1])))
then AArch64_TakeException EL2 exception preferred_exception_return vect_offset
else AArch64_TakeException EL1 exception preferred_exception_return vect_offset
val CheckSPAlignment : unit -> M unit
let CheckSPAlignment () =
(aget_SP (64:ii) () : M (list bitU)) >>= fun (sp : bits ty64) ->
let (stack_align_check : bool) = undefined_bool () in
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
(if (eq_vec w__0.ProcState_EL EL0)
then
(aget_SCTLR__1 () : M (list bitU)) >>= fun (w__1 : list bitU) ->
let (stack_align_check : bool) = neq_vec ([access_vec_dec w__1 (4:ii)]) ([B0]) in
return stack_align_check
else
(aget_SCTLR__1 () : M (list bitU)) >>= fun (w__2 : list bitU) ->
let (stack_align_check : bool) = neq_vec ([access_vec_dec w__2 (3:ii)]) ([B0]) in
return stack_align_check) >>= fun (stack_align_check : bool) ->
if (and_bool stack_align_check (neq_vec sp (Align__1 sp (16:ii) : list bitU)))
then AArch64_SPAlignmentFault ()
else return ()
val AArch64_InstructionAbort : list bitU -> FaultRecord -> M unit
let AArch64_InstructionAbort vaddress fault =
(read_reg SCR_EL3_ref : M (list bitU)) >>= fun (w__0 : bits ty32) ->
IsExternalAbort__1 fault >>= fun (w__1 : bool) ->
let (route_to_el3 : bool) =
and_bool (and_bool (HaveEL EL3) (eq_vec ([access_vec_dec w__0 (3:ii)]) ([B1]))) w__1 in
IsSecure () >>= fun (w__2 : bool) ->
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__5 : bits ty64) ->
IsSecondStage fault >>= fun (w__6 : bool) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__7 : bits ty64) ->
IsExternalAbort__1 fault >>= fun (w__8 : bool) ->
let (route_to_el2 : bool) =
and_bool
(and_bool
(and_bool (HaveEL EL2) (not w__2))
(or_bool (eq_vec w__3.ProcState_EL EL0) (eq_vec w__4.ProcState_EL EL1)))
(or_bool
(or_bool (eq_vec ([access_vec_dec w__5 (27:ii)]) ([B1])) w__6)
(and_bool (and_bool (HaveRASExt ()) (eq_vec ([access_vec_dec w__7 (37:ii)]) ([B1]))) w__8)) in
(ThisInstrAddr (64:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty64) ->
let (vect_offset : ii) = (0:ii) in
AArch64_AbortSyndrome Exception_InstructionAbort fault vaddress >>= fun (exception :
ExceptionRecord) ->
read_reg PSTATE_ref >>= fun (w__9 : ProcState) ->
if (or_bool (eq_vec w__9.ProcState_EL EL3) route_to_el3)
then AArch64_TakeException EL3 exception preferred_exception_return vect_offset
else
read_reg PSTATE_ref >>= fun (w__10 : ProcState) ->
if (or_bool (eq_vec w__10.ProcState_EL EL2) route_to_el2)
then AArch64_TakeException EL2 exception preferred_exception_return vect_offset
else AArch64_TakeException EL1 exception preferred_exception_return vect_offset
val AArch64_DataAbort : list bitU -> FaultRecord -> M unit
let AArch64_DataAbort vaddress fault =
(read_reg SCR_EL3_ref : M (list bitU)) >>= fun (w__0 : bits ty32) ->
IsExternalAbort__1 fault >>= fun (w__1 : bool) ->
let (route_to_el3 : bool) =
and_bool (and_bool (HaveEL EL3) (eq_vec ([access_vec_dec w__0 (3:ii)]) ([B1]))) w__1 in
IsSecure () >>= fun (w__2 : bool) ->
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__5 : bits ty64) ->
IsSecondStage fault >>= fun (w__6 : bool) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__7 : bits ty64) ->
IsExternalAbort__1 fault >>= fun (w__8 : bool) ->
let (route_to_el2 : bool) =
and_bool
(and_bool
(and_bool (HaveEL EL2) (not w__2))
(or_bool (eq_vec w__3.ProcState_EL EL0) (eq_vec w__4.ProcState_EL EL1)))
(or_bool
(or_bool (eq_vec ([access_vec_dec w__5 (27:ii)]) ([B1])) w__6)
(and_bool (and_bool (HaveRASExt ()) (eq_vec ([access_vec_dec w__7 (37:ii)]) ([B1]))) w__8)) in
(ThisInstrAddr (64:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty64) ->
let (vect_offset : ii) = (0:ii) in
AArch64_AbortSyndrome Exception_DataAbort fault vaddress >>= fun (exception : ExceptionRecord) ->
read_reg PSTATE_ref >>= fun (w__9 : ProcState) ->
if (or_bool (eq_vec w__9.ProcState_EL EL3) route_to_el3)
then AArch64_TakeException EL3 exception preferred_exception_return vect_offset
else
read_reg PSTATE_ref >>= fun (w__10 : ProcState) ->
if (or_bool (eq_vec w__10.ProcState_EL EL2) route_to_el2)
then AArch64_TakeException EL2 exception preferred_exception_return vect_offset
else AArch64_TakeException EL1 exception preferred_exception_return vect_offset
val AArch64_BreakpointException : FaultRecord -> M unit
let AArch64_BreakpointException fault =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
assert_exp (neq_vec w__0.ProcState_EL EL3) "((PSTATE).EL != EL3)" >>
IsSecure () >>= fun (w__1 : bool) ->
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
read_reg PSTATE_ref >>= fun (w__3 : ProcState) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__4 : bits ty64) ->
(read_reg MDCR_EL2_ref : M (list bitU)) >>= fun (w__5 : bits ty32) ->
let (route_to_el2 : bool) =
and_bool
(and_bool
(and_bool (HaveEL EL2) (not w__1))
(or_bool (eq_vec w__2.ProcState_EL EL0) (eq_vec w__3.ProcState_EL EL1)))
(or_bool
(eq_vec ([access_vec_dec w__4 (27:ii)]) ([B1]))
(eq_vec ([access_vec_dec w__5 (8:ii)]) ([B1]))) in
(ThisInstrAddr (64:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty64) ->
let (vect_offset : ii) = (0:ii) in
let (vaddress : bits ty64) = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) in
AArch64_AbortSyndrome Exception_Breakpoint fault vaddress >>= fun (exception : ExceptionRecord) ->
read_reg PSTATE_ref >>= fun (w__6 : ProcState) ->
if (or_bool (eq_vec w__6.ProcState_EL EL2) route_to_el2)
then AArch64_TakeException EL2 exception preferred_exception_return vect_offset
else AArch64_TakeException EL1 exception preferred_exception_return vect_offset
val AArch64_Abort : list bitU -> FaultRecord -> M unit
let AArch64_Abort vaddress fault =
IsDebugException fault >>= fun (w__0 : bool) ->
if w__0
then
if (eq fault.FaultRecord_acctype AccType_IFETCH)
then
UsingAArch32 () >>= fun (w__1 : bool) ->
if (and_bool w__1 (eq_vec fault.FaultRecord_debugmoe DebugException_VectorCatch))
then AArch64_VectorCatchException fault
else AArch64_BreakpointException fault
else AArch64_WatchpointException vaddress fault
else
if (eq fault.FaultRecord_acctype AccType_IFETCH)
then AArch64_InstructionAbort vaddress fault
else AArch64_DataAbort vaddress fault
val AArch64_aset_MemSingle : list bitU -> integer -> AccType -> bool -> list bitU -> M unit
let AArch64_aset_MemSingle address size acctype wasaligned value_name =
assert_exp (or_bool
(eq size (1:ii))
(or_bool
(eq size (2:ii))
(or_bool (eq size (4:ii)) (or_bool (eq size (8:ii)) (eq size (16:ii)))))) "((size == 1) || ((size == 2) || ((size == 4) || ((size == 8) || (size == 16)))))" >>
assert_exp (eq_vec address (Align__1 address size : list bitU)) "(address == Align(address, size))" >>
let (memaddrdesc : AddressDescriptor) = undefined_AddressDescriptor () in
let (iswrite : bool) = true in
AArch64_TranslateAddress address acctype iswrite wasaligned size >>= fun (w__0 :
AddressDescriptor) ->
let memaddrdesc = w__0 in
(if (IsFault memaddrdesc)
then AArch64_Abort address memaddrdesc.AddressDescriptor_fault
else return ()) >>
let (_ : unit) =
if memaddrdesc.AddressDescriptor_memattrs.MemoryAttributes_shareable
then ClearExclusiveByAddress memaddrdesc.AddressDescriptor_paddress (ProcessorID ()) size
else () in
let (accdesc : AccessDescriptor) = CreateAccessDescriptor acctype in
aset__Mem memaddrdesc size accdesc value_name
val AArch64_aget_MemSingle : list bitU -> integer -> AccType -> bool -> M (list bitU)
let AArch64_aget_MemSingle address size acctype wasaligned =
assert_exp (or_bool
(eq size (1:ii))
(or_bool
(eq size (2:ii))
(or_bool (eq size (4:ii)) (or_bool (eq size (8:ii)) (eq size (16:ii)))))) "((size == 1) || ((size == 2) || ((size == 4) || ((size == 8) || (size == 16)))))" >>
assert_exp (eq_vec address (Align__1 address size : list bitU)) "(address == Align(address, size))" >>
let (memaddrdesc : AddressDescriptor) = undefined_AddressDescriptor () in
let value_name = (undefined_vector (integerMult (8:ii) size) (undefined_bit ()) : list bitU) in
let (iswrite : bool) = false in
AArch64_TranslateAddress address acctype iswrite wasaligned size >>= fun (w__0 :
AddressDescriptor) ->
let memaddrdesc = w__0 in
(if (IsFault memaddrdesc)
then AArch64_Abort address memaddrdesc.AddressDescriptor_fault
else return ()) >>
let (accdesc : AccessDescriptor) = CreateAccessDescriptor acctype in
(aget__Mem memaddrdesc size accdesc : M (list bitU)) >>= fun w__1 ->
let value_name = w__1 in
return value_name
val AArch64_CheckAlignment : list bitU -> ii -> AccType -> bool -> M bool
let AArch64_CheckAlignment address alignment acctype iswrite =
let (aligned : bool) = eq_vec address (Align__1 address alignment : list bitU) in
let (atomic : bool) = or_bool (eq acctype AccType_ATOMIC) (eq acctype AccType_ATOMICRW) in
let (ordered : bool) =
or_bool
(eq acctype AccType_ORDERED)
(or_bool (eq acctype AccType_ORDEREDRW) (eq acctype AccType_LIMITEDORDERED)) in
let (vector_name : bool) = eq acctype AccType_VEC in
(aget_SCTLR__1 () : M (list bitU)) >>= fun (w__0 : list bitU) ->
let (check' : bool) =
or_bool (or_bool atomic ordered) (eq_vec ([access_vec_dec w__0 (1:ii)]) ([B1])) in
let (secondstage : bool) = undefined_bool () in
(if (and_bool check' (not aligned))
then
let secondstage = false in
AArch64_Abort address (AArch64_AlignmentFault acctype iswrite secondstage) >>
return secondstage
else return secondstage) >>= fun (secondstage : bool) ->
return aligned
val aset_Mem : list bitU -> integer -> AccType -> list bitU -> M unit
let aset_Mem address size acctype value_name__arg =
let value_name = value_name__arg in
let (i : ii) = undefined_int () in
let (iswrite : bool) = true in
BigEndian () >>= fun (w__0 : bool) ->
(if w__0
then
(BigEndianReverse value_name : M (list bitU)) >>= fun (w__1 : list bitU) ->
let (value_name : list bitU) = w__1 in
return value_name
else return value_name) >>= fun (value_name : list bitU) ->
AArch64_CheckAlignment address size acctype iswrite >>= fun (aligned : bool) ->
let (atomic : bool) = undefined_bool () in
let (atomic : bool) =
if (or_bool
(neq size (16:ii))
(not (or_bool (eq acctype AccType_VEC) (eq acctype AccType_VECSTREAM))))
then
let (atomic : bool) = aligned in
atomic
else
let (atomic : bool) = eq_vec address (Align__1 address (8:ii) : list bitU) in
atomic in
let (c : Constraint) = undefined_Constraint () in
(if (not atomic)
then
assert_exp (gt size (1:ii)) "(size > 1)" >>
AArch64_aset_MemSingle
address
(1:ii)
acctype
aligned
(slice value_name (0:ii) (8:ii) : list bitU) >>
(if (not aligned)
then
let c = ConstrainUnpredictable Unpredictable_DEVPAGE2 in
assert_exp (or_bool (eq c Constraint_FAULT) (eq c Constraint_NONE)) "((c == Constraint_FAULT) || (c == Constraint_NONE))" >>
let (aligned : bool) =
if (eq c Constraint_NONE)
then
let (aligned : bool) = true in
aligned
else aligned in
return (aligned,c)
else return (aligned,c)) >>= fun ((aligned : bool), (c : Constraint)) ->
(foreachM (index_list (1:ii) (integerMinus size (1:ii)) (1:ii)) ()
(fun i () ->
AArch64_aset_MemSingle
(add_vec_int address i : list bitU)
(1:ii)
acctype
aligned
(slice value_name (integerMult (8:ii) i) (8:ii) : list bitU))) >>
return (aligned,c)
else
(if (and_bool
(eq size (16:ii))
(or_bool (eq acctype AccType_VEC) (eq acctype AccType_VECSTREAM)))
then
AArch64_aset_MemSingle
address
(8:ii)
acctype
aligned
(slice value_name (0:ii) (64:ii) : list bitU) >>
AArch64_aset_MemSingle
(add_vec_int address (8:ii) : list bitU)
(8:ii)
acctype
aligned
(slice value_name (64:ii) (64:ii) : list bitU)
else AArch64_aset_MemSingle address size acctype aligned value_name) >>
return (aligned,c)) >>= fun ((aligned : bool), (c : Constraint)) ->
return ()
val aget_Mem : list bitU -> integer -> AccType -> M (list bitU)
let aget_Mem address size acctype =
assert_exp (or_bool
(eq size (1:ii))
(or_bool
(eq size (2:ii))
(or_bool (eq size (4:ii)) (or_bool (eq size (8:ii)) (eq size (16:ii)))))) "((size == 1) || ((size == 2) || ((size == 4) || ((size == 8) || (size == 16)))))" >>
let value_name = (undefined_vector (integerMult (8:ii) size) (undefined_bit ()) : list bitU) in
let (i : ii) = undefined_int () in
let (iswrite : bool) = false in
AArch64_CheckAlignment address size acctype iswrite >>= fun (aligned : bool) ->
let (atomic : bool) = undefined_bool () in
let (atomic : bool) =
if (or_bool
(neq size (16:ii))
(not (or_bool (eq acctype AccType_VEC) (eq acctype AccType_VECSTREAM))))
then
let (atomic : bool) = aligned in
atomic
else
let (atomic : bool) = eq_vec address (Align__1 address (8:ii) : list bitU) in
atomic in
let (c : Constraint) = undefined_Constraint () in
(if (not atomic)
then
assert_exp (gt size (1:ii)) "(size > 1)" >>
(AArch64_aget_MemSingle address (1:ii) acctype aligned : M (list bitU)) >>= fun (w__0 :
list bitU) ->
let value_name =
(set_slice (integerMult (8:ii) size) (8:ii) value_name (0:ii) w__0 : list bitU) in
(if (not aligned)
then
let c = ConstrainUnpredictable Unpredictable_DEVPAGE2 in
assert_exp (or_bool (eq c Constraint_FAULT) (eq c Constraint_NONE)) "((c == Constraint_FAULT) || (c == Constraint_NONE))" >>
let (aligned : bool) =
if (eq c Constraint_NONE)
then
let (aligned : bool) = true in
aligned
else aligned in
return (aligned,c)
else return (aligned,c)) >>= fun ((aligned : bool), (c : Constraint)) ->
(foreachM (index_list (1:ii) (integerMinus size (1:ii)) (1:ii)) value_name
(fun i value_name ->
(AArch64_aget_MemSingle (add_vec_int address i : list bitU) (1:ii) acctype aligned : M (list bitU)) >>= fun (w__1 :
list bitU) ->
let value_name =
(set_slice (integerMult (8:ii) size) (8:ii) value_name (integerMult (8:ii) i) w__1 : list bitU) in
return value_name)) >>= fun value_name ->
return (aligned,c,value_name)
else
(if (and_bool
(eq size (16:ii))
(or_bool (eq acctype AccType_VEC) (eq acctype AccType_VECSTREAM)))
then
(AArch64_aget_MemSingle address (8:ii) acctype aligned : M (list bitU)) >>= fun (w__2 :
list bitU) ->
let value_name =
(set_slice (integerMult (8:ii) size) (64:ii) value_name (0:ii) w__2 : list bitU) in
(AArch64_aget_MemSingle (add_vec_int address (8:ii) : list bitU) (8:ii) acctype aligned : M (list bitU)) >>= fun (w__3 :
list bitU) ->
let value_name =
(set_slice (integerMult (8:ii) size) (64:ii) value_name (64:ii) w__3 : list bitU) in
return value_name
else
(AArch64_aget_MemSingle address size acctype aligned : M (list bitU)) >>= fun w__4 ->
let value_name = w__4 in
return value_name) >>= fun value_name ->
return (aligned,c,value_name)) >>= fun ((aligned : bool), (c : Constraint), value_name) ->
BigEndian () >>= fun (w__5 : bool) ->
(if w__5
then
(BigEndianReverse value_name : M (list bitU)) >>= fun w__6 ->
let value_name = w__6 in
return value_name
else return value_name) >>= fun value_name ->
return value_name
val AArch32_EnterMode : list bitU -> list bitU -> ii -> ii -> M unit
let AArch32_EnterMode target_mode preferred_exception_return lr_offset vect_offset =
let (_ : unit) = SynchronizeContext () in
ELUsingAArch32 EL1 >>= fun (w__0 : bool) ->
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
assert_exp (and_bool w__0 (neq_vec w__1.ProcState_EL EL2)) "(ELUsingAArch32(EL1) && ((PSTATE).EL != EL2))" >>
(GetPSRFromPSTATE () : M (list bitU)) >>= fun (spsr : bits ty32) ->
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
(if (eq_vec w__2.ProcState_M M32_Monitor)
then
(read_reg SCR_ref : M (list bitU)) >>= fun (w__3 : list bitU) ->
write_reg SCR_ref (set_slice (32:ii) (1:ii) w__3 (0:ii) ([B0]) : list bitU)
else return ()) >>
AArch32_WriteMode target_mode >>
aset_SPSR spsr >>
aset_R (14:ii) (add_vec_int preferred_exception_return lr_offset : list bitU) >>
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
(read_reg SCTLR_ref : M (list bitU)) >>= fun (w__5 : bits ty32) ->
write_reg PSTATE_ref <|w__4 with ProcState_T = ([access_vec_dec w__5 (30:ii)])|> >>
read_reg PSTATE_ref >>= fun (w__6 : ProcState) ->
write_reg PSTATE_ref <|w__6 with ProcState_SS = ([B0])|> >>
(if (eq_vec target_mode M32_FIQ)
then
let split_vec = [B1;B1;B1] in
let (tup__0, tup__1, tup__2) =
((subrange_vec_dec split_vec (2:ii) (2:ii) : list bitU),(subrange_vec_dec
split_vec
(1:ii)
(1:ii) : list bitU),(subrange_vec_dec
split_vec
(0:ii)
(0:ii) : list bitU)) in
read_reg PSTATE_ref >>= fun (w__7 : ProcState) ->
write_reg PSTATE_ref <|w__7 with ProcState_A = tup__0|> >>
read_reg PSTATE_ref >>= fun (w__8 : ProcState) ->
write_reg PSTATE_ref <|w__8 with ProcState_I = tup__1|> >>
read_reg PSTATE_ref >>= fun (w__9 : ProcState) ->
write_reg PSTATE_ref <|w__9 with ProcState_F = tup__2|>
else
if (or_bool (eq_vec target_mode M32_Abort) (eq_vec target_mode M32_IRQ))
then
let split_vec = [B1;B1] in
let (tup__0, tup__1) =
((subrange_vec_dec split_vec (1:ii) (1:ii) : list bitU),(subrange_vec_dec
split_vec
(0:ii)
(0:ii) : list bitU)) in
read_reg PSTATE_ref >>= fun (w__10 : ProcState) ->
write_reg PSTATE_ref <|w__10 with ProcState_A = tup__0|> >>
read_reg PSTATE_ref >>= fun (w__11 : ProcState) ->
write_reg PSTATE_ref <|w__11 with ProcState_I = tup__1|>
else
read_reg PSTATE_ref >>= fun (w__12 : ProcState) ->
write_reg PSTATE_ref <|w__12 with ProcState_I = ([B1])|>) >>
read_reg PSTATE_ref >>= fun (w__13 : ProcState) ->
(read_reg SCTLR_ref : M (list bitU)) >>= fun (w__14 : bits ty32) ->
write_reg PSTATE_ref <|w__13 with ProcState_E = ([access_vec_dec w__14 (25:ii)])|> >>
read_reg PSTATE_ref >>= fun (w__15 : ProcState) ->
write_reg PSTATE_ref <|w__15 with ProcState_IL = ([B0])|> >>
read_reg PSTATE_ref >>= fun (w__16 : ProcState) ->
write_reg PSTATE_ref <|w__16 with ProcState_IT = ([B0;B0;B0;B0;B0;B0;B0;B0])|> >>
(read_reg SCTLR_ref : M (list bitU)) >>= fun (w__17 : bits ty32) ->
(if (and_bool (HavePANExt ()) (eq_vec ([access_vec_dec w__17 (23:ii)]) ([B0])))
then
read_reg PSTATE_ref >>= fun (w__18 : ProcState) ->
write_reg PSTATE_ref <|w__18 with ProcState_PAN = ([B1])|>
else return ()) >>
(ExcVectorBase () : M (list bitU)) >>= fun (w__19 : list bitU) ->
BranchTo
(concat_vec
(slice w__19 (5:ii) (27:ii) : list bitU)
(__GetSlice_int (5:ii) vect_offset (0:ii) : list bitU) : list bitU)
BranchType_UNKNOWN >>
return (EndOfInstruction ())
val AArch32_GeneralExceptionsToAArch64 : unit -> M bool
let AArch32_GeneralExceptionsToAArch64 () =
read_reg PSTATE_ref >>= fun (w__0 : ProcState) ->
ELUsingAArch32 EL1 >>= fun (w__1 : bool) ->
IsSecure () >>= fun (w__2 : bool) ->
ELUsingAArch32 EL2 >>= fun (w__3 : bool) ->
(read_reg HCR_EL2_ref : M (list bitU)) >>= fun (w__4 : bits ty64) ->
return (or_bool
(and_bool (eq_vec w__0.ProcState_EL EL0) (not w__1))
(and_bool
(and_bool (and_bool (HaveEL EL2) (not w__2)) (not w__3))
(eq_vec ([access_vec_dec w__4 (27:ii)]) ([B1]))))
val AArch32_EnterHypMode : ExceptionRecord -> list bitU -> ii -> M unit
let AArch32_EnterHypMode exception preferred_exception_return vect_offset =
let (_ : unit) = SynchronizeContext () in
IsSecure () >>= fun (w__0 : bool) ->
ELUsingAArch32 EL2 >>= fun (w__1 : bool) ->
assert_exp (and_bool (and_bool (HaveEL EL2) (not w__0)) w__1) "((HaveEL(EL2) && !(IsSecure())) && ELUsingAArch32(EL2))" >>
(GetPSRFromPSTATE () : M (list bitU)) >>= fun (spsr : bits ty32) ->
(if (not
(or_bool
(eq exception.ExceptionRecord_typ Exception_IRQ)
(eq exception.ExceptionRecord_typ Exception_FIQ)))
then AArch32_ReportHypEntry exception
else return ()) >>
AArch32_WriteMode M32_Hyp >>
aset_SPSR spsr >>
write_reg ELR_hyp_ref preferred_exception_return >>
read_reg PSTATE_ref >>= fun (w__2 : ProcState) ->
(read_reg HSCTLR_ref : M (list bitU)) >>= fun (w__3 : bits ty32) ->
write_reg PSTATE_ref <|w__2 with ProcState_T = ([access_vec_dec w__3 (30:ii)])|> >>
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
write_reg PSTATE_ref <|w__4 with ProcState_SS = ([B0])|> >>
(aget_SCR_GEN () : M (list bitU)) >>= fun (w__5 : list bitU) ->
(if (or_bool (not (HaveEL EL3)) (eq_vec ([access_vec_dec w__5 (3:ii)]) ([B0])))
then
read_reg PSTATE_ref >>= fun (w__6 : ProcState) ->
write_reg PSTATE_ref <|w__6 with ProcState_A = ([B1])|>
else return ()) >>
(aget_SCR_GEN () : M (list bitU)) >>= fun (w__7 : list bitU) ->
(if (or_bool (not (HaveEL EL3)) (eq_vec ([access_vec_dec w__7 (1:ii)]) ([B0])))
then
read_reg PSTATE_ref >>= fun (w__8 : ProcState) ->
write_reg PSTATE_ref <|w__8 with ProcState_I = ([B1])|>
else return ()) >>
(aget_SCR_GEN () : M (list bitU)) >>= fun (w__9 : list bitU) ->
(if (or_bool (not (HaveEL EL3)) (eq_vec ([access_vec_dec w__9 (2:ii)]) ([B0])))
then
read_reg PSTATE_ref >>= fun (w__10 : ProcState) ->
write_reg PSTATE_ref <|w__10 with ProcState_F = ([B1])|>
else return ()) >>
read_reg PSTATE_ref >>= fun (w__11 : ProcState) ->
(read_reg HSCTLR_ref : M (list bitU)) >>= fun (w__12 : bits ty32) ->
write_reg PSTATE_ref <|w__11 with ProcState_E = ([access_vec_dec w__12 (25:ii)])|> >>
read_reg PSTATE_ref >>= fun (w__13 : ProcState) ->
write_reg PSTATE_ref <|w__13 with ProcState_IL = ([B0])|> >>
read_reg PSTATE_ref >>= fun (w__14 : ProcState) ->
write_reg PSTATE_ref <|w__14 with ProcState_IT = ([B0;B0;B0;B0;B0;B0;B0;B0])|> >>
(read_reg HVBAR_ref : M (list bitU)) >>= fun (w__15 : bits ty32) ->
BranchTo
(concat_vec
(slice w__15 (5:ii) (27:ii) : list bitU)
(__GetSlice_int (5:ii) vect_offset (0:ii) : list bitU) : list bitU)
BranchType_UNKNOWN >>
return (EndOfInstruction ())
val AArch32_TakeUndefInstrException__0 : unit -> M unit
val AArch32_TakeUndefInstrException__1 : ExceptionRecord -> M unit
let AArch32_TakeUndefInstrException__1 exception =
IsSecure () >>= fun (w__0 : bool) ->
read_reg PSTATE_ref >>= fun (w__1 : ProcState) ->
(read_reg HCR_ref : M (list bitU)) >>= fun (w__2 : bits ty32) ->
let (route_to_hyp : bool) =
and_bool
(and_bool (and_bool (HaveEL EL2) (not w__0)) (eq_vec w__1.ProcState_EL EL0))
(eq_vec ([access_vec_dec w__2 (27:ii)]) ([B1])) in
(ThisInstrAddr (32:ii) () : M (list bitU)) >>= fun (preferred_exception_return : bits ty32) ->
let (vect_offset : ii) = (4:ii) in
CurrentInstrSet () >>= fun (w__3 : InstrSet) ->
let (lr_offset : ii) = if (eq w__3 InstrSet_A32) then (4:ii) else (2:ii) in
read_reg PSTATE_ref >>= fun (w__4 : ProcState) ->
if (eq_vec w__4.ProcState_EL EL2)
then AArch32_EnterHypMode exception preferred_exception_return vect_offset
else
if route_to_hyp
then AArch32_EnterHypMode exception preferred_exception_return (20:ii)
else AArch32_EnterMode M32_Undef preferred_exception_return lr_offset vect_offset
let AArch32_TakeUndefInstrException__0 () =
let (exception : ExceptionRecord) = ExceptionSyndrome Exception_Uncategorized in
AArch32_TakeUndefInstrException__1 exception
val UnallocatedEncoding : unit -> M unit
let UnallocatedEncoding () =
UsingAArch32 () >>= fun (w__0 : bool) ->
AArch32_ExecutingCP10or11Instr () >>= fun (w__1 : bool) ->
(if (and_bool w__0 w__1)
then
(read_reg FPEXC_ref : M (list bitU)) >>= fun (w__2 : list bitU) ->
write_reg FPEXC_ref (set_slice (32:ii) (1:ii) w__2 (29:ii) ([B0]) : list bitU)
else return ()) >>
UsingAArch32 () >>= fun (w__3 : bool) ->
AArch32_GeneralExceptionsToAArch64 () >>= fun (w__4 : bool) ->
if (and_bool w__3 (not w__4))
then AArch32_TakeUndefInstrException__0 ()
else AArch64_UndefinedFault ()
val aarch64_memory_single_general_immediate_unsigned : AccType -> integer -> MemOp -> ii -> list bitU -> bool -> integer -> bool -> ii -> bool -> M unit
let aarch64_memory_single_general_immediate_unsigned acctype datasize memop n offset postindex regsize signed t wback__arg =
assert_exp true "destsize constraint" >>
let dbytes = ex_int (integerDiv datasize (8:ii)) in
assert_exp true "datasize constraint" >>
assert_exp true "dbytes constraint" >>
let wback = wback__arg in
let (address : bits ty64) = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) in
let data = (undefined_vector datasize (undefined_bit ()) : list bitU) in
let (wb_unknown : bool) = false in
let (rt_unknown : bool) = false in
let (c : Constraint) = undefined_Constraint () in
(if (and_bool
(and_bool (and_bool (eq memop MemOp_LOAD) wback) (eq (ex_int n) (ex_int t)))
(neq (ex_int n) (31:ii)))
then
let c = ConstrainUnpredictable Unpredictable_WBOVERLAPLD in
assert_exp (or_bool
(eq c Constraint_WBSUPPRESS)
(or_bool
(eq c Constraint_UNKNOWN)
(or_bool (eq c Constraint_UNDEF) (eq c Constraint_NOP)))) "((c == Constraint_WBSUPPRESS) || ((c == Constraint_UNKNOWN) || ((c == Constraint_UNDEF) || (c == Constraint_NOP))))" >>
match c with
| Constraint_WBSUPPRESS ->
let (wback : bool) = false in
return (wb_unknown,wback)
| Constraint_UNKNOWN ->
let (wb_unknown : bool) = true in
return (wb_unknown,wback)
| Constraint_UNDEF ->
UnallocatedEncoding () >>
return (wb_unknown,wback)
| Constraint_NOP -> return (wb_unknown,wback)
end >>= fun ((wb_unknown : bool), (wback : bool)) ->
return (c,wb_unknown,wback)
else return (c,wb_unknown,wback)) >>= fun ((c : Constraint), (wb_unknown : bool), (wback : bool)) ->
(if (and_bool
(and_bool (and_bool (eq memop MemOp_STORE) wback) (eq (ex_int n) (ex_int t)))
(neq (ex_int n) (31:ii)))
then
let c = ConstrainUnpredictable Unpredictable_WBOVERLAPST in
assert_exp (or_bool
(eq c Constraint_NONE)
(or_bool
(eq c Constraint_UNKNOWN)
(or_bool (eq c Constraint_UNDEF) (eq c Constraint_NOP)))) "((c == Constraint_NONE) || ((c == Constraint_UNKNOWN) || ((c == Constraint_UNDEF) || (c == Constraint_NOP))))" >>
match c with
| Constraint_NONE ->
let (rt_unknown : bool) = false in
return rt_unknown
| Constraint_UNKNOWN ->
let (rt_unknown : bool) = true in
return rt_unknown
| Constraint_UNDEF ->
UnallocatedEncoding () >>
return rt_unknown
| Constraint_NOP -> return rt_unknown
end >>= fun (rt_unknown : bool) ->
return (c,rt_unknown)
else return (c,rt_unknown)) >>= fun ((c : Constraint), (rt_unknown : bool)) ->
(if (eq (ex_int n) (31:ii))
then
(if (neq memop MemOp_PREFETCH)
then CheckSPAlignment ()
else return ()) >>
(aget_SP (64:ii) () : M (list bitU)) >>= fun (w__0 : bits ty64) ->
let (address : bits ty64) = w__0 in
return address
else
(aget_X (64:ii) n : M (list bitU)) >>= fun (w__1 : bits ty64) ->
let (address : bits ty64) = w__1 in
return address) >>= fun (address : bits ty64) ->
let (address : bits ty64) =
if (not postindex)
then
let (address : bits ty64) = (add_vec address offset : list bitU) in
address
else address in
match memop with
| MemOp_STORE ->
(if rt_unknown
then
let data = (undefined_vector (length data) (undefined_bit ()) : list bitU) in
return data
else
(aget_X (length data) t : M (list bitU)) >>= fun w__2 ->
let data = w__2 in
return data) >>= fun data ->
aset_Mem address dbytes acctype data >>
return data
| MemOp_LOAD ->
(aget_Mem address dbytes acctype : M (list bitU)) >>= fun w__3 ->
let data = w__3 in
(if signed
then
(SignExtend__0 data regsize : M (list bitU)) >>= fun (w__4 : list bitU) ->
aset_X t w__4
else
(ZeroExtend__0 data regsize : M (list bitU)) >>= fun (w__5 : list bitU) ->
aset_X t w__5) >>
return data
| MemOp_PREFETCH -> return data
end >>= fun data ->
(if wback
then
let (address : bits ty64) =
if wb_unknown
then
let (address : bits ty64) = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) in
address
else
let (address : bits ty64) =
if postindex
then
let (address : bits ty64) = (add_vec address offset : list bitU) in
address
else address in
address in
(if (eq (ex_int n) (31:ii))
then aset_SP address
else aset_X n address) >>
return address
else return address) >>= fun (address : bits ty64) ->
return ()
val aarch64_memory_single_general_immediate_signed_postidx : AccType -> integer -> MemOp -> ii -> list bitU -> bool -> integer -> bool -> ii -> bool -> M unit
let aarch64_memory_single_general_immediate_signed_postidx acctype datasize memop n offset postindex regsize signed t wback__arg =
assert_exp true "destsize constraint" >>
let dbytes = ex_int (integerDiv datasize (8:ii)) in
assert_exp true "datasize constraint" >>
assert_exp true "dbytes constraint" >>
let wback = wback__arg in
let (address : bits ty64) = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) in
let data = (undefined_vector datasize (undefined_bit ()) : list bitU) in
let (wb_unknown : bool) = false in
let (rt_unknown : bool) = false in
let (c : Constraint) = undefined_Constraint () in
(if (and_bool
(and_bool (and_bool (eq memop MemOp_LOAD) wback) (eq (ex_int n) (ex_int t)))
(neq (ex_int n) (31:ii)))
then
let c = ConstrainUnpredictable Unpredictable_WBOVERLAPLD in
assert_exp (or_bool
(eq c Constraint_WBSUPPRESS)
(or_bool
(eq c Constraint_UNKNOWN)
(or_bool (eq c Constraint_UNDEF) (eq c Constraint_NOP)))) "((c == Constraint_WBSUPPRESS) || ((c == Constraint_UNKNOWN) || ((c == Constraint_UNDEF) || (c == Constraint_NOP))))" >>
match c with
| Constraint_WBSUPPRESS ->
let (wback : bool) = false in
return (wb_unknown,wback)
| Constraint_UNKNOWN ->
let (wb_unknown : bool) = true in
return (wb_unknown,wback)
| Constraint_UNDEF ->
UnallocatedEncoding () >>
return (wb_unknown,wback)
| Constraint_NOP -> return (wb_unknown,wback)
end >>= fun ((wb_unknown : bool), (wback : bool)) ->
return (c,wb_unknown,wback)
else return (c,wb_unknown,wback)) >>= fun ((c : Constraint), (wb_unknown : bool), (wback : bool)) ->
(if (and_bool
(and_bool (and_bool (eq memop MemOp_STORE) wback) (eq (ex_int n) (ex_int t)))
(neq (ex_int n) (31:ii)))
then
let c = ConstrainUnpredictable Unpredictable_WBOVERLAPST in
assert_exp (or_bool
(eq c Constraint_NONE)
(or_bool
(eq c Constraint_UNKNOWN)
(or_bool (eq c Constraint_UNDEF) (eq c Constraint_NOP)))) "((c == Constraint_NONE) || ((c == Constraint_UNKNOWN) || ((c == Constraint_UNDEF) || (c == Constraint_NOP))))" >>
match c with
| Constraint_NONE ->
let (rt_unknown : bool) = false in
return rt_unknown
| Constraint_UNKNOWN ->
let (rt_unknown : bool) = true in
return rt_unknown
| Constraint_UNDEF ->
UnallocatedEncoding () >>
return rt_unknown
| Constraint_NOP -> return rt_unknown
end >>= fun (rt_unknown : bool) ->
return (c,rt_unknown)
else return (c,rt_unknown)) >>= fun ((c : Constraint), (rt_unknown : bool)) ->
(if (eq (ex_int n) (31:ii))
then
(if (neq memop MemOp_PREFETCH)
then CheckSPAlignment ()
else return ()) >>
(aget_SP (64:ii) () : M (list bitU)) >>= fun (w__0 : bits ty64) ->
let (address : bits ty64) = w__0 in
return address
else
(aget_X (64:ii) n : M (list bitU)) >>= fun (w__1 : bits ty64) ->
let (address : bits ty64) = w__1 in
return address) >>= fun (address : bits ty64) ->
let (address : bits ty64) =
if (not postindex)
then
let (address : bits ty64) = (add_vec address offset : list bitU) in
address
else address in
match memop with
| MemOp_STORE ->
(if rt_unknown
then
let data = (undefined_vector (length data) (undefined_bit ()) : list bitU) in
return data
else
(aget_X (length data) t : M (list bitU)) >>= fun w__2 ->
let data = w__2 in
return data) >>= fun data ->
aset_Mem address dbytes acctype data >>
return data
| MemOp_LOAD ->
(aget_Mem address dbytes acctype : M (list bitU)) >>= fun w__3 ->
let data = w__3 in
(if signed
then
(SignExtend__0 data regsize : M (list bitU)) >>= fun (w__4 : list bitU) ->
aset_X t w__4
else
(ZeroExtend__0 data regsize : M (list bitU)) >>= fun (w__5 : list bitU) ->
aset_X t w__5) >>
return data
| MemOp_PREFETCH -> return data
end >>= fun data ->
(if wback
then
let (address : bits ty64) =
if wb_unknown
then
let (address : bits ty64) = (undefined_vector (64:ii) (undefined_bit ()) : list bitU) in
address
else
let (address : bits ty64) =
if postindex
then
let (address : bits ty64) = (add_vec address offset : list bitU) in
address
else address in
address in
(if (eq (ex_int n) (31:ii))
then aset_SP address
else aset_X n address) >>
return address
else return address) >>= fun (address : bits ty64) ->
return ()
val memory_single_general_immediate_unsigned_aarch64_memory_single_general_immediate_unsigned__decode : list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> M unit
let memory_single_general_immediate_unsigned_aarch64_memory_single_general_immediate_unsigned__decode size V opc imm12 Rn Rt =
write_reg __unconditional_ref true >>
let (wback : bool) = false in
let (postindex : bool) = false in
let (scale : ii) = uint size in
(ZeroExtend__0 imm12 (64:ii) : M (list bitU)) >>= fun (w__0 : list bitU) ->
(LSL w__0 scale : M (list bitU)) >>= fun (offset : bits ty64) ->
let (n : ii) = uint Rn in
let (t : ii) = uint Rt in
let (acctype : AccType) = AccType_NORMAL in
let (memop : MemOp) = undefined_MemOp () in
let (signed : bool) = undefined_bool () in
let (regsize : ii) = undefined_int () in
(if (eq_vec ([access_vec_dec opc (1:ii)]) ([B0]))
then
let (memop : MemOp) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then MemOp_LOAD
else MemOp_STORE in
let (regsize : ii) = if (eq_vec size ([B1;B1])) then (64:ii) else (32:ii) in
let (signed : bool) = false in
return (memop,regsize,signed)
else
(if (eq_vec size ([B1;B1]))
then
let memop = MemOp_PREFETCH in
(if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then UnallocatedEncoding ()
else return ()) >>
return (memop,regsize,signed)
else
let memop = MemOp_LOAD in
(if (and_bool (eq_vec size ([B1;B0])) (eq_vec ([access_vec_dec opc (0:ii)]) ([B1])))
then UnallocatedEncoding ()
else return ()) >>
let (regsize : ii) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then (32:ii)
else (64:ii) in
let (signed : bool) = true in
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
let (datasize : ii) = shl_int (8:ii) scale in
aarch64_memory_single_general_immediate_unsigned
acctype
(ex_int datasize)
memop
n
offset
postindex
(ex_int regsize)
signed
t
wback
val memory_single_general_immediate_unsigned_aarch64_memory_single_general_immediate_signed_postidx__decode : list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> M unit
let memory_single_general_immediate_unsigned_aarch64_memory_single_general_immediate_signed_postidx__decode size V opc imm12 Rn Rt =
write_reg __unconditional_ref true >>
let (wback : bool) = false in
let (postindex : bool) = false in
let (scale : ii) = uint size in
(ZeroExtend__0 imm12 (64:ii) : M (list bitU)) >>= fun (w__0 : list bitU) ->
(LSL w__0 scale : M (list bitU)) >>= fun (offset : bits ty64) ->
let (n : ii) = uint Rn in
let (t : ii) = uint Rt in
let (acctype : AccType) = AccType_NORMAL in
let (memop : MemOp) = undefined_MemOp () in
let (signed : bool) = undefined_bool () in
let (regsize : ii) = undefined_int () in
(if (eq_vec ([access_vec_dec opc (1:ii)]) ([B0]))
then
let (memop : MemOp) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then MemOp_LOAD
else MemOp_STORE in
let (regsize : ii) = if (eq_vec size ([B1;B1])) then (64:ii) else (32:ii) in
let (signed : bool) = false in
return (memop,regsize,signed)
else
(if (eq_vec size ([B1;B1]))
then
UnallocatedEncoding () >>
return (memop,regsize,signed)
else
let memop = MemOp_LOAD in
(if (and_bool (eq_vec size ([B1;B0])) (eq_vec ([access_vec_dec opc (0:ii)]) ([B1])))
then UnallocatedEncoding ()
else return ()) >>
let (regsize : ii) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then (32:ii)
else (64:ii) in
let (signed : bool) = true in
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
let (datasize : ii) = shl_int (8:ii) scale in
aarch64_memory_single_general_immediate_signed_postidx
acctype
(ex_int datasize)
memop
n
offset
postindex
(ex_int regsize)
signed
t
wback
val memory_single_general_immediate_signed_preidx_aarch64_memory_single_general_immediate_signed_postidx__decode : list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> M unit
let memory_single_general_immediate_signed_preidx_aarch64_memory_single_general_immediate_signed_postidx__decode size V opc imm9 Rn Rt =
write_reg __unconditional_ref true >>
let (wback : bool) = true in
let (postindex : bool) = false in
let (scale : ii) = uint size in
(SignExtend__0 imm9 (64:ii) : M (list bitU)) >>= fun (offset : bits ty64) ->
let (n : ii) = uint Rn in
let (t : ii) = uint Rt in
let (acctype : AccType) = AccType_NORMAL in
let (memop : MemOp) = undefined_MemOp () in
let (signed : bool) = undefined_bool () in
let (regsize : ii) = undefined_int () in
(if (eq_vec ([access_vec_dec opc (1:ii)]) ([B0]))
then
let (memop : MemOp) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then MemOp_LOAD
else MemOp_STORE in
let (regsize : ii) = if (eq_vec size ([B1;B1])) then (64:ii) else (32:ii) in
let (signed : bool) = false in
return (memop,regsize,signed)
else
(if (eq_vec size ([B1;B1]))
then
UnallocatedEncoding () >>
return (memop,regsize,signed)
else
let memop = MemOp_LOAD in
(if (and_bool (eq_vec size ([B1;B0])) (eq_vec ([access_vec_dec opc (0:ii)]) ([B1])))
then UnallocatedEncoding ()
else return ()) >>
let (regsize : ii) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then (32:ii)
else (64:ii) in
let (signed : bool) = true in
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
let (datasize : ii) = shl_int (8:ii) scale in
aarch64_memory_single_general_immediate_signed_postidx
acctype
(ex_int datasize)
memop
n
offset
postindex
(ex_int regsize)
signed
t
wback
val memory_single_general_immediate_signed_postidx_aarch64_memory_single_general_immediate_signed_postidx__decode : list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> M unit
let memory_single_general_immediate_signed_postidx_aarch64_memory_single_general_immediate_signed_postidx__decode size V opc imm9 Rn Rt =
write_reg __unconditional_ref true >>
let (wback : bool) = true in
let (postindex : bool) = true in
let (scale : ii) = uint size in
(SignExtend__0 imm9 (64:ii) : M (list bitU)) >>= fun (offset : bits ty64) ->
let (n : ii) = uint Rn in
let (t : ii) = uint Rt in
let (acctype : AccType) = AccType_NORMAL in
let (memop : MemOp) = undefined_MemOp () in
let (signed : bool) = undefined_bool () in
let (regsize : ii) = undefined_int () in
(if (eq_vec ([access_vec_dec opc (1:ii)]) ([B0]))
then
let (memop : MemOp) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then MemOp_LOAD
else MemOp_STORE in
let (regsize : ii) = if (eq_vec size ([B1;B1])) then (64:ii) else (32:ii) in
let (signed : bool) = false in
return (memop,regsize,signed)
else
(if (eq_vec size ([B1;B1]))
then
UnallocatedEncoding () >>
return (memop,regsize,signed)
else
let memop = MemOp_LOAD in
(if (and_bool (eq_vec size ([B1;B0])) (eq_vec ([access_vec_dec opc (0:ii)]) ([B1])))
then UnallocatedEncoding ()
else return ()) >>
let (regsize : ii) =
if (eq_vec ([access_vec_dec opc (0:ii)]) ([B1]))
then (32:ii)
else (64:ii) in
let (signed : bool) = true in
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
return (memop,regsize,signed)) >>= fun ((memop : MemOp), (regsize : ii), (signed : bool)) ->
let (datasize : ii) = shl_int (8:ii) scale in
aarch64_memory_single_general_immediate_signed_postidx
acctype
(ex_int datasize)
memop
n
offset
postindex
(ex_int regsize)
signed
t
wback
val ReservedValue : unit -> M unit
let ReservedValue () =
UsingAArch32 () >>= fun (w__0 : bool) ->
AArch32_GeneralExceptionsToAArch64 () >>= fun (w__1 : bool) ->
if (and_bool w__0 (not w__1))
then AArch32_TakeUndefInstrException__0 ()
else AArch64_UndefinedFault ()
val integer_arithmetic_addsub_immediate_decode : list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> list bitU -> M unit
let integer_arithmetic_addsub_immediate_decode sf op S shift imm12 Rn Rd =
write_reg __unconditional_ref true >>
let (d : ii) = uint Rd in
let (n : ii) = uint Rn in
let (datasize : integer) = if (eq_vec sf ([B1])) then (64:ii) else (32:ii) in
let (sub_op : bool) = eq_vec op ([B1]) in
let (setflags : bool) = eq_vec S ([B1]) in
let imm = (undefined_vector datasize (undefined_bit ()) : list bitU) in
let b__0 = shift in
(if (eq_vec b__0 ([B0;B0]))
then
(ZeroExtend__0 imm12 datasize : M (list bitU)) >>= fun w__0 ->
let imm = w__0 in
return imm
else
(if (eq_vec b__0 ([B0;B1]))
then
(ZeroExtend__0 (concat_vec imm12 (Zeros__0 (12:ii) : list bitU) : list bitU) datasize : M (list bitU)) >>= fun w__1 ->
let imm = w__1 in
return imm
else
ReservedValue () >>
return imm) >>= fun imm ->
return imm) >>= fun imm ->
aarch64_integer_arithmetic_addsub_immediate d datasize imm n setflags sub_op
val decode : list bitU -> M unit
let decode op_code =
if (eq_vec (subrange_vec_dec op_code (29:ii) (24:ii) : list bitU) ([B1;B1;B1;B0;B0;B1]))
then
let (size : bits ty2) = (subrange_vec_dec op_code (31:ii) (30:ii) : list bitU) in
let (V : bits ty1) = [access_vec_dec op_code (26:ii)] in
let (opc : bits ty2) = (subrange_vec_dec op_code (23:ii) (22:ii) : list bitU) in
let (imm12 : bits ty12) = (subrange_vec_dec op_code (21:ii) (10:ii) : list bitU) in
let (Rn : bits ty5) = (subrange_vec_dec op_code (9:ii) (5:ii) : list bitU) in
let (Rt : bits ty5) = (subrange_vec_dec op_code (4:ii) (0:ii) : list bitU) in
memory_single_general_immediate_unsigned_aarch64_memory_single_general_immediate_unsigned__decode
size
V
opc
imm12
Rn
Rt
else
if (and_bool
(eq_vec (subrange_vec_dec op_code (29:ii) (24:ii) : list bitU) ([B1;B1;B1;B0;B0;B0]))
(and_bool
(eq_vec (subrange_vec_dec op_code (21:ii) (21:ii) : list bitU) ([B0]))
(eq_vec (subrange_vec_dec op_code (11:ii) (10:ii) : list bitU) ([B0;B1]))))
then
let (size : bits ty2) = (subrange_vec_dec op_code (31:ii) (30:ii) : list bitU) in
let (V : bits ty1) = [access_vec_dec op_code (26:ii)] in
let (opc : bits ty2) = (subrange_vec_dec op_code (23:ii) (22:ii) : list bitU) in
let (imm9 : bits ty9) = (subrange_vec_dec op_code (20:ii) (12:ii) : list bitU) in
let (Rn : bits ty5) = (subrange_vec_dec op_code (9:ii) (5:ii) : list bitU) in
let (Rt : bits ty5) = (subrange_vec_dec op_code (4:ii) (0:ii) : list bitU) in
memory_single_general_immediate_signed_postidx_aarch64_memory_single_general_immediate_signed_postidx__decode
size
V
opc
imm9
Rn
Rt
else
if (and_bool
(eq_vec (subrange_vec_dec op_code (29:ii) (24:ii) : list bitU) ([B1;B1;B1;B0;B0;B0]))
(and_bool
(eq_vec (subrange_vec_dec op_code (21:ii) (21:ii) : list bitU) ([B0]))
(eq_vec (subrange_vec_dec op_code (11:ii) (10:ii) : list bitU) ([B1;B1]))))
then
let (size : bits ty2) = (subrange_vec_dec op_code (31:ii) (30:ii) : list bitU) in
let (V : bits ty1) = [access_vec_dec op_code (26:ii)] in
let (opc : bits ty2) = (subrange_vec_dec op_code (23:ii) (22:ii) : list bitU) in
let (imm9 : bits ty9) = (subrange_vec_dec op_code (20:ii) (12:ii) : list bitU) in
let (Rn : bits ty5) = (subrange_vec_dec op_code (9:ii) (5:ii) : list bitU) in
let (Rt : bits ty5) = (subrange_vec_dec op_code (4:ii) (0:ii) : list bitU) in
memory_single_general_immediate_signed_preidx_aarch64_memory_single_general_immediate_signed_postidx__decode
size
V
opc
imm9
Rn
Rt
else
if (eq_vec (subrange_vec_dec op_code (29:ii) (24:ii) : list bitU) ([B1;B1;B1;B0;B0;B1]))
then
let (size : bits ty2) = (subrange_vec_dec op_code (31:ii) (30:ii) : list bitU) in
let (V : bits ty1) = [access_vec_dec op_code (26:ii)] in
let (opc : bits ty2) = (subrange_vec_dec op_code (23:ii) (22:ii) : list bitU) in
let (imm12 : bits ty12) = (subrange_vec_dec op_code (21:ii) (10:ii) : list bitU) in
let (Rn : bits ty5) = (subrange_vec_dec op_code (9:ii) (5:ii) : list bitU) in
let (Rt : bits ty5) = (subrange_vec_dec op_code (4:ii) (0:ii) : list bitU) in
memory_single_general_immediate_unsigned_aarch64_memory_single_general_immediate_signed_postidx__decode
size
V
opc
imm12
Rn
Rt
else
let (sf : bits ty1) = [access_vec_dec op_code (31:ii)] in
let (op : bits ty1) = [access_vec_dec op_code (30:ii)] in
let (S : bits ty1) = [access_vec_dec op_code (29:ii)] in
let (shift : bits ty2) = (subrange_vec_dec op_code (23:ii) (22:ii) : list bitU) in
let (imm12 : bits ty12) = (subrange_vec_dec op_code (21:ii) (10:ii) : list bitU) in
let (Rn : bits ty5) = (subrange_vec_dec op_code (9:ii) (5:ii) : list bitU) in
let (Rd : bits ty5) = (subrange_vec_dec op_code (4:ii) (0:ii) : list bitU) in
integer_arithmetic_addsub_immediate_decode sf op S shift imm12 Rn Rd
val initialize_registers : unit -> M unit
let initialize_registers () =
write_reg __unconditional_ref (undefined_bool ()) >>
write_reg __ThisInstrEnc_ref (undefined___InstrEnc ()) >>
write_reg __ThisInstr_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg __Memory_ref (undefined_vector (52:ii) (undefined_bit ()) : list bitU) >>
write_reg __BranchTaken_ref (undefined_bool ()) >>
write_reg
_R_ref
(undefined_vector (31:ii) (undefined_vector (64:ii) (undefined_bit ()) : list bitU) : list (list bitU)) >>
write_reg _PC_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg VBAR_EL3_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg VBAR_EL2_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg VBAR_EL1_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg VBAR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg TCR_EL3_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg TCR_EL2_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg TCR_EL1_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg SP_mon_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SP_EL3_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg SP_EL2_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg SP_EL1_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg SP_EL0_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_und_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_svc_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_mon_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_irq_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_hyp_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_fiq_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_abt_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_EL3_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_EL2_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SPSR_EL1_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SCTLR_EL3_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SCTLR_EL2_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SCTLR_EL1_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SCTLR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SCR_EL3_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg SCR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg PSTATE_ref (undefined_ProcState ()) >>
write_reg MDCR_EL2_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg LR_mon_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HVBAR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HSR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HSCTLR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HPFAR_EL2_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg HPFAR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HIFAR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HDFAR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg HCR_EL2_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg HCR_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg FPEXC_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg FAR_EL3_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg FAR_EL2_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg FAR_EL1_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg ESR_EL3_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg ESR_EL2_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg ESR_EL1_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg ELR_hyp_ref (undefined_vector (32:ii) (undefined_bit ()) : list bitU) >>
write_reg ELR_EL3_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg ELR_EL2_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU) >>
write_reg ELR_EL1_ref (undefined_vector (64:ii) (undefined_bit ()) : list bitU)
|