OpenCores
URL https://opencores.org/ocsvn/potato/potato/trunk

Subversion Repositories potato

[/] [potato/] [trunk/] [riscv-tests/] [encoding.h] - Blame information for rev 64

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 skordal
// See LICENSE for license details.
2
 
3
#ifndef RISCV_CSR_ENCODING_H
4
#define RISCV_CSR_ENCODING_H
5
 
6 58 skordal
#define MSTATUS_IE          0x00000001
7
#define MSTATUS_PRV         0x00000006
8
#define MSTATUS_IE1         0x00000008
9
#define MSTATUS_PRV1        0x00000030
10
#define MSTATUS_IE2         0x00000040
11
#define MSTATUS_PRV2        0x00000180
12
#define MSTATUS_IE3         0x00000200
13
#define MSTATUS_PRV3        0x00000C00
14
#define MSTATUS_FS          0x00003000
15
#define MSTATUS_XS          0x0000C000
16
#define MSTATUS_MPRV        0x00010000
17
#define MSTATUS_VM          0x003E0000
18
#define MSTATUS32_SD        0x80000000
19
#define MSTATUS64_SD        0x8000000000000000
20 6 skordal
 
21 58 skordal
#define SSTATUS_IE          0x00000001
22
#define SSTATUS_PIE         0x00000008
23
#define SSTATUS_PS          0x00000010
24
#define SSTATUS_FS          0x00003000
25
#define SSTATUS_XS          0x0000C000
26
#define SSTATUS_MPRV        0x00010000
27
#define SSTATUS_TIE         0x01000000
28
#define SSTATUS32_SD        0x80000000
29
#define SSTATUS64_SD        0x8000000000000000
30 6 skordal
 
31 58 skordal
#define MIP_SSIP            0x00000002
32
#define MIP_HSIP            0x00000004
33
#define MIP_MSIP            0x00000008
34
#define MIP_STIP            0x00000020
35
#define MIP_HTIP            0x00000040
36
#define MIP_MTIP            0x00000080
37 6 skordal
 
38 58 skordal
#define SIP_SSIP MIP_SSIP
39
#define SIP_STIP MIP_STIP
40
 
41
#define PRV_U 0
42
#define PRV_S 1
43
#define PRV_H 2
44
#define PRV_M 3
45
 
46
#define VM_MBARE 0
47
#define VM_MBB   1
48
#define VM_MBBID 2
49
#define VM_SV32  8
50
#define VM_SV39  9
51
#define VM_SV48  10
52
 
53
#define UA_RV32  0
54
#define UA_RV64  4
55
#define UA_RV128 8
56
 
57
#define IRQ_SOFT   0
58
#define IRQ_TIMER  1
59
#define IRQ_HOST   2
60
#define IRQ_COP    3
61
 
62
#define IMPL_ROCKET 1
63
 
64
#define DEFAULT_MTVEC 0x100
65
 
66 6 skordal
// page table entry (PTE) fields
67 58 skordal
#define PTE_V     0x001 // Valid
68
#define PTE_TYPE  0x01E // Type
69
#define PTE_R     0x020 // Referenced
70
#define PTE_D     0x040 // Dirty
71
#define PTE_SOFT  0x380 // Reserved for Software
72 6 skordal
 
73 58 skordal
#define PTE_TYPE_TABLE        0x00
74
#define PTE_TYPE_TABLE_GLOBAL 0x02
75
#define PTE_TYPE_URX_SR       0x04
76
#define PTE_TYPE_URWX_SRW     0x06
77
#define PTE_TYPE_UR_SR        0x08
78
#define PTE_TYPE_URW_SRW      0x0A
79
#define PTE_TYPE_URX_SRX      0x0C
80
#define PTE_TYPE_URWX_SRWX    0x0E
81
#define PTE_TYPE_SR           0x10
82
#define PTE_TYPE_SRW          0x12
83
#define PTE_TYPE_SRX          0x14
84
#define PTE_TYPE_SRWX         0x16
85
#define PTE_TYPE_SR_GLOBAL    0x18
86
#define PTE_TYPE_SRW_GLOBAL   0x1A
87
#define PTE_TYPE_SRX_GLOBAL   0x1C
88
#define PTE_TYPE_SRWX_GLOBAL  0x1E
89
 
90
#define PTE_PPN_SHIFT 10
91
 
92
#define PTE_TABLE(PTE) ((0x0000000AU >> ((PTE) & 0x1F)) & 1)
93
#define PTE_UR(PTE)    ((0x0000AAA0U >> ((PTE) & 0x1F)) & 1)
94
#define PTE_UW(PTE)    ((0x00008880U >> ((PTE) & 0x1F)) & 1)
95
#define PTE_UX(PTE)    ((0x0000A0A0U >> ((PTE) & 0x1F)) & 1)
96
#define PTE_SR(PTE)    ((0xAAAAAAA0U >> ((PTE) & 0x1F)) & 1)
97
#define PTE_SW(PTE)    ((0x88888880U >> ((PTE) & 0x1F)) & 1)
98
#define PTE_SX(PTE)    ((0xA0A0A000U >> ((PTE) & 0x1F)) & 1)
99
 
100
#define PTE_CHECK_PERM(PTE, SUPERVISOR, STORE, FETCH) \
101
  ((STORE) ? ((SUPERVISOR) ? PTE_SW(PTE) : PTE_UW(PTE)) : \
102
   (FETCH) ? ((SUPERVISOR) ? PTE_SX(PTE) : PTE_UX(PTE)) : \
103
             ((SUPERVISOR) ? PTE_SR(PTE) : PTE_UR(PTE)))
104
 
105 6 skordal
#ifdef __riscv
106
 
107
#ifdef __riscv64
108 58 skordal
# define MSTATUS_SD MSTATUS64_SD
109
# define SSTATUS_SD SSTATUS64_SD
110
# define RISCV_PGLEVEL_BITS 9
111 6 skordal
#else
112 58 skordal
# define MSTATUS_SD MSTATUS32_SD
113
# define SSTATUS_SD SSTATUS32_SD
114
# define RISCV_PGLEVEL_BITS 10
115 6 skordal
#endif
116 58 skordal
#define RISCV_PGSHIFT 12
117 6 skordal
#define RISCV_PGSIZE (1 << RISCV_PGSHIFT)
118
 
119
#ifndef __ASSEMBLER__
120
 
121 58 skordal
#ifdef __GNUC__
122
 
123
#define read_csr(reg) ({ unsigned long __tmp; \
124 6 skordal
  asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \
125
  __tmp; })
126
 
127
#define write_csr(reg, val) \
128
  asm volatile ("csrw " #reg ", %0" :: "r"(val))
129
 
130
#define swap_csr(reg, val) ({ long __tmp; \
131
  asm volatile ("csrrw %0, " #reg ", %1" : "=r"(__tmp) : "r"(val)); \
132
  __tmp; })
133
 
134 58 skordal
#define set_csr(reg, bit) ({ unsigned long __tmp; \
135 6 skordal
  if (__builtin_constant_p(bit) && (bit) < 32) \
136
    asm volatile ("csrrs %0, " #reg ", %1" : "=r"(__tmp) : "i"(bit)); \
137
  else \
138
    asm volatile ("csrrs %0, " #reg ", %1" : "=r"(__tmp) : "r"(bit)); \
139
  __tmp; })
140
 
141 58 skordal
#define clear_csr(reg, bit) ({ unsigned long __tmp; \
142 6 skordal
  if (__builtin_constant_p(bit) && (bit) < 32) \
143
    asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "i"(bit)); \
144
  else \
145
    asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "r"(bit)); \
146
  __tmp; })
147
 
148 58 skordal
#define rdtime() read_csr(time)
149
#define rdcycle() read_csr(cycle)
150
#define rdinstret() read_csr(instret)
151 6 skordal
 
152 58 skordal
#endif
153 6 skordal
 
154
#endif
155
 
156
#endif
157
 
158
#endif
159
/* Automatically generated by parse-opcodes */
160
#ifndef RISCV_ENCODING_H
161
#define RISCV_ENCODING_H
162 58 skordal
#define MATCH_ADD 0x33
163
#define MASK_ADD  0xfe00707f
164
#define MATCH_ADDI 0x13
165
#define MASK_ADDI  0x707f
166
#define MATCH_ADDIW 0x1b
167
#define MASK_ADDIW  0x707f
168
#define MATCH_ADDW 0x3b
169
#define MASK_ADDW  0xfe00707f
170
#define MATCH_AMOADD_D 0x302f
171
#define MASK_AMOADD_D  0xf800707f
172
#define MATCH_AMOADD_W 0x202f
173
#define MASK_AMOADD_W  0xf800707f
174
#define MATCH_AMOAND_D 0x6000302f
175
#define MASK_AMOAND_D  0xf800707f
176
#define MATCH_AMOAND_W 0x6000202f
177
#define MASK_AMOAND_W  0xf800707f
178
#define MATCH_AMOMAX_D 0xa000302f
179
#define MASK_AMOMAX_D  0xf800707f
180
#define MATCH_AMOMAX_W 0xa000202f
181
#define MASK_AMOMAX_W  0xf800707f
182
#define MATCH_AMOMAXU_D 0xe000302f
183
#define MASK_AMOMAXU_D  0xf800707f
184
#define MATCH_AMOMAXU_W 0xe000202f
185
#define MASK_AMOMAXU_W  0xf800707f
186
#define MATCH_AMOMIN_D 0x8000302f
187
#define MASK_AMOMIN_D  0xf800707f
188
#define MATCH_AMOMIN_W 0x8000202f
189
#define MASK_AMOMIN_W  0xf800707f
190
#define MATCH_AMOMINU_D 0xc000302f
191
#define MASK_AMOMINU_D  0xf800707f
192
#define MATCH_AMOMINU_W 0xc000202f
193
#define MASK_AMOMINU_W  0xf800707f
194
#define MATCH_AMOOR_D 0x4000302f
195
#define MASK_AMOOR_D  0xf800707f
196
#define MATCH_AMOOR_W 0x4000202f
197
#define MASK_AMOOR_W  0xf800707f
198
#define MATCH_AMOSWAP_D 0x800302f
199
#define MASK_AMOSWAP_D  0xf800707f
200
#define MATCH_AMOSWAP_W 0x800202f
201
#define MASK_AMOSWAP_W  0xf800707f
202
#define MATCH_AMOXOR_D 0x2000302f
203
#define MASK_AMOXOR_D  0xf800707f
204 6 skordal
#define MATCH_AMOXOR_W 0x2000202f
205
#define MASK_AMOXOR_W  0xf800707f
206 58 skordal
#define MATCH_AND 0x7033
207
#define MASK_AND  0xfe00707f
208
#define MATCH_ANDI 0x7013
209
#define MASK_ANDI  0x707f
210
#define MATCH_AUIPC 0x17
211
#define MASK_AUIPC  0x7f
212
#define MATCH_BEQ 0x63
213
#define MASK_BEQ  0x707f
214
#define MATCH_BGE 0x5063
215
#define MASK_BGE  0x707f
216
#define MATCH_BGEU 0x7063
217
#define MASK_BGEU  0x707f
218
#define MATCH_BLT 0x4063
219
#define MASK_BLT  0x707f
220 6 skordal
#define MATCH_BLTU 0x6063
221
#define MASK_BLTU  0x707f
222 58 skordal
#define MATCH_BNE 0x1063
223
#define MASK_BNE  0x707f
224
#define MATCH_C_ADD 0x6000
225
#define MASK_C_ADD  0xf003
226
#define MATCH_C_ADDI 0x8000
227
#define MASK_C_ADDI  0xe003
228
#define MATCH_C_ADDI4 0xa000
229
#define MASK_C_ADDI4  0xe003
230
#define MATCH_C_ADDIW 0xe000
231
#define MASK_C_ADDIW  0xe003
232
#define MATCH_C_ADDW 0x7000
233
#define MASK_C_ADDW  0xf003
234
#define MATCH_C_BEQZ 0x2002
235
#define MASK_C_BEQZ  0xe003
236
#define MATCH_C_BNEZ 0x6002
237
#define MASK_C_BNEZ  0xe003
238
#define MATCH_C_J 0xa002
239
#define MASK_C_J  0xe003
240
#define MATCH_C_JALR 0x5000
241
#define MASK_C_JALR  0xf003
242
#define MATCH_C_LD 0x2001
243
#define MASK_C_LD  0xe003
244
#define MATCH_C_LDSP 0xc001
245
#define MASK_C_LDSP  0xe003
246
#define MATCH_C_LI 0x0
247
#define MASK_C_LI  0xe003
248
#define MATCH_C_LUI 0x2000
249
#define MASK_C_LUI  0xe003
250
#define MATCH_C_LW 0x1
251
#define MASK_C_LW  0xe003
252
#define MATCH_C_LWSP 0x8001
253
#define MASK_C_LWSP  0xe003
254
#define MATCH_C_MV 0x4000
255
#define MASK_C_MV  0xf003
256
#define MATCH_C_SD 0x6001
257
#define MASK_C_SD  0xe003
258
#define MATCH_C_SDSP 0xe001
259
#define MASK_C_SDSP  0xe003
260
#define MATCH_C_SLLI 0xc000
261
#define MASK_C_SLLI  0xe003
262
#define MATCH_C_SW 0x4001
263
#define MASK_C_SW  0xe003
264
#define MATCH_C_SWSP 0xa001
265
#define MASK_C_SWSP  0xe003
266
#define MATCH_CSRRC 0x3073
267
#define MASK_CSRRC  0x707f
268
#define MATCH_CSRRCI 0x7073
269
#define MASK_CSRRCI  0x707f
270
#define MATCH_CSRRS 0x2073
271
#define MASK_CSRRS  0x707f
272
#define MATCH_CSRRSI 0x6073
273
#define MASK_CSRRSI  0x707f
274 6 skordal
#define MATCH_CSRRW 0x1073
275
#define MASK_CSRRW  0x707f
276 58 skordal
#define MATCH_CSRRWI 0x5073
277
#define MASK_CSRRWI  0x707f
278
#define MATCH_DIV 0x2004033
279
#define MASK_DIV  0xfe00707f
280
#define MATCH_DIVU 0x2005033
281
#define MASK_DIVU  0xfe00707f
282
#define MATCH_DIVUW 0x200503b
283
#define MASK_DIVUW  0xfe00707f
284
#define MATCH_DIVW 0x200403b
285
#define MASK_DIVW  0xfe00707f
286 6 skordal
#define MATCH_FADD_D 0x2000053
287
#define MASK_FADD_D  0xfe00007f
288
#define MATCH_FADD_S 0x53
289
#define MASK_FADD_S  0xfe00007f
290
#define MATCH_FCLASS_D 0xe2001053
291
#define MASK_FCLASS_D  0xfff0707f
292 58 skordal
#define MATCH_FCLASS_S 0xe0001053
293
#define MASK_FCLASS_S  0xfff0707f
294
#define MATCH_FCVT_D_L 0xd2200053
295
#define MASK_FCVT_D_L  0xfff0007f
296
#define MATCH_FCVT_D_LU 0xd2300053
297
#define MASK_FCVT_D_LU  0xfff0007f
298
#define MATCH_FCVT_D_S 0x42000053
299
#define MASK_FCVT_D_S  0xfff0007f
300
#define MATCH_FCVT_D_W 0xd2000053
301
#define MASK_FCVT_D_W  0xfff0007f
302
#define MATCH_FCVT_D_WU 0xd2100053
303
#define MASK_FCVT_D_WU  0xfff0007f
304
#define MATCH_FCVT_L_D 0xc2200053
305
#define MASK_FCVT_L_D  0xfff0007f
306
#define MATCH_FCVT_L_S 0xc0200053
307
#define MASK_FCVT_L_S  0xfff0007f
308
#define MATCH_FCVT_LU_D 0xc2300053
309
#define MASK_FCVT_LU_D  0xfff0007f
310
#define MATCH_FCVT_LU_S 0xc0300053
311
#define MASK_FCVT_LU_S  0xfff0007f
312
#define MATCH_FCVT_S_D 0x40100053
313
#define MASK_FCVT_S_D  0xfff0007f
314
#define MATCH_FCVT_S_L 0xd0200053
315
#define MASK_FCVT_S_L  0xfff0007f
316
#define MATCH_FCVT_S_LU 0xd0300053
317
#define MASK_FCVT_S_LU  0xfff0007f
318 6 skordal
#define MATCH_FCVT_S_W 0xd0000053
319
#define MASK_FCVT_S_W  0xfff0007f
320 58 skordal
#define MATCH_FCVT_S_WU 0xd0100053
321
#define MASK_FCVT_S_WU  0xfff0007f
322
#define MATCH_FCVT_W_D 0xc2000053
323
#define MASK_FCVT_W_D  0xfff0007f
324
#define MATCH_FCVT_W_S 0xc0000053
325
#define MASK_FCVT_W_S  0xfff0007f
326
#define MATCH_FCVT_WU_D 0xc2100053
327
#define MASK_FCVT_WU_D  0xfff0007f
328
#define MATCH_FCVT_WU_S 0xc0100053
329
#define MASK_FCVT_WU_S  0xfff0007f
330 6 skordal
#define MATCH_FDIV_D 0x1a000053
331
#define MASK_FDIV_D  0xfe00007f
332 58 skordal
#define MATCH_FDIV_S 0x18000053
333
#define MASK_FDIV_S  0xfe00007f
334 6 skordal
#define MATCH_FENCE 0xf
335
#define MASK_FENCE  0x707f
336 58 skordal
#define MATCH_FENCE_I 0x100f
337
#define MASK_FENCE_I  0x707f
338
#define MATCH_FEQ_D 0xa2002053
339
#define MASK_FEQ_D  0xfe00707f
340
#define MATCH_FEQ_S 0xa0002053
341
#define MASK_FEQ_S  0xfe00707f
342
#define MATCH_FLD 0x3007
343
#define MASK_FLD  0x707f
344
#define MATCH_FLE_D 0xa2000053
345
#define MASK_FLE_D  0xfe00707f
346 6 skordal
#define MATCH_FLE_S 0xa0000053
347
#define MASK_FLE_S  0xfe00707f
348
#define MATCH_FLT_D 0xa2001053
349
#define MASK_FLT_D  0xfe00707f
350 58 skordal
#define MATCH_FLT_S 0xa0001053
351
#define MASK_FLT_S  0xfe00707f
352
#define MATCH_FLW 0x2007
353
#define MASK_FLW  0x707f
354
#define MATCH_FMADD_D 0x2000043
355
#define MASK_FMADD_D  0x600007f
356
#define MATCH_FMADD_S 0x43
357
#define MASK_FMADD_S  0x600007f
358
#define MATCH_FMAX_D 0x2a001053
359
#define MASK_FMAX_D  0xfe00707f
360
#define MATCH_FMAX_S 0x28001053
361
#define MASK_FMAX_S  0xfe00707f
362
#define MATCH_FMIN_D 0x2a000053
363
#define MASK_FMIN_D  0xfe00707f
364
#define MATCH_FMIN_S 0x28000053
365
#define MASK_FMIN_S  0xfe00707f
366
#define MATCH_FMSUB_D 0x2000047
367
#define MASK_FMSUB_D  0x600007f
368
#define MATCH_FMSUB_S 0x47
369
#define MASK_FMSUB_S  0x600007f
370 6 skordal
#define MATCH_FMUL_D 0x12000053
371
#define MASK_FMUL_D  0xfe00007f
372 58 skordal
#define MATCH_FMUL_S 0x10000053
373
#define MASK_FMUL_S  0xfe00007f
374
#define MATCH_FMV_D_X 0xf2000053
375
#define MASK_FMV_D_X  0xfff0707f
376
#define MATCH_FMV_S_X 0xf0000053
377
#define MASK_FMV_S_X  0xfff0707f
378
#define MATCH_FMV_X_D 0xe2000053
379
#define MASK_FMV_X_D  0xfff0707f
380
#define MATCH_FMV_X_S 0xe0000053
381
#define MASK_FMV_X_S  0xfff0707f
382
#define MATCH_FNMADD_D 0x200004f
383
#define MASK_FNMADD_D  0x600007f
384
#define MATCH_FNMADD_S 0x4f
385
#define MASK_FNMADD_S  0x600007f
386
#define MATCH_FNMSUB_D 0x200004b
387
#define MASK_FNMSUB_D  0x600007f
388
#define MATCH_FNMSUB_S 0x4b
389
#define MASK_FNMSUB_S  0x600007f
390
#define MATCH_FSD 0x3027
391
#define MASK_FSD  0x707f
392
#define MATCH_FSGNJ_D 0x22000053
393
#define MASK_FSGNJ_D  0xfe00707f
394
#define MATCH_FSGNJ_S 0x20000053
395
#define MASK_FSGNJ_S  0xfe00707f
396
#define MATCH_FSGNJN_D 0x22001053
397
#define MASK_FSGNJN_D  0xfe00707f
398
#define MATCH_FSGNJN_S 0x20001053
399
#define MASK_FSGNJN_S  0xfe00707f
400 6 skordal
#define MATCH_FSGNJX_D 0x22002053
401
#define MASK_FSGNJX_D  0xfe00707f
402 58 skordal
#define MATCH_FSGNJX_S 0x20002053
403
#define MASK_FSGNJX_S  0xfe00707f
404
#define MATCH_FSQRT_D 0x5a000053
405
#define MASK_FSQRT_D  0xfff0007f
406
#define MATCH_FSQRT_S 0x58000053
407
#define MASK_FSQRT_S  0xfff0007f
408 6 skordal
#define MATCH_FSUB_D 0xa000053
409
#define MASK_FSUB_D  0xfe00007f
410 58 skordal
#define MATCH_FSUB_S 0x8000053
411
#define MASK_FSUB_S  0xfe00007f
412
#define MATCH_FSW 0x2027
413
#define MASK_FSW  0x707f
414
#define MATCH_HRTS 0x20500073
415
#define MASK_HRTS  0xffffffff
416 6 skordal
#define MATCH_JAL 0x6f
417
#define MASK_JAL  0x7f
418 58 skordal
#define MATCH_JALR 0x67
419
#define MASK_JALR  0x707f
420
#define MATCH_LB 0x3
421
#define MASK_LB  0x707f
422
#define MATCH_LBU 0x4003
423
#define MASK_LBU  0x707f
424
#define MATCH_LD 0x3003
425
#define MASK_LD  0x707f
426
#define MATCH_LH 0x1003
427
#define MASK_LH  0x707f
428
#define MATCH_LHU 0x5003
429
#define MASK_LHU  0x707f
430
#define MATCH_LR_D 0x1000302f
431
#define MASK_LR_D  0xf9f0707f
432
#define MATCH_LR_W 0x1000202f
433
#define MASK_LR_W  0xf9f0707f
434
#define MATCH_LUI 0x37
435
#define MASK_LUI  0x7f
436
#define MATCH_LW 0x2003
437
#define MASK_LW  0x707f
438 6 skordal
#define MATCH_LWU 0x6003
439
#define MASK_LWU  0x707f
440 58 skordal
#define MATCH_MRTH 0x30600073
441
#define MASK_MRTH  0xffffffff
442
#define MATCH_MRTS 0x30500073
443
#define MASK_MRTS  0xffffffff
444
#define MATCH_MUL 0x2000033
445
#define MASK_MUL  0xfe00707f
446
#define MATCH_MULH 0x2001033
447
#define MASK_MULH  0xfe00707f
448 6 skordal
#define MATCH_MULHSU 0x2002033
449
#define MASK_MULHSU  0xfe00707f
450 58 skordal
#define MATCH_MULHU 0x2003033
451
#define MASK_MULHU  0xfe00707f
452
#define MATCH_MULW 0x200003b
453
#define MASK_MULW  0xfe00707f
454
#define MATCH_OR 0x6033
455
#define MASK_OR  0xfe00707f
456
#define MATCH_ORI 0x6013
457
#define MASK_ORI  0x707f
458
#define MATCH_REM 0x2006033
459
#define MASK_REM  0xfe00707f
460
#define MATCH_REMU 0x2007033
461
#define MASK_REMU  0xfe00707f
462
#define MATCH_REMUW 0x200703b
463
#define MASK_REMUW  0xfe00707f
464
#define MATCH_REMW 0x200603b
465
#define MASK_REMW  0xfe00707f
466
#define MATCH_SB 0x23
467
#define MASK_SB  0x707f
468
#define MATCH_SBREAK 0x100073
469
#define MASK_SBREAK  0xffffffff
470
#define MATCH_SC_D 0x1800302f
471
#define MASK_SC_D  0xf800707f
472
#define MATCH_SC_W 0x1800202f
473
#define MASK_SC_W  0xf800707f
474
#define MATCH_SCALL 0x73
475
#define MASK_SCALL  0xffffffff
476
#define MATCH_SD 0x3023
477
#define MASK_SD  0x707f
478
#define MATCH_SFENCE_VM 0x10100073
479
#define MASK_SFENCE_VM  0xfff07fff
480
#define MATCH_SH 0x1023
481
#define MASK_SH  0x707f
482
#define MATCH_SLL 0x1033
483
#define MASK_SLL  0xfe00707f
484
#define MATCH_SLLI 0x1013
485
#define MASK_SLLI  0xfc00707f
486
#define MATCH_SLLIW 0x101b
487
#define MASK_SLLIW  0xfe00707f
488
#define MATCH_SLLW 0x103b
489
#define MASK_SLLW  0xfe00707f
490 6 skordal
#define MATCH_SLT 0x2033
491
#define MASK_SLT  0xfe00707f
492
#define MATCH_SLTI 0x2013
493
#define MASK_SLTI  0x707f
494 58 skordal
#define MATCH_SLTIU 0x3013
495
#define MASK_SLTIU  0x707f
496 6 skordal
#define MATCH_SLTU 0x3033
497
#define MASK_SLTU  0xfe00707f
498 58 skordal
#define MATCH_SRA 0x40005033
499
#define MASK_SRA  0xfe00707f
500
#define MATCH_SRAI 0x40005013
501
#define MASK_SRAI  0xfc00707f
502
#define MATCH_SRAIW 0x4000501b
503
#define MASK_SRAIW  0xfe00707f
504
#define MATCH_SRAW 0x4000503b
505
#define MASK_SRAW  0xfe00707f
506
#define MATCH_SRET 0x10000073
507
#define MASK_SRET  0xffffffff
508
#define MATCH_SRL 0x5033
509
#define MASK_SRL  0xfe00707f
510
#define MATCH_SRLI 0x5013
511
#define MASK_SRLI  0xfc00707f
512
#define MATCH_SRLIW 0x501b
513
#define MASK_SRLIW  0xfe00707f
514
#define MATCH_SRLW 0x503b
515
#define MASK_SRLW  0xfe00707f
516
#define MATCH_SUB 0x40000033
517
#define MASK_SUB  0xfe00707f
518
#define MATCH_SUBW 0x4000003b
519
#define MASK_SUBW  0xfe00707f
520 6 skordal
#define MATCH_SW 0x2023
521
#define MASK_SW  0x707f
522 58 skordal
#define MATCH_WFI 0x10200073
523
#define MASK_WFI  0xffffffff
524
#define MATCH_XOR 0x4033
525
#define MASK_XOR  0xfe00707f
526
#define MATCH_XORI 0x4013
527
#define MASK_XORI  0x707f
528 6 skordal
#define CSR_FFLAGS 0x1
529
#define CSR_FRM 0x2
530
#define CSR_FCSR 0x3
531
#define CSR_CYCLE 0xc00
532
#define CSR_TIME 0xc01
533
#define CSR_INSTRET 0xc02
534 58 skordal
#define CSR_STATS 0xc0
535 6 skordal
#define CSR_UARCH0 0xcc0
536
#define CSR_UARCH1 0xcc1
537
#define CSR_UARCH2 0xcc2
538
#define CSR_UARCH3 0xcc3
539
#define CSR_UARCH4 0xcc4
540
#define CSR_UARCH5 0xcc5
541
#define CSR_UARCH6 0xcc6
542
#define CSR_UARCH7 0xcc7
543
#define CSR_UARCH8 0xcc8
544
#define CSR_UARCH9 0xcc9
545
#define CSR_UARCH10 0xcca
546
#define CSR_UARCH11 0xccb
547
#define CSR_UARCH12 0xccc
548
#define CSR_UARCH13 0xccd
549
#define CSR_UARCH14 0xcce
550
#define CSR_UARCH15 0xccf
551 58 skordal
#define CSR_SSTATUS 0x100
552
#define CSR_STVEC 0x101
553
#define CSR_SIE 0x104
554
#define CSR_STIMECMP 0x121
555
#define CSR_SSCRATCH 0x140
556
#define CSR_SEPC 0x141
557
#define CSR_SIP 0x144
558
#define CSR_SPTBR 0x180
559
#define CSR_SASID 0x181
560
#define CSR_CYCLEW 0x900
561
#define CSR_TIMEW 0x901
562
#define CSR_INSTRETW 0x902
563
#define CSR_STIME 0xd01
564
#define CSR_SCAUSE 0xd42
565
#define CSR_SBADADDR 0xd43
566
#define CSR_STIMEW 0xa01
567
#define CSR_MSTATUS 0x300
568
#define CSR_MTVEC 0x301
569
#define CSR_MTDELEG 0x302
570
#define CSR_MIE 0x304
571
#define CSR_MTIMECMP 0x321
572
#define CSR_MSCRATCH 0x340
573
#define CSR_MEPC 0x341
574
#define CSR_MCAUSE 0x342
575
#define CSR_MBADADDR 0x343
576
#define CSR_MIP 0x344
577
#define CSR_MTIME 0x701
578
#define CSR_MCPUID 0xf00
579
#define CSR_MIMPID 0xf01
580
#define CSR_MHARTID 0xf10
581
#define CSR_MTOHOST 0x780
582
#define CSR_MFROMHOST 0x781
583
#define CSR_MRESET 0x782
584
#define CSR_SEND_IPI 0x783
585 6 skordal
#define CSR_CYCLEH 0xc80
586
#define CSR_TIMEH 0xc81
587
#define CSR_INSTRETH 0xc82
588 58 skordal
#define CSR_CYCLEHW 0x980
589
#define CSR_TIMEHW 0x981
590
#define CSR_INSTRETHW 0x982
591
#define CSR_STIMEH 0xd81
592
#define CSR_STIMEHW 0xa81
593
#define CSR_MTIMEH 0x741
594 6 skordal
#define CAUSE_MISALIGNED_FETCH 0x0
595
#define CAUSE_FAULT_FETCH 0x1
596
#define CAUSE_ILLEGAL_INSTRUCTION 0x2
597 58 skordal
#define CAUSE_BREAKPOINT 0x3
598
#define CAUSE_MISALIGNED_LOAD 0x4
599
#define CAUSE_FAULT_LOAD 0x5
600
#define CAUSE_MISALIGNED_STORE 0x6
601
#define CAUSE_FAULT_STORE 0x7
602
#define CAUSE_USER_ECALL 0x8
603
#define CAUSE_SUPERVISOR_ECALL 0x9
604
#define CAUSE_HYPERVISOR_ECALL 0xa
605
#define CAUSE_MACHINE_ECALL 0xb
606 6 skordal
#endif
607
#ifdef DECLARE_INSN
608 58 skordal
DECLARE_INSN(add, MATCH_ADD, MASK_ADD)
609
DECLARE_INSN(addi, MATCH_ADDI, MASK_ADDI)
610
DECLARE_INSN(addiw, MATCH_ADDIW, MASK_ADDIW)
611
DECLARE_INSN(addw, MATCH_ADDW, MASK_ADDW)
612
DECLARE_INSN(amoadd_d, MATCH_AMOADD_D, MASK_AMOADD_D)
613
DECLARE_INSN(amoadd_w, MATCH_AMOADD_W, MASK_AMOADD_W)
614
DECLARE_INSN(amoand_d, MATCH_AMOAND_D, MASK_AMOAND_D)
615
DECLARE_INSN(amoand_w, MATCH_AMOAND_W, MASK_AMOAND_W)
616
DECLARE_INSN(amomax_d, MATCH_AMOMAX_D, MASK_AMOMAX_D)
617
DECLARE_INSN(amomax_w, MATCH_AMOMAX_W, MASK_AMOMAX_W)
618
DECLARE_INSN(amomaxu_d, MATCH_AMOMAXU_D, MASK_AMOMAXU_D)
619
DECLARE_INSN(amomaxu_w, MATCH_AMOMAXU_W, MASK_AMOMAXU_W)
620
DECLARE_INSN(amomin_d, MATCH_AMOMIN_D, MASK_AMOMIN_D)
621
DECLARE_INSN(amomin_w, MATCH_AMOMIN_W, MASK_AMOMIN_W)
622
DECLARE_INSN(amominu_d, MATCH_AMOMINU_D, MASK_AMOMINU_D)
623
DECLARE_INSN(amominu_w, MATCH_AMOMINU_W, MASK_AMOMINU_W)
624
DECLARE_INSN(amoor_d, MATCH_AMOOR_D, MASK_AMOOR_D)
625
DECLARE_INSN(amoor_w, MATCH_AMOOR_W, MASK_AMOOR_W)
626
DECLARE_INSN(amoswap_d, MATCH_AMOSWAP_D, MASK_AMOSWAP_D)
627
DECLARE_INSN(amoswap_w, MATCH_AMOSWAP_W, MASK_AMOSWAP_W)
628
DECLARE_INSN(amoxor_d, MATCH_AMOXOR_D, MASK_AMOXOR_D)
629 6 skordal
DECLARE_INSN(amoxor_w, MATCH_AMOXOR_W, MASK_AMOXOR_W)
630 58 skordal
DECLARE_INSN(and, MATCH_AND, MASK_AND)
631
DECLARE_INSN(andi, MATCH_ANDI, MASK_ANDI)
632
DECLARE_INSN(auipc, MATCH_AUIPC, MASK_AUIPC)
633
DECLARE_INSN(beq, MATCH_BEQ, MASK_BEQ)
634
DECLARE_INSN(bge, MATCH_BGE, MASK_BGE)
635
DECLARE_INSN(bgeu, MATCH_BGEU, MASK_BGEU)
636
DECLARE_INSN(blt, MATCH_BLT, MASK_BLT)
637 6 skordal
DECLARE_INSN(bltu, MATCH_BLTU, MASK_BLTU)
638 58 skordal
DECLARE_INSN(bne, MATCH_BNE, MASK_BNE)
639
DECLARE_INSN(c_add, MATCH_C_ADD, MASK_C_ADD)
640
DECLARE_INSN(c_addi, MATCH_C_ADDI, MASK_C_ADDI)
641
DECLARE_INSN(c_addi4, MATCH_C_ADDI4, MASK_C_ADDI4)
642
DECLARE_INSN(c_addiw, MATCH_C_ADDIW, MASK_C_ADDIW)
643
DECLARE_INSN(c_addw, MATCH_C_ADDW, MASK_C_ADDW)
644
DECLARE_INSN(c_beqz, MATCH_C_BEQZ, MASK_C_BEQZ)
645
DECLARE_INSN(c_bnez, MATCH_C_BNEZ, MASK_C_BNEZ)
646
DECLARE_INSN(c_j, MATCH_C_J, MASK_C_J)
647
DECLARE_INSN(c_jalr, MATCH_C_JALR, MASK_C_JALR)
648
DECLARE_INSN(c_ld, MATCH_C_LD, MASK_C_LD)
649
DECLARE_INSN(c_ldsp, MATCH_C_LDSP, MASK_C_LDSP)
650
DECLARE_INSN(c_li, MATCH_C_LI, MASK_C_LI)
651
DECLARE_INSN(c_lui, MATCH_C_LUI, MASK_C_LUI)
652
DECLARE_INSN(c_lw, MATCH_C_LW, MASK_C_LW)
653
DECLARE_INSN(c_lwsp, MATCH_C_LWSP, MASK_C_LWSP)
654
DECLARE_INSN(c_mv, MATCH_C_MV, MASK_C_MV)
655
DECLARE_INSN(c_sd, MATCH_C_SD, MASK_C_SD)
656
DECLARE_INSN(c_sdsp, MATCH_C_SDSP, MASK_C_SDSP)
657
DECLARE_INSN(c_slli, MATCH_C_SLLI, MASK_C_SLLI)
658
DECLARE_INSN(c_sw, MATCH_C_SW, MASK_C_SW)
659
DECLARE_INSN(c_swsp, MATCH_C_SWSP, MASK_C_SWSP)
660
DECLARE_INSN(csrrc, MATCH_CSRRC, MASK_CSRRC)
661
DECLARE_INSN(csrrci, MATCH_CSRRCI, MASK_CSRRCI)
662
DECLARE_INSN(csrrs, MATCH_CSRRS, MASK_CSRRS)
663
DECLARE_INSN(csrrsi, MATCH_CSRRSI, MASK_CSRRSI)
664 6 skordal
DECLARE_INSN(csrrw, MATCH_CSRRW, MASK_CSRRW)
665 58 skordal
DECLARE_INSN(csrrwi, MATCH_CSRRWI, MASK_CSRRWI)
666
DECLARE_INSN(div, MATCH_DIV, MASK_DIV)
667
DECLARE_INSN(divu, MATCH_DIVU, MASK_DIVU)
668
DECLARE_INSN(divuw, MATCH_DIVUW, MASK_DIVUW)
669
DECLARE_INSN(divw, MATCH_DIVW, MASK_DIVW)
670 6 skordal
DECLARE_INSN(fadd_d, MATCH_FADD_D, MASK_FADD_D)
671
DECLARE_INSN(fadd_s, MATCH_FADD_S, MASK_FADD_S)
672
DECLARE_INSN(fclass_d, MATCH_FCLASS_D, MASK_FCLASS_D)
673 58 skordal
DECLARE_INSN(fclass_s, MATCH_FCLASS_S, MASK_FCLASS_S)
674
DECLARE_INSN(fcvt_d_l, MATCH_FCVT_D_L, MASK_FCVT_D_L)
675
DECLARE_INSN(fcvt_d_lu, MATCH_FCVT_D_LU, MASK_FCVT_D_LU)
676
DECLARE_INSN(fcvt_d_s, MATCH_FCVT_D_S, MASK_FCVT_D_S)
677
DECLARE_INSN(fcvt_d_w, MATCH_FCVT_D_W, MASK_FCVT_D_W)
678
DECLARE_INSN(fcvt_d_wu, MATCH_FCVT_D_WU, MASK_FCVT_D_WU)
679
DECLARE_INSN(fcvt_l_d, MATCH_FCVT_L_D, MASK_FCVT_L_D)
680
DECLARE_INSN(fcvt_l_s, MATCH_FCVT_L_S, MASK_FCVT_L_S)
681
DECLARE_INSN(fcvt_lu_d, MATCH_FCVT_LU_D, MASK_FCVT_LU_D)
682
DECLARE_INSN(fcvt_lu_s, MATCH_FCVT_LU_S, MASK_FCVT_LU_S)
683
DECLARE_INSN(fcvt_s_d, MATCH_FCVT_S_D, MASK_FCVT_S_D)
684
DECLARE_INSN(fcvt_s_l, MATCH_FCVT_S_L, MASK_FCVT_S_L)
685
DECLARE_INSN(fcvt_s_lu, MATCH_FCVT_S_LU, MASK_FCVT_S_LU)
686 6 skordal
DECLARE_INSN(fcvt_s_w, MATCH_FCVT_S_W, MASK_FCVT_S_W)
687 58 skordal
DECLARE_INSN(fcvt_s_wu, MATCH_FCVT_S_WU, MASK_FCVT_S_WU)
688
DECLARE_INSN(fcvt_w_d, MATCH_FCVT_W_D, MASK_FCVT_W_D)
689
DECLARE_INSN(fcvt_w_s, MATCH_FCVT_W_S, MASK_FCVT_W_S)
690
DECLARE_INSN(fcvt_wu_d, MATCH_FCVT_WU_D, MASK_FCVT_WU_D)
691
DECLARE_INSN(fcvt_wu_s, MATCH_FCVT_WU_S, MASK_FCVT_WU_S)
692 6 skordal
DECLARE_INSN(fdiv_d, MATCH_FDIV_D, MASK_FDIV_D)
693 58 skordal
DECLARE_INSN(fdiv_s, MATCH_FDIV_S, MASK_FDIV_S)
694 6 skordal
DECLARE_INSN(fence, MATCH_FENCE, MASK_FENCE)
695 58 skordal
DECLARE_INSN(fence_i, MATCH_FENCE_I, MASK_FENCE_I)
696
DECLARE_INSN(feq_d, MATCH_FEQ_D, MASK_FEQ_D)
697
DECLARE_INSN(feq_s, MATCH_FEQ_S, MASK_FEQ_S)
698
DECLARE_INSN(fld, MATCH_FLD, MASK_FLD)
699
DECLARE_INSN(fle_d, MATCH_FLE_D, MASK_FLE_D)
700 6 skordal
DECLARE_INSN(fle_s, MATCH_FLE_S, MASK_FLE_S)
701
DECLARE_INSN(flt_d, MATCH_FLT_D, MASK_FLT_D)
702 58 skordal
DECLARE_INSN(flt_s, MATCH_FLT_S, MASK_FLT_S)
703
DECLARE_INSN(flw, MATCH_FLW, MASK_FLW)
704
DECLARE_INSN(fmadd_d, MATCH_FMADD_D, MASK_FMADD_D)
705
DECLARE_INSN(fmadd_s, MATCH_FMADD_S, MASK_FMADD_S)
706
DECLARE_INSN(fmax_d, MATCH_FMAX_D, MASK_FMAX_D)
707
DECLARE_INSN(fmax_s, MATCH_FMAX_S, MASK_FMAX_S)
708
DECLARE_INSN(fmin_d, MATCH_FMIN_D, MASK_FMIN_D)
709
DECLARE_INSN(fmin_s, MATCH_FMIN_S, MASK_FMIN_S)
710
DECLARE_INSN(fmsub_d, MATCH_FMSUB_D, MASK_FMSUB_D)
711
DECLARE_INSN(fmsub_s, MATCH_FMSUB_S, MASK_FMSUB_S)
712 6 skordal
DECLARE_INSN(fmul_d, MATCH_FMUL_D, MASK_FMUL_D)
713 58 skordal
DECLARE_INSN(fmul_s, MATCH_FMUL_S, MASK_FMUL_S)
714
DECLARE_INSN(fmv_d_x, MATCH_FMV_D_X, MASK_FMV_D_X)
715
DECLARE_INSN(fmv_s_x, MATCH_FMV_S_X, MASK_FMV_S_X)
716
DECLARE_INSN(fmv_x_d, MATCH_FMV_X_D, MASK_FMV_X_D)
717
DECLARE_INSN(fmv_x_s, MATCH_FMV_X_S, MASK_FMV_X_S)
718
DECLARE_INSN(fnmadd_d, MATCH_FNMADD_D, MASK_FNMADD_D)
719
DECLARE_INSN(fnmadd_s, MATCH_FNMADD_S, MASK_FNMADD_S)
720
DECLARE_INSN(fnmsub_d, MATCH_FNMSUB_D, MASK_FNMSUB_D)
721
DECLARE_INSN(fnmsub_s, MATCH_FNMSUB_S, MASK_FNMSUB_S)
722
DECLARE_INSN(fsd, MATCH_FSD, MASK_FSD)
723
DECLARE_INSN(fsgnj_d, MATCH_FSGNJ_D, MASK_FSGNJ_D)
724
DECLARE_INSN(fsgnj_s, MATCH_FSGNJ_S, MASK_FSGNJ_S)
725
DECLARE_INSN(fsgnjn_d, MATCH_FSGNJN_D, MASK_FSGNJN_D)
726
DECLARE_INSN(fsgnjn_s, MATCH_FSGNJN_S, MASK_FSGNJN_S)
727 6 skordal
DECLARE_INSN(fsgnjx_d, MATCH_FSGNJX_D, MASK_FSGNJX_D)
728 58 skordal
DECLARE_INSN(fsgnjx_s, MATCH_FSGNJX_S, MASK_FSGNJX_S)
729
DECLARE_INSN(fsqrt_d, MATCH_FSQRT_D, MASK_FSQRT_D)
730
DECLARE_INSN(fsqrt_s, MATCH_FSQRT_S, MASK_FSQRT_S)
731 6 skordal
DECLARE_INSN(fsub_d, MATCH_FSUB_D, MASK_FSUB_D)
732 58 skordal
DECLARE_INSN(fsub_s, MATCH_FSUB_S, MASK_FSUB_S)
733
DECLARE_INSN(fsw, MATCH_FSW, MASK_FSW)
734
DECLARE_INSN(hrts, MATCH_HRTS, MASK_HRTS)
735 6 skordal
DECLARE_INSN(jal, MATCH_JAL, MASK_JAL)
736 58 skordal
DECLARE_INSN(jalr, MATCH_JALR, MASK_JALR)
737
DECLARE_INSN(lb, MATCH_LB, MASK_LB)
738
DECLARE_INSN(lbu, MATCH_LBU, MASK_LBU)
739
DECLARE_INSN(ld, MATCH_LD, MASK_LD)
740
DECLARE_INSN(lh, MATCH_LH, MASK_LH)
741
DECLARE_INSN(lhu, MATCH_LHU, MASK_LHU)
742
DECLARE_INSN(lr_d, MATCH_LR_D, MASK_LR_D)
743
DECLARE_INSN(lr_w, MATCH_LR_W, MASK_LR_W)
744
DECLARE_INSN(lui, MATCH_LUI, MASK_LUI)
745
DECLARE_INSN(lw, MATCH_LW, MASK_LW)
746 6 skordal
DECLARE_INSN(lwu, MATCH_LWU, MASK_LWU)
747 58 skordal
DECLARE_INSN(mrth, MATCH_MRTH, MASK_MRTH)
748
DECLARE_INSN(mrts, MATCH_MRTS, MASK_MRTS)
749
DECLARE_INSN(mul, MATCH_MUL, MASK_MUL)
750
DECLARE_INSN(mulh, MATCH_MULH, MASK_MULH)
751 6 skordal
DECLARE_INSN(mulhsu, MATCH_MULHSU, MASK_MULHSU)
752 58 skordal
DECLARE_INSN(mulhu, MATCH_MULHU, MASK_MULHU)
753
DECLARE_INSN(mulw, MATCH_MULW, MASK_MULW)
754
DECLARE_INSN(or, MATCH_OR, MASK_OR)
755
DECLARE_INSN(ori, MATCH_ORI, MASK_ORI)
756
DECLARE_INSN(rem, MATCH_REM, MASK_REM)
757
DECLARE_INSN(remu, MATCH_REMU, MASK_REMU)
758
DECLARE_INSN(remuw, MATCH_REMUW, MASK_REMUW)
759
DECLARE_INSN(remw, MATCH_REMW, MASK_REMW)
760
DECLARE_INSN(sb, MATCH_SB, MASK_SB)
761
DECLARE_INSN(sbreak, MATCH_SBREAK, MASK_SBREAK)
762
DECLARE_INSN(sc_d, MATCH_SC_D, MASK_SC_D)
763
DECLARE_INSN(sc_w, MATCH_SC_W, MASK_SC_W)
764
DECLARE_INSN(scall, MATCH_SCALL, MASK_SCALL)
765
DECLARE_INSN(sd, MATCH_SD, MASK_SD)
766
DECLARE_INSN(sfence_vm, MATCH_SFENCE_VM, MASK_SFENCE_VM)
767
DECLARE_INSN(sh, MATCH_SH, MASK_SH)
768
DECLARE_INSN(sll, MATCH_SLL, MASK_SLL)
769
DECLARE_INSN(slli, MATCH_SLLI, MASK_SLLI)
770
DECLARE_INSN(slliw, MATCH_SLLIW, MASK_SLLIW)
771
DECLARE_INSN(sllw, MATCH_SLLW, MASK_SLLW)
772 6 skordal
DECLARE_INSN(slt, MATCH_SLT, MASK_SLT)
773
DECLARE_INSN(slti, MATCH_SLTI, MASK_SLTI)
774 58 skordal
DECLARE_INSN(sltiu, MATCH_SLTIU, MASK_SLTIU)
775 6 skordal
DECLARE_INSN(sltu, MATCH_SLTU, MASK_SLTU)
776 58 skordal
DECLARE_INSN(sra, MATCH_SRA, MASK_SRA)
777
DECLARE_INSN(srai, MATCH_SRAI, MASK_SRAI)
778
DECLARE_INSN(sraiw, MATCH_SRAIW, MASK_SRAIW)
779
DECLARE_INSN(sraw, MATCH_SRAW, MASK_SRAW)
780
DECLARE_INSN(sret, MATCH_SRET, MASK_SRET)
781
DECLARE_INSN(srl, MATCH_SRL, MASK_SRL)
782
DECLARE_INSN(srli, MATCH_SRLI, MASK_SRLI)
783
DECLARE_INSN(srliw, MATCH_SRLIW, MASK_SRLIW)
784
DECLARE_INSN(srlw, MATCH_SRLW, MASK_SRLW)
785
DECLARE_INSN(sub, MATCH_SUB, MASK_SUB)
786
DECLARE_INSN(subw, MATCH_SUBW, MASK_SUBW)
787 6 skordal
DECLARE_INSN(sw, MATCH_SW, MASK_SW)
788 58 skordal
DECLARE_INSN(wfi, MATCH_WFI, MASK_WFI)
789
DECLARE_INSN(xor, MATCH_XOR, MASK_XOR)
790
DECLARE_INSN(xori, MATCH_XORI, MASK_XORI)
791 6 skordal
#endif
792
#ifdef DECLARE_CSR
793
DECLARE_CSR(fflags, CSR_FFLAGS)
794
DECLARE_CSR(frm, CSR_FRM)
795
DECLARE_CSR(fcsr, CSR_FCSR)
796
DECLARE_CSR(cycle, CSR_CYCLE)
797
DECLARE_CSR(time, CSR_TIME)
798
DECLARE_CSR(instret, CSR_INSTRET)
799 58 skordal
DECLARE_CSR(stats, CSR_STATS)
800 6 skordal
DECLARE_CSR(uarch0, CSR_UARCH0)
801
DECLARE_CSR(uarch1, CSR_UARCH1)
802
DECLARE_CSR(uarch2, CSR_UARCH2)
803
DECLARE_CSR(uarch3, CSR_UARCH3)
804
DECLARE_CSR(uarch4, CSR_UARCH4)
805
DECLARE_CSR(uarch5, CSR_UARCH5)
806
DECLARE_CSR(uarch6, CSR_UARCH6)
807
DECLARE_CSR(uarch7, CSR_UARCH7)
808
DECLARE_CSR(uarch8, CSR_UARCH8)
809
DECLARE_CSR(uarch9, CSR_UARCH9)
810
DECLARE_CSR(uarch10, CSR_UARCH10)
811
DECLARE_CSR(uarch11, CSR_UARCH11)
812
DECLARE_CSR(uarch12, CSR_UARCH12)
813
DECLARE_CSR(uarch13, CSR_UARCH13)
814
DECLARE_CSR(uarch14, CSR_UARCH14)
815
DECLARE_CSR(uarch15, CSR_UARCH15)
816 58 skordal
DECLARE_CSR(sstatus, CSR_SSTATUS)
817
DECLARE_CSR(stvec, CSR_STVEC)
818
DECLARE_CSR(sie, CSR_SIE)
819
DECLARE_CSR(stimecmp, CSR_STIMECMP)
820
DECLARE_CSR(sscratch, CSR_SSCRATCH)
821
DECLARE_CSR(sepc, CSR_SEPC)
822
DECLARE_CSR(sip, CSR_SIP)
823
DECLARE_CSR(sptbr, CSR_SPTBR)
824
DECLARE_CSR(sasid, CSR_SASID)
825
DECLARE_CSR(cyclew, CSR_CYCLEW)
826
DECLARE_CSR(timew, CSR_TIMEW)
827
DECLARE_CSR(instretw, CSR_INSTRETW)
828
DECLARE_CSR(stime, CSR_STIME)
829
DECLARE_CSR(scause, CSR_SCAUSE)
830
DECLARE_CSR(sbadaddr, CSR_SBADADDR)
831
DECLARE_CSR(stimew, CSR_STIMEW)
832
DECLARE_CSR(mstatus, CSR_MSTATUS)
833
DECLARE_CSR(mtvec, CSR_MTVEC)
834
DECLARE_CSR(mtdeleg, CSR_MTDELEG)
835
DECLARE_CSR(mie, CSR_MIE)
836
DECLARE_CSR(mtimecmp, CSR_MTIMECMP)
837
DECLARE_CSR(mscratch, CSR_MSCRATCH)
838
DECLARE_CSR(mepc, CSR_MEPC)
839
DECLARE_CSR(mcause, CSR_MCAUSE)
840
DECLARE_CSR(mbadaddr, CSR_MBADADDR)
841
DECLARE_CSR(mip, CSR_MIP)
842
DECLARE_CSR(mtime, CSR_MTIME)
843
DECLARE_CSR(mcpuid, CSR_MCPUID)
844
DECLARE_CSR(mimpid, CSR_MIMPID)
845
DECLARE_CSR(mhartid, CSR_MHARTID)
846
DECLARE_CSR(mtohost, CSR_MTOHOST)
847
DECLARE_CSR(mfromhost, CSR_MFROMHOST)
848
DECLARE_CSR(mreset, CSR_MRESET)
849
DECLARE_CSR(send_ipi, CSR_SEND_IPI)
850 6 skordal
DECLARE_CSR(cycleh, CSR_CYCLEH)
851
DECLARE_CSR(timeh, CSR_TIMEH)
852
DECLARE_CSR(instreth, CSR_INSTRETH)
853 58 skordal
DECLARE_CSR(cyclehw, CSR_CYCLEHW)
854
DECLARE_CSR(timehw, CSR_TIMEHW)
855
DECLARE_CSR(instrethw, CSR_INSTRETHW)
856
DECLARE_CSR(stimeh, CSR_STIMEH)
857
DECLARE_CSR(stimehw, CSR_STIMEHW)
858
DECLARE_CSR(mtimeh, CSR_MTIMEH)
859 6 skordal
#endif
860
#ifdef DECLARE_CAUSE
861
DECLARE_CAUSE("fflags", CAUSE_FFLAGS)
862
DECLARE_CAUSE("frm", CAUSE_FRM)
863
DECLARE_CAUSE("fcsr", CAUSE_FCSR)
864
DECLARE_CAUSE("cycle", CAUSE_CYCLE)
865
DECLARE_CAUSE("time", CAUSE_TIME)
866
DECLARE_CAUSE("instret", CAUSE_INSTRET)
867 58 skordal
DECLARE_CAUSE("stats", CAUSE_STATS)
868 6 skordal
DECLARE_CAUSE("uarch0", CAUSE_UARCH0)
869
DECLARE_CAUSE("uarch1", CAUSE_UARCH1)
870
DECLARE_CAUSE("uarch2", CAUSE_UARCH2)
871
DECLARE_CAUSE("uarch3", CAUSE_UARCH3)
872
DECLARE_CAUSE("uarch4", CAUSE_UARCH4)
873
DECLARE_CAUSE("uarch5", CAUSE_UARCH5)
874
DECLARE_CAUSE("uarch6", CAUSE_UARCH6)
875
DECLARE_CAUSE("uarch7", CAUSE_UARCH7)
876
DECLARE_CAUSE("uarch8", CAUSE_UARCH8)
877
DECLARE_CAUSE("uarch9", CAUSE_UARCH9)
878
DECLARE_CAUSE("uarch10", CAUSE_UARCH10)
879
DECLARE_CAUSE("uarch11", CAUSE_UARCH11)
880
DECLARE_CAUSE("uarch12", CAUSE_UARCH12)
881
DECLARE_CAUSE("uarch13", CAUSE_UARCH13)
882
DECLARE_CAUSE("uarch14", CAUSE_UARCH14)
883
DECLARE_CAUSE("uarch15", CAUSE_UARCH15)
884 58 skordal
DECLARE_CAUSE("sstatus", CAUSE_SSTATUS)
885
DECLARE_CAUSE("stvec", CAUSE_STVEC)
886
DECLARE_CAUSE("sie", CAUSE_SIE)
887
DECLARE_CAUSE("stimecmp", CAUSE_STIMECMP)
888
DECLARE_CAUSE("sscratch", CAUSE_SSCRATCH)
889
DECLARE_CAUSE("sepc", CAUSE_SEPC)
890
DECLARE_CAUSE("sip", CAUSE_SIP)
891
DECLARE_CAUSE("sptbr", CAUSE_SPTBR)
892
DECLARE_CAUSE("sasid", CAUSE_SASID)
893
DECLARE_CAUSE("cyclew", CAUSE_CYCLEW)
894
DECLARE_CAUSE("timew", CAUSE_TIMEW)
895
DECLARE_CAUSE("instretw", CAUSE_INSTRETW)
896
DECLARE_CAUSE("stime", CAUSE_STIME)
897
DECLARE_CAUSE("scause", CAUSE_SCAUSE)
898
DECLARE_CAUSE("sbadaddr", CAUSE_SBADADDR)
899
DECLARE_CAUSE("stimew", CAUSE_STIMEW)
900
DECLARE_CAUSE("mstatus", CAUSE_MSTATUS)
901
DECLARE_CAUSE("mtvec", CAUSE_MTVEC)
902
DECLARE_CAUSE("mtdeleg", CAUSE_MTDELEG)
903
DECLARE_CAUSE("mie", CAUSE_MIE)
904
DECLARE_CAUSE("mtimecmp", CAUSE_MTIMECMP)
905
DECLARE_CAUSE("mscratch", CAUSE_MSCRATCH)
906
DECLARE_CAUSE("mepc", CAUSE_MEPC)
907
DECLARE_CAUSE("mcause", CAUSE_MCAUSE)
908
DECLARE_CAUSE("mbadaddr", CAUSE_MBADADDR)
909
DECLARE_CAUSE("mip", CAUSE_MIP)
910
DECLARE_CAUSE("mtime", CAUSE_MTIME)
911
DECLARE_CAUSE("mcpuid", CAUSE_MCPUID)
912
DECLARE_CAUSE("mimpid", CAUSE_MIMPID)
913
DECLARE_CAUSE("mhartid", CAUSE_MHARTID)
914
DECLARE_CAUSE("mtohost", CAUSE_MTOHOST)
915
DECLARE_CAUSE("mfromhost", CAUSE_MFROMHOST)
916
DECLARE_CAUSE("mreset", CAUSE_MRESET)
917
DECLARE_CAUSE("send_ipi", CAUSE_SEND_IPI)
918 6 skordal
DECLARE_CAUSE("cycleh", CAUSE_CYCLEH)
919
DECLARE_CAUSE("timeh", CAUSE_TIMEH)
920
DECLARE_CAUSE("instreth", CAUSE_INSTRETH)
921 58 skordal
DECLARE_CAUSE("cyclehw", CAUSE_CYCLEHW)
922
DECLARE_CAUSE("timehw", CAUSE_TIMEHW)
923
DECLARE_CAUSE("instrethw", CAUSE_INSTRETHW)
924
DECLARE_CAUSE("stimeh", CAUSE_STIMEH)
925
DECLARE_CAUSE("stimehw", CAUSE_STIMEHW)
926
DECLARE_CAUSE("mtimeh", CAUSE_MTIMEH)
927 6 skordal
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.