-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Instructions.scala
1732 lines (1727 loc) · 76.7 KB
/
Instructions.scala
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
// See LICENSE.SiFive for license details.
// See LICENSE.Berkeley for license details.
package freechips.rocketchip.rocket
import chisel3.util._
/* make EXTENSIONS="rv_* rv64*" inst.chisel */
/* Automatically generated by parse_opcodes */
object Instructions {
def ADD = BitPat("b0000000??????????000?????0110011")
def ADD_UW = BitPat("b0000100??????????000?????0111011")
def ADDI = BitPat("b?????????????????000?????0010011")
def ADDIW = BitPat("b?????????????????000?????0011011")
def ADDW = BitPat("b0000000??????????000?????0111011")
def AES64DS = BitPat("b0011101??????????000?????0110011")
def AES64DSM = BitPat("b0011111??????????000?????0110011")
def AES64ES = BitPat("b0011001??????????000?????0110011")
def AES64ESM = BitPat("b0011011??????????000?????0110011")
def AES64IM = BitPat("b001100000000?????001?????0010011")
def AES64KS1I = BitPat("b00110001?????????001?????0010011")
def AES64KS2 = BitPat("b0111111??????????000?????0110011")
def AMOADD_D = BitPat("b00000????????????011?????0101111")
def AMOADD_W = BitPat("b00000????????????010?????0101111")
def AMOAND_D = BitPat("b01100????????????011?????0101111")
def AMOAND_W = BitPat("b01100????????????010?????0101111")
def AMOMAX_D = BitPat("b10100????????????011?????0101111")
def AMOMAX_W = BitPat("b10100????????????010?????0101111")
def AMOMAXU_D = BitPat("b11100????????????011?????0101111")
def AMOMAXU_W = BitPat("b11100????????????010?????0101111")
def AMOMIN_D = BitPat("b10000????????????011?????0101111")
def AMOMIN_W = BitPat("b10000????????????010?????0101111")
def AMOMINU_D = BitPat("b11000????????????011?????0101111")
def AMOMINU_W = BitPat("b11000????????????010?????0101111")
def AMOOR_D = BitPat("b01000????????????011?????0101111")
def AMOOR_W = BitPat("b01000????????????010?????0101111")
def AMOSWAP_D = BitPat("b00001????????????011?????0101111")
def AMOSWAP_W = BitPat("b00001????????????010?????0101111")
def AMOXOR_D = BitPat("b00100????????????011?????0101111")
def AMOXOR_W = BitPat("b00100????????????010?????0101111")
def AND = BitPat("b0000000??????????111?????0110011")
def ANDI = BitPat("b?????????????????111?????0010011")
def ANDN = BitPat("b0100000??????????111?????0110011")
def AUIPC = BitPat("b?????????????????????????0010111")
def BCLR = BitPat("b0100100??????????001?????0110011")
def BCLRI = BitPat("b010010???????????001?????0010011")
def BEQ = BitPat("b?????????????????000?????1100011")
def BEXT = BitPat("b0100100??????????101?????0110011")
def BEXTI = BitPat("b010010???????????101?????0010011")
def BGE = BitPat("b?????????????????101?????1100011")
def BGEU = BitPat("b?????????????????111?????1100011")
def BINV = BitPat("b0110100??????????001?????0110011")
def BINVI = BitPat("b011010???????????001?????0010011")
def BLT = BitPat("b?????????????????100?????1100011")
def BLTU = BitPat("b?????????????????110?????1100011")
def BNE = BitPat("b?????????????????001?????1100011")
def BREV8 = BitPat("b011010000111?????101?????0010011")
def BSET = BitPat("b0010100??????????001?????0110011")
def BSETI = BitPat("b001010???????????001?????0010011")
def C_ADD = BitPat("b????????????????1001??????????10")
def C_ADDI = BitPat("b????????????????000???????????01")
def C_ADDI16SP = BitPat("b????????????????011?00010?????01")
def C_ADDI4SPN = BitPat("b????????????????000???????????00")
def C_ADDIW = BitPat("b????????????????001???????????01")
def C_ADDW = BitPat("b????????????????100111???01???01")
def C_AND = BitPat("b????????????????100011???11???01")
def C_ANDI = BitPat("b????????????????100?10????????01")
def C_BEQZ = BitPat("b????????????????110???????????01")
def C_BNEZ = BitPat("b????????????????111???????????01")
def C_EBREAK = BitPat("b????????????????1001000000000010")
def C_FLD = BitPat("b????????????????001???????????00")
def C_FLDSP = BitPat("b????????????????001???????????10")
def C_FSD = BitPat("b????????????????101???????????00")
def C_FSDSP = BitPat("b????????????????101???????????10")
def C_J = BitPat("b????????????????101???????????01")
def C_JALR = BitPat("b????????????????1001?????0000010")
def C_JR = BitPat("b????????????????1000?????0000010")
def C_LD = BitPat("b????????????????011???????????00")
def C_LDSP = BitPat("b????????????????011???????????10")
def C_LI = BitPat("b????????????????010???????????01")
def C_LUI = BitPat("b????????????????011???????????01")
def C_LW = BitPat("b????????????????010???????????00")
def C_LWSP = BitPat("b????????????????010???????????10")
def C_MV = BitPat("b????????????????1000??????????10")
def C_NOP = BitPat("b????????????????000?00000?????01")
def C_OR = BitPat("b????????????????100011???10???01")
def C_SD = BitPat("b????????????????111???????????00")
def C_SDSP = BitPat("b????????????????111???????????10")
def C_SLLI = BitPat("b????????????????000???????????10")
def C_SRAI = BitPat("b????????????????100?01????????01")
def C_SRLI = BitPat("b????????????????100?00????????01")
def C_SUB = BitPat("b????????????????100011???00???01")
def C_SUBW = BitPat("b????????????????100111???00???01")
def C_SW = BitPat("b????????????????110???????????00")
def C_SWSP = BitPat("b????????????????110???????????10")
def C_XOR = BitPat("b????????????????100011???01???01")
def CBO_CLEAN = BitPat("b000000000001?????010000000001111")
def CBO_FLUSH = BitPat("b000000000010?????010000000001111")
def CBO_INVAL = BitPat("b000000000000?????010000000001111")
def CBO_ZERO = BitPat("b000000000100?????010000000001111")
def CLMUL = BitPat("b0000101??????????001?????0110011")
def CLMULH = BitPat("b0000101??????????011?????0110011")
def CLMULR = BitPat("b0000101??????????010?????0110011")
def CLZ = BitPat("b011000000000?????001?????0010011")
def CLZW = BitPat("b011000000000?????001?????0011011")
def CPOP = BitPat("b011000000010?????001?????0010011")
def CPOPW = BitPat("b011000000010?????001?????0011011")
def CSRRC = BitPat("b?????????????????011?????1110011")
def CSRRCI = BitPat("b?????????????????111?????1110011")
def CSRRS = BitPat("b?????????????????010?????1110011")
def CSRRSI = BitPat("b?????????????????110?????1110011")
def CSRRW = BitPat("b?????????????????001?????1110011")
def CSRRWI = BitPat("b?????????????????101?????1110011")
def CZERO_EQZ = BitPat("b0000111??????????101?????0110011")
def CZERO_NEZ = BitPat("b0000111??????????111?????0110011")
def CTZ = BitPat("b011000000001?????001?????0010011")
def CTZW = BitPat("b011000000001?????001?????0011011")
def DIV = BitPat("b0000001??????????100?????0110011")
def DIVU = BitPat("b0000001??????????101?????0110011")
def DIVUW = BitPat("b0000001??????????101?????0111011")
def DIVW = BitPat("b0000001??????????100?????0111011")
def DRET = BitPat("b01111011001000000000000001110011")
def EBREAK = BitPat("b00000000000100000000000001110011")
def ECALL = BitPat("b00000000000000000000000001110011")
def FADD_D = BitPat("b0000001??????????????????1010011")
def FADD_H = BitPat("b0000010??????????????????1010011")
def FADD_Q = BitPat("b0000011??????????????????1010011")
def FADD_S = BitPat("b0000000??????????????????1010011")
def FCLASS_D = BitPat("b111000100000?????001?????1010011")
def FCLASS_H = BitPat("b111001000000?????001?????1010011")
def FCLASS_Q = BitPat("b111001100000?????001?????1010011")
def FCLASS_S = BitPat("b111000000000?????001?????1010011")
def FCVT_D_H = BitPat("b010000100010?????????????1010011")
def FCVT_D_L = BitPat("b110100100010?????????????1010011")
def FCVT_D_LU = BitPat("b110100100011?????????????1010011")
def FCVT_D_Q = BitPat("b010000100011?????????????1010011")
def FCVT_D_S = BitPat("b010000100000?????????????1010011")
def FCVT_D_W = BitPat("b110100100000?????????????1010011")
def FCVT_D_WU = BitPat("b110100100001?????????????1010011")
def FCVT_H_D = BitPat("b010001000001?????????????1010011")
def FCVT_H_L = BitPat("b110101000010?????????????1010011")
def FCVT_H_LU = BitPat("b110101000011?????????????1010011")
def FCVT_H_Q = BitPat("b010001000011?????????????1010011")
def FCVT_H_S = BitPat("b010001000000?????????????1010011")
def FCVT_H_W = BitPat("b110101000000?????????????1010011")
def FCVT_H_WU = BitPat("b110101000001?????????????1010011")
def FCVT_L_D = BitPat("b110000100010?????????????1010011")
def FCVT_L_H = BitPat("b110001000010?????????????1010011")
def FCVT_L_Q = BitPat("b110001100010?????????????1010011")
def FCVT_L_S = BitPat("b110000000010?????????????1010011")
def FCVT_LU_D = BitPat("b110000100011?????????????1010011")
def FCVT_LU_H = BitPat("b110001000011?????????????1010011")
def FCVT_LU_Q = BitPat("b110001100011?????????????1010011")
def FCVT_LU_S = BitPat("b110000000011?????????????1010011")
def FCVT_Q_D = BitPat("b010001100001?????????????1010011")
def FCVT_Q_H = BitPat("b010001100010?????????????1010011")
def FCVT_Q_L = BitPat("b110101100010?????????????1010011")
def FCVT_Q_LU = BitPat("b110101100011?????????????1010011")
def FCVT_Q_S = BitPat("b010001100000?????????????1010011")
def FCVT_Q_W = BitPat("b110101100000?????????????1010011")
def FCVT_Q_WU = BitPat("b110101100001?????????????1010011")
def FCVT_S_D = BitPat("b010000000001?????????????1010011")
def FCVT_S_H = BitPat("b010000000010?????????????1010011")
def FCVT_S_L = BitPat("b110100000010?????????????1010011")
def FCVT_S_LU = BitPat("b110100000011?????????????1010011")
def FCVT_S_Q = BitPat("b010000000011?????????????1010011")
def FCVT_S_W = BitPat("b110100000000?????????????1010011")
def FCVT_S_WU = BitPat("b110100000001?????????????1010011")
def FCVT_W_D = BitPat("b110000100000?????????????1010011")
def FCVT_W_H = BitPat("b110001000000?????????????1010011")
def FCVT_W_Q = BitPat("b110001100000?????????????1010011")
def FCVT_W_S = BitPat("b110000000000?????????????1010011")
def FCVT_WU_D = BitPat("b110000100001?????????????1010011")
def FCVT_WU_H = BitPat("b110001000001?????????????1010011")
def FCVT_WU_Q = BitPat("b110001100001?????????????1010011")
def FCVT_WU_S = BitPat("b110000000001?????????????1010011")
def FDIV_D = BitPat("b0001101??????????????????1010011")
def FDIV_H = BitPat("b0001110??????????????????1010011")
def FDIV_Q = BitPat("b0001111??????????????????1010011")
def FDIV_S = BitPat("b0001100??????????????????1010011")
def FENCE = BitPat("b?????????????????000?????0001111")
def FENCE_I = BitPat("b?????????????????001?????0001111")
def FEQ_D = BitPat("b1010001??????????010?????1010011")
def FEQ_H = BitPat("b1010010??????????010?????1010011")
def FEQ_Q = BitPat("b1010011??????????010?????1010011")
def FEQ_S = BitPat("b1010000??????????010?????1010011")
def FLD = BitPat("b?????????????????011?????0000111")
def FLE_D = BitPat("b1010001??????????000?????1010011")
def FLE_H = BitPat("b1010010??????????000?????1010011")
def FLE_Q = BitPat("b1010011??????????000?????1010011")
def FLE_S = BitPat("b1010000??????????000?????1010011")
def FLH = BitPat("b?????????????????001?????0000111")
def FLQ = BitPat("b?????????????????100?????0000111")
def FLT_D = BitPat("b1010001??????????001?????1010011")
def FLT_H = BitPat("b1010010??????????001?????1010011")
def FLT_Q = BitPat("b1010011??????????001?????1010011")
def FLT_S = BitPat("b1010000??????????001?????1010011")
def FLW = BitPat("b?????????????????010?????0000111")
def FMADD_D = BitPat("b?????01??????????????????1000011")
def FMADD_H = BitPat("b?????10??????????????????1000011")
def FMADD_Q = BitPat("b?????11??????????????????1000011")
def FMADD_S = BitPat("b?????00??????????????????1000011")
def FMAX_D = BitPat("b0010101??????????001?????1010011")
def FMAX_H = BitPat("b0010110??????????001?????1010011")
def FMAX_Q = BitPat("b0010111??????????001?????1010011")
def FMAX_S = BitPat("b0010100??????????001?????1010011")
def FMIN_D = BitPat("b0010101??????????000?????1010011")
def FMIN_H = BitPat("b0010110??????????000?????1010011")
def FMIN_Q = BitPat("b0010111??????????000?????1010011")
def FMIN_S = BitPat("b0010100??????????000?????1010011")
def FMSUB_D = BitPat("b?????01??????????????????1000111")
def FMSUB_H = BitPat("b?????10??????????????????1000111")
def FMSUB_Q = BitPat("b?????11??????????????????1000111")
def FMSUB_S = BitPat("b?????00??????????????????1000111")
def FMUL_D = BitPat("b0001001??????????????????1010011")
def FMUL_H = BitPat("b0001010??????????????????1010011")
def FMUL_Q = BitPat("b0001011??????????????????1010011")
def FMUL_S = BitPat("b0001000??????????????????1010011")
def FMV_D_X = BitPat("b111100100000?????000?????1010011")
def FMV_H_X = BitPat("b111101000000?????000?????1010011")
def FMV_W_X = BitPat("b111100000000?????000?????1010011")
def FMV_X_D = BitPat("b111000100000?????000?????1010011")
def FMV_X_H = BitPat("b111001000000?????000?????1010011")
def FMV_X_W = BitPat("b111000000000?????000?????1010011")
def FNMADD_D = BitPat("b?????01??????????????????1001111")
def FNMADD_H = BitPat("b?????10??????????????????1001111")
def FNMADD_Q = BitPat("b?????11??????????????????1001111")
def FNMADD_S = BitPat("b?????00??????????????????1001111")
def FNMSUB_D = BitPat("b?????01??????????????????1001011")
def FNMSUB_H = BitPat("b?????10??????????????????1001011")
def FNMSUB_Q = BitPat("b?????11??????????????????1001011")
def FNMSUB_S = BitPat("b?????00??????????????????1001011")
def FSD = BitPat("b?????????????????011?????0100111")
def FSGNJ_D = BitPat("b0010001??????????000?????1010011")
def FSGNJ_H = BitPat("b0010010??????????000?????1010011")
def FSGNJ_Q = BitPat("b0010011??????????000?????1010011")
def FSGNJ_S = BitPat("b0010000??????????000?????1010011")
def FSGNJN_D = BitPat("b0010001??????????001?????1010011")
def FSGNJN_H = BitPat("b0010010??????????001?????1010011")
def FSGNJN_Q = BitPat("b0010011??????????001?????1010011")
def FSGNJN_S = BitPat("b0010000??????????001?????1010011")
def FSGNJX_D = BitPat("b0010001??????????010?????1010011")
def FSGNJX_H = BitPat("b0010010??????????010?????1010011")
def FSGNJX_Q = BitPat("b0010011??????????010?????1010011")
def FSGNJX_S = BitPat("b0010000??????????010?????1010011")
def FSH = BitPat("b?????????????????001?????0100111")
def FSQ = BitPat("b?????????????????100?????0100111")
def FSQRT_D = BitPat("b010110100000?????????????1010011")
def FSQRT_H = BitPat("b010111000000?????????????1010011")
def FSQRT_Q = BitPat("b010111100000?????????????1010011")
def FSQRT_S = BitPat("b010110000000?????????????1010011")
def FSUB_D = BitPat("b0000101??????????????????1010011")
def FSUB_H = BitPat("b0000110??????????????????1010011")
def FSUB_Q = BitPat("b0000111??????????????????1010011")
def FSUB_S = BitPat("b0000100??????????????????1010011")
def FSW = BitPat("b?????????????????010?????0100111")
def HFENCE_GVMA = BitPat("b0110001??????????000000001110011")
def HFENCE_VVMA = BitPat("b0010001??????????000000001110011")
def HINVAL_GVMA = BitPat("b0110011??????????000000001110011")
def HINVAL_VVMA = BitPat("b0010011??????????000000001110011")
def HLV_B = BitPat("b011000000000?????100?????1110011")
def HLV_BU = BitPat("b011000000001?????100?????1110011")
def HLV_D = BitPat("b011011000000?????100?????1110011")
def HLV_H = BitPat("b011001000000?????100?????1110011")
def HLV_HU = BitPat("b011001000001?????100?????1110011")
def HLV_W = BitPat("b011010000000?????100?????1110011")
def HLV_WU = BitPat("b011010000001?????100?????1110011")
def HLVX_HU = BitPat("b011001000011?????100?????1110011")
def HLVX_WU = BitPat("b011010000011?????100?????1110011")
def HSV_B = BitPat("b0110001??????????100000001110011")
def HSV_D = BitPat("b0110111??????????100000001110011")
def HSV_H = BitPat("b0110011??????????100000001110011")
def HSV_W = BitPat("b0110101??????????100000001110011")
def JAL = BitPat("b?????????????????????????1101111")
def JALR = BitPat("b?????????????????000?????1100111")
def LB = BitPat("b?????????????????000?????0000011")
def LBU = BitPat("b?????????????????100?????0000011")
def LD = BitPat("b?????????????????011?????0000011")
def LH = BitPat("b?????????????????001?????0000011")
def LHU = BitPat("b?????????????????101?????0000011")
def LR_D = BitPat("b00010??00000?????011?????0101111")
def LR_W = BitPat("b00010??00000?????010?????0101111")
def LUI = BitPat("b?????????????????????????0110111")
def LW = BitPat("b?????????????????010?????0000011")
def LWU = BitPat("b?????????????????110?????0000011")
def MAX = BitPat("b0000101??????????110?????0110011")
def MAXU = BitPat("b0000101??????????111?????0110011")
def MIN = BitPat("b0000101??????????100?????0110011")
def MINU = BitPat("b0000101??????????101?????0110011")
def MRET = BitPat("b00110000001000000000000001110011")
def MUL = BitPat("b0000001??????????000?????0110011")
def MULH = BitPat("b0000001??????????001?????0110011")
def MULHSU = BitPat("b0000001??????????010?????0110011")
def MULHU = BitPat("b0000001??????????011?????0110011")
def MULW = BitPat("b0000001??????????000?????0111011")
def OR = BitPat("b0000000??????????110?????0110011")
def ORC_B = BitPat("b001010000111?????101?????0010011")
def ORI = BitPat("b?????????????????110?????0010011")
def ORN = BitPat("b0100000??????????110?????0110011")
def PACK = BitPat("b0000100??????????100?????0110011")
def PACKH = BitPat("b0000100??????????111?????0110011")
def PACKW = BitPat("b0000100??????????100?????0111011")
def REM = BitPat("b0000001??????????110?????0110011")
def REMU = BitPat("b0000001??????????111?????0110011")
def REMUW = BitPat("b0000001??????????111?????0111011")
def REMW = BitPat("b0000001??????????110?????0111011")
def REV8 = BitPat("b011010111000?????101?????0010011")
def ROL = BitPat("b0110000??????????001?????0110011")
def ROLW = BitPat("b0110000??????????001?????0111011")
def ROR = BitPat("b0110000??????????101?????0110011")
def RORI = BitPat("b011000???????????101?????0010011")
def RORIW = BitPat("b0110000??????????101?????0011011")
def RORW = BitPat("b0110000??????????101?????0111011")
def SB = BitPat("b?????????????????000?????0100011")
def SC_D = BitPat("b00011????????????011?????0101111")
def SC_W = BitPat("b00011????????????010?????0101111")
def SD = BitPat("b?????????????????011?????0100011")
def SEXT_B = BitPat("b011000000100?????001?????0010011")
def SEXT_H = BitPat("b011000000101?????001?????0010011")
def SFENCE_INVAL_IR = BitPat("b00011000000100000000000001110011")
def SFENCE_VMA = BitPat("b0001001??????????000000001110011")
def SFENCE_W_INVAL = BitPat("b00011000000000000000000001110011")
def SH = BitPat("b?????????????????001?????0100011")
def SH1ADD = BitPat("b0010000??????????010?????0110011")
def SH1ADD_UW = BitPat("b0010000??????????010?????0111011")
def SH2ADD = BitPat("b0010000??????????100?????0110011")
def SH2ADD_UW = BitPat("b0010000??????????100?????0111011")
def SH3ADD = BitPat("b0010000??????????110?????0110011")
def SH3ADD_UW = BitPat("b0010000??????????110?????0111011")
def SHA256SIG0 = BitPat("b000100000010?????001?????0010011")
def SHA256SIG1 = BitPat("b000100000011?????001?????0010011")
def SHA256SUM0 = BitPat("b000100000000?????001?????0010011")
def SHA256SUM1 = BitPat("b000100000001?????001?????0010011")
def SHA512SIG0 = BitPat("b000100000110?????001?????0010011")
def SHA512SIG1 = BitPat("b000100000111?????001?????0010011")
def SHA512SUM0 = BitPat("b000100000100?????001?????0010011")
def SHA512SUM1 = BitPat("b000100000101?????001?????0010011")
def SINVAL_VMA = BitPat("b0001011??????????000000001110011")
def SLL = BitPat("b0000000??????????001?????0110011")
def SLLI = BitPat("b000000???????????001?????0010011")
def SLLI_UW = BitPat("b000010???????????001?????0011011")
def SLLIW = BitPat("b0000000??????????001?????0011011")
def SLLW = BitPat("b0000000??????????001?????0111011")
def SLT = BitPat("b0000000??????????010?????0110011")
def SLTI = BitPat("b?????????????????010?????0010011")
def SLTIU = BitPat("b?????????????????011?????0010011")
def SLTU = BitPat("b0000000??????????011?????0110011")
def SM3P0 = BitPat("b000100001000?????001?????0010011")
def SM3P1 = BitPat("b000100001001?????001?????0010011")
def SM4ED = BitPat("b??11000??????????000?????0110011")
def SM4KS = BitPat("b??11010??????????000?????0110011")
def SRA = BitPat("b0100000??????????101?????0110011")
def SRAI = BitPat("b010000???????????101?????0010011")
def SRAIW = BitPat("b0100000??????????101?????0011011")
def SRAW = BitPat("b0100000??????????101?????0111011")
def SRET = BitPat("b00010000001000000000000001110011")
def SRL = BitPat("b0000000??????????101?????0110011")
def SRLI = BitPat("b000000???????????101?????0010011")
def SRLIW = BitPat("b0000000??????????101?????0011011")
def SRLW = BitPat("b0000000??????????101?????0111011")
def SUB = BitPat("b0100000??????????000?????0110011")
def SUBW = BitPat("b0100000??????????000?????0111011")
def SW = BitPat("b?????????????????010?????0100011")
def VAADD_VV = BitPat("b001001???????????010?????1010111")
def VAADD_VX = BitPat("b001001???????????110?????1010111")
def VAADDU_VV = BitPat("b001000???????????010?????1010111")
def VAADDU_VX = BitPat("b001000???????????110?????1010111")
def VADC_VIM = BitPat("b0100000??????????011?????1010111")
def VADC_VVM = BitPat("b0100000??????????000?????1010111")
def VADC_VXM = BitPat("b0100000??????????100?????1010111")
def VADD_VI = BitPat("b000000???????????011?????1010111")
def VADD_VV = BitPat("b000000???????????000?????1010111")
def VADD_VX = BitPat("b000000???????????100?????1010111")
def VAMOADDEI16_V = BitPat("b00000????????????101?????0101111")
def VAMOADDEI32_V = BitPat("b00000????????????110?????0101111")
def VAMOADDEI64_V = BitPat("b00000????????????111?????0101111")
def VAMOADDEI8_V = BitPat("b00000????????????000?????0101111")
def VAMOANDEI16_V = BitPat("b01100????????????101?????0101111")
def VAMOANDEI32_V = BitPat("b01100????????????110?????0101111")
def VAMOANDEI64_V = BitPat("b01100????????????111?????0101111")
def VAMOANDEI8_V = BitPat("b01100????????????000?????0101111")
def VAMOMAXEI16_V = BitPat("b10100????????????101?????0101111")
def VAMOMAXEI32_V = BitPat("b10100????????????110?????0101111")
def VAMOMAXEI64_V = BitPat("b10100????????????111?????0101111")
def VAMOMAXEI8_V = BitPat("b10100????????????000?????0101111")
def VAMOMAXUEI16_V = BitPat("b11100????????????101?????0101111")
def VAMOMAXUEI32_V = BitPat("b11100????????????110?????0101111")
def VAMOMAXUEI64_V = BitPat("b11100????????????111?????0101111")
def VAMOMAXUEI8_V = BitPat("b11100????????????000?????0101111")
def VAMOMINEI16_V = BitPat("b10000????????????101?????0101111")
def VAMOMINEI32_V = BitPat("b10000????????????110?????0101111")
def VAMOMINEI64_V = BitPat("b10000????????????111?????0101111")
def VAMOMINEI8_V = BitPat("b10000????????????000?????0101111")
def VAMOMINUEI16_V = BitPat("b11000????????????101?????0101111")
def VAMOMINUEI32_V = BitPat("b11000????????????110?????0101111")
def VAMOMINUEI64_V = BitPat("b11000????????????111?????0101111")
def VAMOMINUEI8_V = BitPat("b11000????????????000?????0101111")
def VAMOOREI16_V = BitPat("b01000????????????101?????0101111")
def VAMOOREI32_V = BitPat("b01000????????????110?????0101111")
def VAMOOREI64_V = BitPat("b01000????????????111?????0101111")
def VAMOOREI8_V = BitPat("b01000????????????000?????0101111")
def VAMOSWAPEI16_V = BitPat("b00001????????????101?????0101111")
def VAMOSWAPEI32_V = BitPat("b00001????????????110?????0101111")
def VAMOSWAPEI64_V = BitPat("b00001????????????111?????0101111")
def VAMOSWAPEI8_V = BitPat("b00001????????????000?????0101111")
def VAMOXOREI16_V = BitPat("b00100????????????101?????0101111")
def VAMOXOREI32_V = BitPat("b00100????????????110?????0101111")
def VAMOXOREI64_V = BitPat("b00100????????????111?????0101111")
def VAMOXOREI8_V = BitPat("b00100????????????000?????0101111")
def VAND_VI = BitPat("b001001???????????011?????1010111")
def VAND_VV = BitPat("b001001???????????000?????1010111")
def VAND_VX = BitPat("b001001???????????100?????1010111")
def VASUB_VV = BitPat("b001011???????????010?????1010111")
def VASUB_VX = BitPat("b001011???????????110?????1010111")
def VASUBU_VV = BitPat("b001010???????????010?????1010111")
def VASUBU_VX = BitPat("b001010???????????110?????1010111")
def VCOMPRESS_VM = BitPat("b0101111??????????010?????1010111")
def VCPOP_M = BitPat("b010000??????10000010?????1010111")
def VDIV_VV = BitPat("b100001???????????010?????1010111")
def VDIV_VX = BitPat("b100001???????????110?????1010111")
def VDIVU_VV = BitPat("b100000???????????010?????1010111")
def VDIVU_VX = BitPat("b100000???????????110?????1010111")
def VFADD_VF = BitPat("b000000???????????101?????1010111")
def VFADD_VV = BitPat("b000000???????????001?????1010111")
def VFCLASS_V = BitPat("b010011??????10000001?????1010111")
def VFCVT_F_X_V = BitPat("b010010??????00011001?????1010111")
def VFCVT_F_XU_V = BitPat("b010010??????00010001?????1010111")
def VFCVT_RTZ_X_F_V = BitPat("b010010??????00111001?????1010111")
def VFCVT_RTZ_XU_F_V = BitPat("b010010??????00110001?????1010111")
def VFCVT_X_F_V = BitPat("b010010??????00001001?????1010111")
def VFCVT_XU_F_V = BitPat("b010010??????00000001?????1010111")
def VFDIV_VF = BitPat("b100000???????????101?????1010111")
def VFDIV_VV = BitPat("b100000???????????001?????1010111")
def VFIRST_M = BitPat("b010000??????10001010?????1010111")
def VFMACC_VF = BitPat("b101100???????????101?????1010111")
def VFMACC_VV = BitPat("b101100???????????001?????1010111")
def VFMADD_VF = BitPat("b101000???????????101?????1010111")
def VFMADD_VV = BitPat("b101000???????????001?????1010111")
def VFMAX_VF = BitPat("b000110???????????101?????1010111")
def VFMAX_VV = BitPat("b000110???????????001?????1010111")
def VFMERGE_VFM = BitPat("b0101110??????????101?????1010111")
def VFMIN_VF = BitPat("b000100???????????101?????1010111")
def VFMIN_VV = BitPat("b000100???????????001?????1010111")
def VFMSAC_VF = BitPat("b101110???????????101?????1010111")
def VFMSAC_VV = BitPat("b101110???????????001?????1010111")
def VFMSUB_VF = BitPat("b101010???????????101?????1010111")
def VFMSUB_VV = BitPat("b101010???????????001?????1010111")
def VFMUL_VF = BitPat("b100100???????????101?????1010111")
def VFMUL_VV = BitPat("b100100???????????001?????1010111")
def VFMV_F_S = BitPat("b0100001?????00000001?????1010111")
def VFMV_S_F = BitPat("b010000100000?????101?????1010111")
def VFMV_V_F = BitPat("b010111100000?????101?????1010111")
def VFNCVT_F_F_W = BitPat("b010010??????10100001?????1010111")
def VFNCVT_F_X_W = BitPat("b010010??????10011001?????1010111")
def VFNCVT_F_XU_W = BitPat("b010010??????10010001?????1010111")
def VFNCVT_ROD_F_F_W = BitPat("b010010??????10101001?????1010111")
def VFNCVT_RTZ_X_F_W = BitPat("b010010??????10111001?????1010111")
def VFNCVT_RTZ_XU_F_W = BitPat("b010010??????10110001?????1010111")
def VFNCVT_X_F_W = BitPat("b010010??????10001001?????1010111")
def VFNCVT_XU_F_W = BitPat("b010010??????10000001?????1010111")
def VFNMACC_VF = BitPat("b101101???????????101?????1010111")
def VFNMACC_VV = BitPat("b101101???????????001?????1010111")
def VFNMADD_VF = BitPat("b101001???????????101?????1010111")
def VFNMADD_VV = BitPat("b101001???????????001?????1010111")
def VFNMSAC_VF = BitPat("b101111???????????101?????1010111")
def VFNMSAC_VV = BitPat("b101111???????????001?????1010111")
def VFNMSUB_VF = BitPat("b101011???????????101?????1010111")
def VFNMSUB_VV = BitPat("b101011???????????001?????1010111")
def VFRDIV_VF = BitPat("b100001???????????101?????1010111")
def VFREC7_V = BitPat("b010011??????00101001?????1010111")
def VFREDMAX_VS = BitPat("b000111???????????001?????1010111")
def VFREDMIN_VS = BitPat("b000101???????????001?????1010111")
def VFREDOSUM_VS = BitPat("b000011???????????001?????1010111")
def VFREDUSUM_VS = BitPat("b000001???????????001?????1010111")
def VFRSQRT7_V = BitPat("b010011??????00100001?????1010111")
def VFRSUB_VF = BitPat("b100111???????????101?????1010111")
def VFSGNJ_VF = BitPat("b001000???????????101?????1010111")
def VFSGNJ_VV = BitPat("b001000???????????001?????1010111")
def VFSGNJN_VF = BitPat("b001001???????????101?????1010111")
def VFSGNJN_VV = BitPat("b001001???????????001?????1010111")
def VFSGNJX_VF = BitPat("b001010???????????101?????1010111")
def VFSGNJX_VV = BitPat("b001010???????????001?????1010111")
def VFSLIDE1DOWN_VF = BitPat("b001111???????????101?????1010111")
def VFSLIDE1UP_VF = BitPat("b001110???????????101?????1010111")
def VFSQRT_V = BitPat("b010011??????00000001?????1010111")
def VFSUB_VF = BitPat("b000010???????????101?????1010111")
def VFSUB_VV = BitPat("b000010???????????001?????1010111")
def VFWADD_VF = BitPat("b110000???????????101?????1010111")
def VFWADD_VV = BitPat("b110000???????????001?????1010111")
def VFWADD_WF = BitPat("b110100???????????101?????1010111")
def VFWADD_WV = BitPat("b110100???????????001?????1010111")
def VFWCVT_F_F_V = BitPat("b010010??????01100001?????1010111")
def VFWCVT_F_X_V = BitPat("b010010??????01011001?????1010111")
def VFWCVT_F_XU_V = BitPat("b010010??????01010001?????1010111")
def VFWCVT_RTZ_X_F_V = BitPat("b010010??????01111001?????1010111")
def VFWCVT_RTZ_XU_F_V = BitPat("b010010??????01110001?????1010111")
def VFWCVT_X_F_V = BitPat("b010010??????01001001?????1010111")
def VFWCVT_XU_F_V = BitPat("b010010??????01000001?????1010111")
def VFWMACC_VF = BitPat("b111100???????????101?????1010111")
def VFWMACC_VV = BitPat("b111100???????????001?????1010111")
def VFWMSAC_VF = BitPat("b111110???????????101?????1010111")
def VFWMSAC_VV = BitPat("b111110???????????001?????1010111")
def VFWMUL_VF = BitPat("b111000???????????101?????1010111")
def VFWMUL_VV = BitPat("b111000???????????001?????1010111")
def VFWNMACC_VF = BitPat("b111101???????????101?????1010111")
def VFWNMACC_VV = BitPat("b111101???????????001?????1010111")
def VFWNMSAC_VF = BitPat("b111111???????????101?????1010111")
def VFWNMSAC_VV = BitPat("b111111???????????001?????1010111")
def VFWREDOSUM_VS = BitPat("b110011???????????001?????1010111")
def VFWREDUSUM_VS = BitPat("b110001???????????001?????1010111")
def VFWSUB_VF = BitPat("b110010???????????101?????1010111")
def VFWSUB_VV = BitPat("b110010???????????001?????1010111")
def VFWSUB_WF = BitPat("b110110???????????101?????1010111")
def VFWSUB_WV = BitPat("b110110???????????001?????1010111")
def VID_V = BitPat("b010100?0000010001010?????1010111")
def VIOTA_M = BitPat("b010100??????10000010?????1010111")
def VL1RE16_V = BitPat("b000000101000?????101?????0000111")
def VL1RE32_V = BitPat("b000000101000?????110?????0000111")
def VL1RE64_V = BitPat("b000000101000?????111?????0000111")
def VL1RE8_V = BitPat("b000000101000?????000?????0000111")
def VL2RE16_V = BitPat("b001000101000?????101?????0000111")
def VL2RE32_V = BitPat("b001000101000?????110?????0000111")
def VL2RE64_V = BitPat("b001000101000?????111?????0000111")
def VL2RE8_V = BitPat("b001000101000?????000?????0000111")
def VL4RE16_V = BitPat("b011000101000?????101?????0000111")
def VL4RE32_V = BitPat("b011000101000?????110?????0000111")
def VL4RE64_V = BitPat("b011000101000?????111?????0000111")
def VL4RE8_V = BitPat("b011000101000?????000?????0000111")
def VL8RE16_V = BitPat("b111000101000?????101?????0000111")
def VL8RE32_V = BitPat("b111000101000?????110?????0000111")
def VL8RE64_V = BitPat("b111000101000?????111?????0000111")
def VL8RE8_V = BitPat("b111000101000?????000?????0000111")
def VLE1024_V = BitPat("b???100?00000?????111?????0000111")
def VLE1024FF_V = BitPat("b???100?10000?????111?????0000111")
def VLE128_V = BitPat("b???100?00000?????000?????0000111")
def VLE128FF_V = BitPat("b???100?10000?????000?????0000111")
def VLE16_V = BitPat("b???000?00000?????101?????0000111")
def VLE16FF_V = BitPat("b???000?10000?????101?????0000111")
def VLE256_V = BitPat("b???100?00000?????101?????0000111")
def VLE256FF_V = BitPat("b???100?10000?????101?????0000111")
def VLE32_V = BitPat("b???000?00000?????110?????0000111")
def VLE32FF_V = BitPat("b???000?10000?????110?????0000111")
def VLE512_V = BitPat("b???100?00000?????110?????0000111")
def VLE512FF_V = BitPat("b???100?10000?????110?????0000111")
def VLE64_V = BitPat("b???000?00000?????111?????0000111")
def VLE64FF_V = BitPat("b???000?10000?????111?????0000111")
def VLE8_V = BitPat("b???000?00000?????000?????0000111")
def VLE8FF_V = BitPat("b???000?10000?????000?????0000111")
def VLM_V = BitPat("b000000101011?????000?????0000111")
def VLOXEI1024_V = BitPat("b???111???????????111?????0000111")
def VLOXEI128_V = BitPat("b???111???????????000?????0000111")
def VLOXEI16_V = BitPat("b???011???????????101?????0000111")
def VLOXEI256_V = BitPat("b???111???????????101?????0000111")
def VLOXEI32_V = BitPat("b???011???????????110?????0000111")
def VLOXEI512_V = BitPat("b???111???????????110?????0000111")
def VLOXEI64_V = BitPat("b???011???????????111?????0000111")
def VLOXEI8_V = BitPat("b???011???????????000?????0000111")
def VLSE1024_V = BitPat("b???110???????????111?????0000111")
def VLSE128_V = BitPat("b???110???????????000?????0000111")
def VLSE16_V = BitPat("b???010???????????101?????0000111")
def VLSE256_V = BitPat("b???110???????????101?????0000111")
def VLSE32_V = BitPat("b???010???????????110?????0000111")
def VLSE512_V = BitPat("b???110???????????110?????0000111")
def VLSE64_V = BitPat("b???010???????????111?????0000111")
def VLSE8_V = BitPat("b???010???????????000?????0000111")
def VLUXEI1024_V = BitPat("b???101???????????111?????0000111")
def VLUXEI128_V = BitPat("b???101???????????000?????0000111")
def VLUXEI16_V = BitPat("b???001???????????101?????0000111")
def VLUXEI256_V = BitPat("b???101???????????101?????0000111")
def VLUXEI32_V = BitPat("b???001???????????110?????0000111")
def VLUXEI512_V = BitPat("b???101???????????110?????0000111")
def VLUXEI64_V = BitPat("b???001???????????111?????0000111")
def VLUXEI8_V = BitPat("b???001???????????000?????0000111")
def VMACC_VV = BitPat("b101101???????????010?????1010111")
def VMACC_VX = BitPat("b101101???????????110?????1010111")
def VMADC_VI = BitPat("b0100011??????????011?????1010111")
def VMADC_VIM = BitPat("b0100010??????????011?????1010111")
def VMADC_VV = BitPat("b0100011??????????000?????1010111")
def VMADC_VVM = BitPat("b0100010??????????000?????1010111")
def VMADC_VX = BitPat("b0100011??????????100?????1010111")
def VMADC_VXM = BitPat("b0100010??????????100?????1010111")
def VMADD_VV = BitPat("b101001???????????010?????1010111")
def VMADD_VX = BitPat("b101001???????????110?????1010111")
def VMAND_MM = BitPat("b011001???????????010?????1010111")
def VMANDN_MM = BitPat("b011000???????????010?????1010111")
def VMAX_VV = BitPat("b000111???????????000?????1010111")
def VMAX_VX = BitPat("b000111???????????100?????1010111")
def VMAXU_VV = BitPat("b000110???????????000?????1010111")
def VMAXU_VX = BitPat("b000110???????????100?????1010111")
def VMERGE_VIM = BitPat("b0101110??????????011?????1010111")
def VMERGE_VVM = BitPat("b0101110??????????000?????1010111")
def VMERGE_VXM = BitPat("b0101110??????????100?????1010111")
def VMFEQ_VF = BitPat("b011000???????????101?????1010111")
def VMFEQ_VV = BitPat("b011000???????????001?????1010111")
def VMFGE_VF = BitPat("b011111???????????101?????1010111")
def VMFGT_VF = BitPat("b011101???????????101?????1010111")
def VMFLE_VF = BitPat("b011001???????????101?????1010111")
def VMFLE_VV = BitPat("b011001???????????001?????1010111")
def VMFLT_VF = BitPat("b011011???????????101?????1010111")
def VMFLT_VV = BitPat("b011011???????????001?????1010111")
def VMFNE_VF = BitPat("b011100???????????101?????1010111")
def VMFNE_VV = BitPat("b011100???????????001?????1010111")
def VMIN_VV = BitPat("b000101???????????000?????1010111")
def VMIN_VX = BitPat("b000101???????????100?????1010111")
def VMINU_VV = BitPat("b000100???????????000?????1010111")
def VMINU_VX = BitPat("b000100???????????100?????1010111")
def VMNAND_MM = BitPat("b011101???????????010?????1010111")
def VMNOR_MM = BitPat("b011110???????????010?????1010111")
def VMOR_MM = BitPat("b011010???????????010?????1010111")
def VMORN_MM = BitPat("b011100???????????010?????1010111")
def VMSBC_VV = BitPat("b0100111??????????000?????1010111")
def VMSBC_VVM = BitPat("b0100110??????????000?????1010111")
def VMSBC_VX = BitPat("b0100111??????????100?????1010111")
def VMSBC_VXM = BitPat("b0100110??????????100?????1010111")
def VMSBF_M = BitPat("b010100??????00001010?????1010111")
def VMSEQ_VI = BitPat("b011000???????????011?????1010111")
def VMSEQ_VV = BitPat("b011000???????????000?????1010111")
def VMSEQ_VX = BitPat("b011000???????????100?????1010111")
def VMSGT_VI = BitPat("b011111???????????011?????1010111")
def VMSGT_VX = BitPat("b011111???????????100?????1010111")
def VMSGTU_VI = BitPat("b011110???????????011?????1010111")
def VMSGTU_VX = BitPat("b011110???????????100?????1010111")
def VMSIF_M = BitPat("b010100??????00011010?????1010111")
def VMSLE_VI = BitPat("b011101???????????011?????1010111")
def VMSLE_VV = BitPat("b011101???????????000?????1010111")
def VMSLE_VX = BitPat("b011101???????????100?????1010111")
def VMSLEU_VI = BitPat("b011100???????????011?????1010111")
def VMSLEU_VV = BitPat("b011100???????????000?????1010111")
def VMSLEU_VX = BitPat("b011100???????????100?????1010111")
def VMSLT_VV = BitPat("b011011???????????000?????1010111")
def VMSLT_VX = BitPat("b011011???????????100?????1010111")
def VMSLTU_VV = BitPat("b011010???????????000?????1010111")
def VMSLTU_VX = BitPat("b011010???????????100?????1010111")
def VMSNE_VI = BitPat("b011001???????????011?????1010111")
def VMSNE_VV = BitPat("b011001???????????000?????1010111")
def VMSNE_VX = BitPat("b011001???????????100?????1010111")
def VMSOF_M = BitPat("b010100??????00010010?????1010111")
def VMUL_VV = BitPat("b100101???????????010?????1010111")
def VMUL_VX = BitPat("b100101???????????110?????1010111")
def VMULH_VV = BitPat("b100111???????????010?????1010111")
def VMULH_VX = BitPat("b100111???????????110?????1010111")
def VMULHSU_VV = BitPat("b100110???????????010?????1010111")
def VMULHSU_VX = BitPat("b100110???????????110?????1010111")
def VMULHU_VV = BitPat("b100100???????????010?????1010111")
def VMULHU_VX = BitPat("b100100???????????110?????1010111")
def VMV1R_V = BitPat("b1001111?????00000011?????1010111")
def VMV2R_V = BitPat("b1001111?????00001011?????1010111")
def VMV4R_V = BitPat("b1001111?????00011011?????1010111")
def VMV8R_V = BitPat("b1001111?????00111011?????1010111")
def VMV_S_X = BitPat("b010000100000?????110?????1010111")
def VMV_V_I = BitPat("b010111100000?????011?????1010111")
def VMV_V_V = BitPat("b010111100000?????000?????1010111")
def VMV_V_X = BitPat("b010111100000?????100?????1010111")
def VMV_X_S = BitPat("b0100001?????00000010?????1010111")
def VMXNOR_MM = BitPat("b011111???????????010?????1010111")
def VMXOR_MM = BitPat("b011011???????????010?????1010111")
def VNCLIP_WI = BitPat("b101111???????????011?????1010111")
def VNCLIP_WV = BitPat("b101111???????????000?????1010111")
def VNCLIP_WX = BitPat("b101111???????????100?????1010111")
def VNCLIPU_WI = BitPat("b101110???????????011?????1010111")
def VNCLIPU_WV = BitPat("b101110???????????000?????1010111")
def VNCLIPU_WX = BitPat("b101110???????????100?????1010111")
def VNMSAC_VV = BitPat("b101111???????????010?????1010111")
def VNMSAC_VX = BitPat("b101111???????????110?????1010111")
def VNMSUB_VV = BitPat("b101011???????????010?????1010111")
def VNMSUB_VX = BitPat("b101011???????????110?????1010111")
def VNSRA_WI = BitPat("b101101???????????011?????1010111")
def VNSRA_WV = BitPat("b101101???????????000?????1010111")
def VNSRA_WX = BitPat("b101101???????????100?????1010111")
def VNSRL_WI = BitPat("b101100???????????011?????1010111")
def VNSRL_WV = BitPat("b101100???????????000?????1010111")
def VNSRL_WX = BitPat("b101100???????????100?????1010111")
def VOR_VI = BitPat("b001010???????????011?????1010111")
def VOR_VV = BitPat("b001010???????????000?????1010111")
def VOR_VX = BitPat("b001010???????????100?????1010111")
def VREDAND_VS = BitPat("b000001???????????010?????1010111")
def VREDMAX_VS = BitPat("b000111???????????010?????1010111")
def VREDMAXU_VS = BitPat("b000110???????????010?????1010111")
def VREDMIN_VS = BitPat("b000101???????????010?????1010111")
def VREDMINU_VS = BitPat("b000100???????????010?????1010111")
def VREDOR_VS = BitPat("b000010???????????010?????1010111")
def VREDSUM_VS = BitPat("b000000???????????010?????1010111")
def VREDXOR_VS = BitPat("b000011???????????010?????1010111")
def VREM_VV = BitPat("b100011???????????010?????1010111")
def VREM_VX = BitPat("b100011???????????110?????1010111")
def VREMU_VV = BitPat("b100010???????????010?????1010111")
def VREMU_VX = BitPat("b100010???????????110?????1010111")
def VRGATHER_VI = BitPat("b001100???????????011?????1010111")
def VRGATHER_VV = BitPat("b001100???????????000?????1010111")
def VRGATHER_VX = BitPat("b001100???????????100?????1010111")
def VRGATHEREI16_VV = BitPat("b001110???????????000?????1010111")
def VRSUB_VI = BitPat("b000011???????????011?????1010111")
def VRSUB_VX = BitPat("b000011???????????100?????1010111")
def VS1R_V = BitPat("b000000101000?????000?????0100111")
def VS2R_V = BitPat("b001000101000?????000?????0100111")
def VS4R_V = BitPat("b011000101000?????000?????0100111")
def VS8R_V = BitPat("b111000101000?????000?????0100111")
def VSADD_VI = BitPat("b100001???????????011?????1010111")
def VSADD_VV = BitPat("b100001???????????000?????1010111")
def VSADD_VX = BitPat("b100001???????????100?????1010111")
def VSADDU_VI = BitPat("b100000???????????011?????1010111")
def VSADDU_VV = BitPat("b100000???????????000?????1010111")
def VSADDU_VX = BitPat("b100000???????????100?????1010111")
def VSBC_VVM = BitPat("b0100100??????????000?????1010111")
def VSBC_VXM = BitPat("b0100100??????????100?????1010111")
def VSE1024_V = BitPat("b???100?00000?????111?????0100111")
def VSE128_V = BitPat("b???100?00000?????000?????0100111")
def VSE16_V = BitPat("b???000?00000?????101?????0100111")
def VSE256_V = BitPat("b???100?00000?????101?????0100111")
def VSE32_V = BitPat("b???000?00000?????110?????0100111")
def VSE512_V = BitPat("b???100?00000?????110?????0100111")
def VSE64_V = BitPat("b???000?00000?????111?????0100111")
def VSE8_V = BitPat("b???000?00000?????000?????0100111")
def VSETIVLI = BitPat("b11???????????????111?????1010111")
def VSETVL = BitPat("b1000000??????????111?????1010111")
def VSETVLI = BitPat("b0????????????????111?????1010111")
def VSEXT_VF2 = BitPat("b010010??????00111010?????1010111")
def VSEXT_VF4 = BitPat("b010010??????00101010?????1010111")
def VSEXT_VF8 = BitPat("b010010??????00011010?????1010111")
def VSLIDE1DOWN_VX = BitPat("b001111???????????110?????1010111")
def VSLIDE1UP_VX = BitPat("b001110???????????110?????1010111")
def VSLIDEDOWN_VI = BitPat("b001111???????????011?????1010111")
def VSLIDEDOWN_VX = BitPat("b001111???????????100?????1010111")
def VSLIDEUP_VI = BitPat("b001110???????????011?????1010111")
def VSLIDEUP_VX = BitPat("b001110???????????100?????1010111")
def VSLL_VI = BitPat("b100101???????????011?????1010111")
def VSLL_VV = BitPat("b100101???????????000?????1010111")
def VSLL_VX = BitPat("b100101???????????100?????1010111")
def VSM_V = BitPat("b000000101011?????000?????0100111")
def VSMUL_VV = BitPat("b100111???????????000?????1010111")
def VSMUL_VX = BitPat("b100111???????????100?????1010111")
def VSOXEI1024_V = BitPat("b???111???????????111?????0100111")
def VSOXEI128_V = BitPat("b???111???????????000?????0100111")
def VSOXEI16_V = BitPat("b???011???????????101?????0100111")
def VSOXEI256_V = BitPat("b???111???????????101?????0100111")
def VSOXEI32_V = BitPat("b???011???????????110?????0100111")
def VSOXEI512_V = BitPat("b???111???????????110?????0100111")
def VSOXEI64_V = BitPat("b???011???????????111?????0100111")
def VSOXEI8_V = BitPat("b???011???????????000?????0100111")
def VSRA_VI = BitPat("b101001???????????011?????1010111")
def VSRA_VV = BitPat("b101001???????????000?????1010111")
def VSRA_VX = BitPat("b101001???????????100?????1010111")
def VSRL_VI = BitPat("b101000???????????011?????1010111")
def VSRL_VV = BitPat("b101000???????????000?????1010111")
def VSRL_VX = BitPat("b101000???????????100?????1010111")
def VSSE1024_V = BitPat("b???110???????????111?????0100111")
def VSSE128_V = BitPat("b???110???????????000?????0100111")
def VSSE16_V = BitPat("b???010???????????101?????0100111")
def VSSE256_V = BitPat("b???110???????????101?????0100111")
def VSSE32_V = BitPat("b???010???????????110?????0100111")
def VSSE512_V = BitPat("b???110???????????110?????0100111")
def VSSE64_V = BitPat("b???010???????????111?????0100111")
def VSSE8_V = BitPat("b???010???????????000?????0100111")
def VSSRA_VI = BitPat("b101011???????????011?????1010111")
def VSSRA_VV = BitPat("b101011???????????000?????1010111")
def VSSRA_VX = BitPat("b101011???????????100?????1010111")
def VSSRL_VI = BitPat("b101010???????????011?????1010111")
def VSSRL_VV = BitPat("b101010???????????000?????1010111")
def VSSRL_VX = BitPat("b101010???????????100?????1010111")
def VSSUB_VV = BitPat("b100011???????????000?????1010111")
def VSSUB_VX = BitPat("b100011???????????100?????1010111")
def VSSUBU_VV = BitPat("b100010???????????000?????1010111")
def VSSUBU_VX = BitPat("b100010???????????100?????1010111")
def VSUB_VV = BitPat("b000010???????????000?????1010111")
def VSUB_VX = BitPat("b000010???????????100?????1010111")
def VSUXEI1024_V = BitPat("b???101???????????111?????0100111")
def VSUXEI128_V = BitPat("b???101???????????000?????0100111")
def VSUXEI16_V = BitPat("b???001???????????101?????0100111")
def VSUXEI256_V = BitPat("b???101???????????101?????0100111")
def VSUXEI32_V = BitPat("b???001???????????110?????0100111")
def VSUXEI512_V = BitPat("b???101???????????110?????0100111")
def VSUXEI64_V = BitPat("b???001???????????111?????0100111")
def VSUXEI8_V = BitPat("b???001???????????000?????0100111")
def VWADD_VV = BitPat("b110001???????????010?????1010111")
def VWADD_VX = BitPat("b110001???????????110?????1010111")
def VWADD_WV = BitPat("b110101???????????010?????1010111")
def VWADD_WX = BitPat("b110101???????????110?????1010111")
def VWADDU_VV = BitPat("b110000???????????010?????1010111")
def VWADDU_VX = BitPat("b110000???????????110?????1010111")
def VWADDU_WV = BitPat("b110100???????????010?????1010111")
def VWADDU_WX = BitPat("b110100???????????110?????1010111")
def VWMACC_VV = BitPat("b111101???????????010?????1010111")
def VWMACC_VX = BitPat("b111101???????????110?????1010111")
def VWMACCSU_VV = BitPat("b111111???????????010?????1010111")
def VWMACCSU_VX = BitPat("b111111???????????110?????1010111")
def VWMACCU_VV = BitPat("b111100???????????010?????1010111")
def VWMACCU_VX = BitPat("b111100???????????110?????1010111")
def VWMACCUS_VX = BitPat("b111110???????????110?????1010111")
def VWMUL_VV = BitPat("b111011???????????010?????1010111")
def VWMUL_VX = BitPat("b111011???????????110?????1010111")
def VWMULSU_VV = BitPat("b111010???????????010?????1010111")
def VWMULSU_VX = BitPat("b111010???????????110?????1010111")
def VWMULU_VV = BitPat("b111000???????????010?????1010111")
def VWMULU_VX = BitPat("b111000???????????110?????1010111")
def VWREDSUM_VS = BitPat("b110001???????????000?????1010111")
def VWREDSUMU_VS = BitPat("b110000???????????000?????1010111")
def VWSUB_VV = BitPat("b110011???????????010?????1010111")
def VWSUB_VX = BitPat("b110011???????????110?????1010111")
def VWSUB_WV = BitPat("b110111???????????010?????1010111")
def VWSUB_WX = BitPat("b110111???????????110?????1010111")
def VWSUBU_VV = BitPat("b110010???????????010?????1010111")
def VWSUBU_VX = BitPat("b110010???????????110?????1010111")
def VWSUBU_WV = BitPat("b110110???????????010?????1010111")
def VWSUBU_WX = BitPat("b110110???????????110?????1010111")
def VXOR_VI = BitPat("b001011???????????011?????1010111")
def VXOR_VV = BitPat("b001011???????????000?????1010111")
def VXOR_VX = BitPat("b001011???????????100?????1010111")
def VZEXT_VF2 = BitPat("b010010??????00110010?????1010111")
def VZEXT_VF4 = BitPat("b010010??????00100010?????1010111")
def VZEXT_VF8 = BitPat("b010010??????00010010?????1010111")
def WFI = BitPat("b00010000010100000000000001110011")
def XNOR = BitPat("b0100000??????????100?????0110011")
def XOR = BitPat("b0000000??????????100?????0110011")
def XORI = BitPat("b?????????????????100?????0010011")
def XPERM4 = BitPat("b0010100??????????010?????0110011")
def XPERM8 = BitPat("b0010100??????????100?????0110011")
def ZEXT_H = BitPat("b000010000000?????100?????0111011")
}
object Causes {
val misaligned_fetch = 0x0
val fetch_access = 0x1
val illegal_instruction = 0x2
val breakpoint = 0x3
val misaligned_load = 0x4
val load_access = 0x5
val misaligned_store = 0x6
val store_access = 0x7
val user_ecall = 0x8
val supervisor_ecall = 0x9
val virtual_supervisor_ecall = 0xa
val machine_ecall = 0xb
val fetch_page_fault = 0xc
val load_page_fault = 0xd
val store_page_fault = 0xf
val fetch_guest_page_fault = 0x14
val load_guest_page_fault = 0x15
val virtual_instruction = 0x16
val store_guest_page_fault = 0x17
val all = {
val res = collection.mutable.ArrayBuffer[Int]()
res += misaligned_fetch
res += fetch_access
res += illegal_instruction
res += breakpoint
res += misaligned_load
res += load_access
res += misaligned_store
res += store_access
res += user_ecall
res += supervisor_ecall
res += virtual_supervisor_ecall
res += machine_ecall
res += fetch_page_fault
res += load_page_fault
res += store_page_fault
res += fetch_guest_page_fault
res += load_guest_page_fault
res += virtual_instruction
res += store_guest_page_fault
res.toArray
}
}
object CSRs {
val fflags = 0x1
val frm = 0x2
val fcsr = 0x3
val vstart = 0x8
val vxsat = 0x9
val vxrm = 0xa
val vcsr = 0xf
val seed = 0x15
val jvt = 0x17
val cycle = 0xc00
val time = 0xc01
val instret = 0xc02
val hpmcounter3 = 0xc03
val hpmcounter4 = 0xc04
val hpmcounter5 = 0xc05
val hpmcounter6 = 0xc06
val hpmcounter7 = 0xc07
val hpmcounter8 = 0xc08
val hpmcounter9 = 0xc09
val hpmcounter10 = 0xc0a
val hpmcounter11 = 0xc0b
val hpmcounter12 = 0xc0c
val hpmcounter13 = 0xc0d
val hpmcounter14 = 0xc0e
val hpmcounter15 = 0xc0f
val hpmcounter16 = 0xc10
val hpmcounter17 = 0xc11
val hpmcounter18 = 0xc12
val hpmcounter19 = 0xc13
val hpmcounter20 = 0xc14
val hpmcounter21 = 0xc15
val hpmcounter22 = 0xc16
val hpmcounter23 = 0xc17
val hpmcounter24 = 0xc18
val hpmcounter25 = 0xc19
val hpmcounter26 = 0xc1a
val hpmcounter27 = 0xc1b
val hpmcounter28 = 0xc1c
val hpmcounter29 = 0xc1d
val hpmcounter30 = 0xc1e
val hpmcounter31 = 0xc1f
val vl = 0xc20
val vtype = 0xc21
val vlenb = 0xc22
val sstatus = 0x100
val sedeleg = 0x102
val sideleg = 0x103
val sie = 0x104
val stvec = 0x105
val scounteren = 0x106
val senvcfg = 0x10a
val sstateen0 = 0x10c
val sstateen1 = 0x10d
val sstateen2 = 0x10e
val sstateen3 = 0x10f
val sscratch = 0x140
val sepc = 0x141
val scause = 0x142
val stval = 0x143
val sip = 0x144
val stimecmp = 0x14d
val siselect = 0x150
val sireg = 0x151
val stopei = 0x15c
val satp = 0x180
val scontext = 0x5a8
val vsstatus = 0x200
val vsie = 0x204
val vstvec = 0x205
val vsscratch = 0x240
val vsepc = 0x241
val vscause = 0x242
val vstval = 0x243
val vsip = 0x244
val vstimecmp = 0x24d
val vsiselect = 0x250
val vsireg = 0x251
val vstopei = 0x25c
val vsatp = 0x280
val hstatus = 0x600
val hedeleg = 0x602
val hideleg = 0x603
val hie = 0x604
val htimedelta = 0x605
val hcounteren = 0x606
val hgeie = 0x607
val hvien = 0x608
val hvictl = 0x609
val henvcfg = 0x60a
val hstateen0 = 0x60c
val hstateen1 = 0x60d
val hstateen2 = 0x60e
val hstateen3 = 0x60f
val htval = 0x643
val hip = 0x644
val hvip = 0x645
val hviprio1 = 0x646
val hviprio2 = 0x647
val htinst = 0x64a
val hgatp = 0x680
val hcontext = 0x6a8
val hgeip = 0xe12
val vstopi = 0xeb0
val scountovf = 0xda0
val stopi = 0xdb0
val utvt = 0x7
val unxti = 0x45
val uintstatus = 0x46
val uscratchcsw = 0x48
val uscratchcswl = 0x49
val stvt = 0x107
val snxti = 0x145
val sintstatus = 0x146
val sscratchcsw = 0x148
val sscratchcswl = 0x149
val mtvt = 0x307
val mnxti = 0x345
val mintstatus = 0x346
val mscratchcsw = 0x348
val mscratchcswl = 0x349
val mstatus = 0x300
val misa = 0x301
val medeleg = 0x302
val mideleg = 0x303
val mie = 0x304
val mtvec = 0x305
val mcounteren = 0x306
val mvien = 0x308
val mvip = 0x309
val menvcfg = 0x30a
val mstateen0 = 0x30c
val mstateen1 = 0x30d
val mstateen2 = 0x30e
val mstateen3 = 0x30f
val mcountinhibit = 0x320