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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v7/] [rtl/] [common/] [FT64_defines.vh] - Blame information for rev 60

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

Line No. Rev Author Line
1 60 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2017-2018  Robert Finch, Waterloo
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@finitron.ca
6
//       ||
7
//
8
//      FT64_defines.v
9
//
10
// This source file is free software: you can redistribute it and/or modify 
11
// it under the terms of the GNU Lesser General Public License as published 
12
// by the Free Software Foundation, either version 3 of the License, or     
13
// (at your option) any later version.                                      
14
//                                                                          
15
// This source file is distributed in the hope that it will be useful,      
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
18
// GNU General Public License for more details.                             
19
//                                                                          
20
// You should have received a copy of the GNU General Public License        
21
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
22
//
23
// ============================================================================
24
//
25
`define HIGH        1'b1
26
`define LOW         1'b0
27
`define TRUE        1'b1
28
`define FALSE       1'b0
29
//`define Q2VECTORS   1'b1
30
 
31
`define ZERO            64'd0
32
 
33
`define BRK     6'h00
34
`define FVECTOR 6'h01
35
`define VCMPRSS     6'h00
36
`define VCIDX       6'h01
37
`define VSCAN       6'h02
38
`define VABS        6'h03
39
`define VADD        6'h04
40
`define VSUB        6'h05
41
`define VSxx        6'h06
42
`define VSEQ            3'd0
43
`define VSNE            3'd1
44
`define VSLT            3'd2
45
`define VSGE            3'd3
46
`define VSLE            3'd4
47
`define VSGT            3'd5
48
`define VSUN            3'd7
49
`define VSxxS       6'h07
50
`define VAND        6'h08
51
`define VOR         6'h09
52
`define VXOR        6'h0A
53
`define VXCHG       6'h0B
54
`define VSHL        6'h0C
55
`define VSHR        6'h0D
56
`define VASR        6'h0E
57
`define VSxxSb          6'h0F
58
`define VSHLV       6'h10
59
`define VSHRV       6'h11
60
`define VROLV       6'h12
61
`define VRORV       6'h13
62
`define VADDS       6'h14
63
`define VSUBS       6'h15
64
`define VSxxSU      6'h17
65
`define VANDS       6'h18
66
`define VORS        6'h19
67
`define VXORS       6'h1A
68
`define VSxxSUb         6'h1F
69
`define VBITS2V     6'h20
70
`define V2BITS      6'h21
71
`define VEINS       6'h22
72
`define VEX         6'h23
73
`define VFLT2INT    6'h24
74
`define VINT2FLT    6'h25
75
`define VSIGN       6'h26
76
`define VSxxU       6'h27
77
`define VCNTPOP     6'h28
78
`define VMULS       6'h2A
79
`define VDIVS       6'h2E
80
`define VSxxUb          6'h2F
81
`define VMxx            6'h30
82
`define VMAND           3'h0
83
`define VMOR            3'h1
84
`define VMXOR           3'h2
85
`define VMXNOR          3'h3
86
`define VMPOP           3'h4
87
`define VMFILL          3'h5
88
`define VMFIRST         3'h6
89
`define VMLAST          3'h7
90
`define VMUL        6'h3A
91
`define VDIV        6'h3E
92
`define VSxxb       6'h3F
93
`define R2              6'h02
94
`define RR      6'h02
95
`define BCD         6'h00
96
`define BCDADD          5'h00
97
`define BCDSUB          5'h01
98
`define BCDMUL          5'h02
99
`define PCRELX          6'h02
100
`define AUIPC   6'h03
101
`define SHL     4'h0
102
`define SHR     4'h1
103
`define ASL     4'h2
104
`define ASR     4'h3
105
`define ROL     4'h4
106
`define ROR     4'h5
107
`define SHLI    4'h8
108
`define SHRI    4'h9
109
`define ASLI    4'hA
110
`define ASRI    4'hB
111
`define ROLI    4'hC
112
`define RORI    4'hD
113
// Register / Miscellaneous (01) Ops
114
`define R1              6'h01
115
`define CNTLZ       5'h00
116
`define CNTLO       5'h01
117
`define CNTPOP      5'h02
118
`define COM         5'h03
119
`define ABS         5'h04
120
`define NOT         5'h05
121
`define REDOR       5'h06
122
`define NEG         5'h07
123
`define ZXH                                     5'h08
124
`define ZXC                                     5'h09
125
`define ZXB                                     5'h0A
126
`define MEMDB                           5'h10
127
`define MEMSB                           5'h11
128
`define SYNC        5'h12
129
`define CHAIN_OFF               5'h14
130
`define CHAIN_ON                5'h15
131
`define SETWB                           5'h16
132
`define SXH                                     5'h18
133
`define SXC                                     5'h19
134
`define SXB                                     5'h1A
135
// Register-Register (02) Ops
136
`define RTOP                            6'h00
137
`define BMM                                     6'h03
138
`define ADD             6'h04
139
`define SUB         6'h05
140
`define SLT         6'h06
141
`define SLTU        6'h07
142
`define AND         6'h08
143
`define OR          6'h09
144
`define XOR         6'h0A
145
`define NAND        6'h0C
146
`define NOR         6'h0D
147
`define XNOR        6'h0E
148
`define SHIFT31     6'h0F
149
`define CMP                                     6'h12
150
`define MODU                            6'h14
151
`define MODSU                           6'h15
152
`define MOD                                     6'h16
153
`define LEAX        6'h18
154
`define MUX         6'h1B
155
`define SHIFT63     6'h1F
156
`define MOV                                     6'b01001?
157
`define MULUH                           6'h24
158
`define MULSUH                  6'h25
159
`define MULH                            6'h26
160
`define SLE                     6'h28
161
`define SLEU                    6'h29
162
`define MULF                            6'h2A
163
// The following two instructions are 48 bit ops
164
`define CMOVEZ      6'h28
165
`define CMOVNZ      6'h29
166
`define MIN         6'h2C
167
`define MAX         6'h2D
168
`define MAJ         6'h2E
169
`define SHIFTR      6'h2F
170
`define SEI         6'h30
171
`define WAIT        6'h31
172
`define RTI         6'h32
173
`define RTE         6'h32
174
`define VMOV        6'h33
175
`define MULU        6'h38
176
`define MULSU       6'h39
177
`define MUL         6'h3A
178
`define FXMUL                           6'h3B
179
`define DIVU                    6'h3C
180
`define DIVSU                   6'h3D
181
`define DIV                     6'h3E
182
`define SHIFTH      6'h3F
183
// Root Level Ops
184
`define ADDI            6'h04
185
`define CSRRW   6'h05
186
`define SLTI    6'h06
187
`define SLTUI   6'h07
188
`define ANDI    6'h08
189
`define ORI     6'h09
190
`define XORI    6'h0A
191
`define EXEC    6'h0B
192
`define REX     6'h0D
193
`define XNORI           6'h0E
194
`define FLOAT   6'h0F
195
`define LDCS            6'h10
196
`define LVxU            6'h11
197
`define CMPI            6'h12
198
`define LB      6'h13
199
`define SB      6'h15
200
`define MEMNDX  6'h16
201
`define LVBX                            6'h00
202
`define LVBUX                           6'h01
203
`define LVCX                            6'h02
204
`define LVCUX                           6'h03
205
`define LVHX                            6'h04
206
`define LVHUX                           6'h05
207
`define LVWX                            6'h06
208
`define LCX         6'h08
209
`define LCUX        6'h09
210
`define LBUX        6'h0A
211
`define LHX         6'h10
212
`define LHUX        6'h11
213
`define LWX         6'h12
214
`define LBX         6'h13
215
`define LWRX                            6'h14
216
`define LVWS        6'h18
217
`define LVX         6'h19
218
`define CACHEX      6'h1E
219
`define SHX         6'h21
220
`define SBX         6'h20
221
`define SWX         6'h22
222
`define SWCX        6'h23
223
`define SCX         6'h24
224
`define CASX        6'h25
225
`define SVWS        6'h27
226
`define INCX                            6'h2A
227
`define PUSH                            6'h33
228
`define SVX         6'h37
229
`define SWC     6'h17
230
`define JAL         6'h18
231
`define CALL    6'h19
232
`define INC                     6'h1A
233
`define LFx                     6'h1B
234
`define SGTUI           6'h1C
235
`define LWR     6'h1D
236
`define CACHE   6'h1E
237
`define Lx      6'h20
238
`define LxU     6'h21
239
`define BITFIELD    6'h22
240
`define BFINSI                  4'h4
241
`define LBU     6'h23
242
`define Sx      6'h24
243
`define CAS     6'h25
244
`define BBc     6'h26
245
`define IBNE                    2'd2
246
`define DBNZ                    2'd3
247
`define LUI                     6'h27
248
`define JMP     6'h28
249
`define RET     6'h29
250
`define MULFI           6'h2A
251
`define SFx                     6'h2B
252
`define SGTI            6'h2C
253
`define CMPRSSD 6'h2D
254
`define MODI    6'h2E
255
`define AMO                     6'h2F
256
`define AMO_SWAP        6'h00
257
`define AMO_ADD         6'h04
258
`define AMO_AND         6'h08
259
`define AMO_OR          6'h09
260
`define AMO_XOR         6'h0A
261
`define AMO_SHL         6'h0C
262
`define AMO_SHR         6'h0D
263
`define AMO_MIN         6'h1C
264
`define AMO_MAX         6'h1D
265
`define AMO_MINU        6'h1E
266
`define AMO_MAXU        6'h1F
267
`define Bcc     6'h30
268
`define BEQ         3'd0
269
`define BNE         3'd1
270
`define BLT         3'd2
271
`define BGE         3'd3
272
`define BLTU        3'd6
273
`define BGEU        3'd7
274
`define IVECTOR 6'h31
275
`define BEQI    6'h32
276
`define BCHK    6'h33
277
`define CHK     6'h34
278
`define LV      6'h36
279
`define SV      6'h37
280
`define MULUI   6'h38
281
`define MULSUI  6'h39
282
`define MULI    6'h3A
283
`define LVx     6'h3B
284
`define DIVUI   6'h3C
285
`define NOP     6'h3D
286
`define DIVI    6'h3E
287
 
288
`define FMOV    6'h10
289
`define FTOI    6'h12
290
`define ITOF    6'h13
291
`define FNEG    6'h14
292
`define FABS    6'h15
293
`define FSIGN   6'h16
294
`define FMAN    6'h17
295
`define FNABS   6'h18
296
`define FCVTSD  6'h19
297
`define FCVTSQ  6'h1B
298
`define FSTAT   6'h1C
299
`define FTX     6'h20
300
`define FCX     6'h21
301
`define FEX     6'h22
302
`define FDX     6'h23
303
`define FRM     6'h24
304
`define FCVTDS  6'h29
305
`define FSYNC       6'h36
306
 
307
`define FADD    6'h04
308
`define FSUB    6'h05
309
`define FCMP    6'h06
310
`define FMUL    6'h08
311
`define FDIV    6'h09
312
 
313
`define EXR                     8'h7F
314
 
315
`define NOP_INSN    {42'd0,`NOP}
316
`define INSN_FLT_EXF  16'h1180
317
`define INSN_FLT_IBE    16'h10A0
318
`define INSN_FLT_TLB    16'h1280
319
 
320
`define CSR_CR0     10'h000
321
`define CSR_HARTID  10'h001
322
`define CSR_TICK    10'h002
323
`define CSR_PCR     10'h003
324
`define CSR_PMR                 10'h005
325
`define CSR_CAUSE   10'h006
326
`define CSR_BADADR  10'h007
327
`define CSR_PCR2    10'h008
328
`define CSR_SCRATCH 10'h009
329
`define CSR_WBRCD       10'h00A
330
`define CSR_BADINSTR    10'h00B
331
`define CSR_SEMA    10'h00C
332
`define CSR_KEYS                10'h00E
333
`define CSR_TCB                 10'h010
334
`define CSR_FSTAT   10'h014
335
`define CSR_DBAD0   10'h018
336
`define CSR_DBAD1   10'h019
337
`define CSR_DBAD2   10'h01A
338
`define CSR_DBAD3   10'h01B
339
`define CSR_DBCTRL  10'h01C
340
`define CSR_DBSTAT  10'h01D
341
`define CSR_CAS     10'h02C
342
`define CSR_TVEC    10'b00000110???
343
`define CSR_IM_STACK    10'h040
344
`define CSR_OL_STACK    10'h041
345
`define CSR_PL_STACK    10'h042
346
`define CSR_RS_STACK    10'h043
347
`define CSR_STATUS      10'h044
348
`define CSR_BRS_STACK   10'h046
349
`define CSR_EPC0    10'h048
350
`define CSR_EPC1    10'h049
351
`define CSR_EPC2    10'h04A
352
`define CSR_EPC3    10'h04B
353
`define CSR_EPC4    10'h04C
354
`define CSR_EPC5    10'h04D
355
`define CSR_EPC6    10'h04E
356
`define CSR_EPC7    10'h04F
357
`define CSR_GOLEX0      10'h050
358
`define CSR_GOLEX1      10'h051
359
`define CSR_GOLEX2      10'h052
360
`define CSR_GOLEX3      10'h053
361
`define CSR_GOLEXVP     10'h054
362
`define CSR_CODEBUF 10'b00010??????
363
`define CSR_TB                  10'h0C0
364
`define CSR_CBL                 10'h0C1
365
`define CSR_CBU                 10'h0C2
366
`define CSR_RO                  10'h0C3
367
`define CSR_DBL                 10'h0C4
368
`define CSR_DBU                 10'h0C5
369
`define CSR_SBL                 10'h0C6
370
`define CSR_SBU                 10'h0C7
371
`define CSR_ENU                 10'h0C8
372
`define CSR_PREGS               10'h0F0
373
`define CSR_Q_CTR               10'h3C0
374
`define CSR_BM_CTR      10'h3C1
375
`define CSR_ICL_CTR     10'h3C2
376
`define CSR_IRQ_CTR     10'h3C3
377
`define CSR_TIME                10'h3E0
378
`define CSR_INFO    10'b11_1111_????
379
 
380
`define OL_USER         2'd3
381
`define OL_SUPERVISOR   2'd2
382
`define OL_HYPERVISOR   2'd1
383
`define OL_MACHINE      2'd0
384
 
385
// JALR and EXTENDED are synonyms
386
`define EXTEND  3'd7
387
 
388
// system-call subclasses:
389
`define SYS_NONE        3'd0
390
`define SYS_CALL        3'd1
391
`define SYS_MFSR        3'd2
392
`define SYS_MTSR        3'd3
393
`define SYS_RFU1        3'd4
394
`define SYS_RFU2        3'd5
395
`define SYS_RFU3        3'd6
396
`define SYS_EXC         3'd7    // doesn't need to be last, but what the heck
397
 
398
// exception types:
399
`define EXC_NONE        9'd000
400
`define EXC_HALT        9'd1
401
`define EXC_TLBMISS     9'd2
402
`define EXC_SIGSEGV     9'd3
403
`define EXC_INVALID     9'd4
404
 
405
`define FLT_NONE    8'd00
406
`define FLT_IBE     8'd01
407
`define FLT_EXF     8'd02
408
`define FLT_TLB                 8'd04
409
`define FLT_SSM     8'd32
410
`define FLT_DBG     8'd33
411
`define FLT_TGT     8'd34
412
`define FLT_IADR    8'd36
413
`define FLT_UNIMP               8'd37
414
`define FLT_FLT     8'd38
415
`define FLT_CHK     8'd39
416
`define FLT_DBZ     8'd40
417
`define FLT_OFL     8'd41
418
`define FLT_SEG                 8'd47
419
`define FLT_ALN                 8'd48
420
`define FLT_DWF     8'd50
421
`define FLT_DRF     8'd51
422
`define FLT_SGB                 8'd52
423
`define FLT_PRIV    8'd53
424
`define FLT_CMT                 8'd54
425
`define FLT_BD                  8'd55
426
`define FLT_STK     8'd56
427
`define FLT_DBE     8'd60
428
`define FLT_RET                 8'd230
429
`define FLT_CS                  8'd231
430
`define FLT_ZS_LD               8'd232
431
`define FLT_DS_LD               8'd233
432
`define FLT_ES_LD               8'd234
433
`define FLT_FS_LD               8'd235
434
`define FLT_GS_LD               8'd236
435
`define FLT_HS_LD               8'd237
436
`define FLT_SS_LD               8'd238
437
`define FLT_CS_LD               8'd239
438
 
439
`define INSTRUCTION_OP  5:0
440
`define INSTRUCTION_L2  7:6
441
`define INSTRUCTION_RA  12:8
442
`define INSTRUCTION_RT  17:13
443
`define INSTRUCTION_RB  22:18
444
`define INSTRUCTION_RC  27:23
445
`define INSTRUCTION_IM  31:18
446
`define INSTRUCTION_IML 47:18
447
`define INSTRUCTION_SB  31
448
`define INSTRUCTION_S1  22:18
449
`define INSTRUCTION_S2  31:26
450
`define INSTRUCTION_S2L 47:42
451
`define INSTRUCTION_COND    21:18
452
 
453
`define FORW_BRANCH     1'b0
454
`define BACK_BRANCH     1'b1
455
 
456
`define DRAMSLOT_AVAIL  3'b000
457
`define DRAMSLOT_BUSY           3'b001
458
`define DRAMSLOT_REQBUS 3'b101
459
`define DRAMSLOT_HASBUS 3'b110
460
`define DRAMREQ_READY           3'b111
461
 
462
`define INV     1'b0
463
`define VAL     1'b1
464
 
465
//
466
// define PANIC types
467
//
468
`define PANIC_NONE              4'd0
469
`define PANIC_FETCHBUFBEQ       4'd1
470
`define PANIC_INVALIDISLOT      4'd2
471
`define PANIC_MEMORYRACE        4'd3
472
`define PANIC_IDENTICALDRAMS    4'd4
473
`define PANIC_OVERRUN           4'd5
474
`define PANIC_HALTINSTRUCTION   4'd6
475
`define PANIC_INVALIDMEMOP      4'd7
476
`define PANIC_INVALIDFBSTATE    4'd9
477
`define PANIC_INVALIDIQSTATE    4'd10
478
`define PANIC_BRANCHBACK        4'd11
479
`define PANIC_BADTARGETID       4'd12
480
`define PANIC_ALU0ONLY  4'd13
481
 
482
`define IB_CONST        143:80
483
`define IB_LN                   78:76
484
`define IB_RT                   75:71
485
`define IB_RC             70:66
486
`define IB_RB                   65:61
487
`define IB_RA                   60:56
488
`define IB_PRFW         52
489
`define IB_CMP          51
490
`define IB_PUSH         47
491
`define IB_TLB          46
492
`define IB_SZ                   45:43
493
`define IB_IRQ          42
494
`define IB_RTI          41
495
`define IB_BRK          40
496
`define IB_RET          39
497
`define IB_JAL          38
498
`define IB_ODDBALL      37
499
`define IB_STORE        36
500
`define IB_MEMSZ        35:33
501
`define IB_LOADV        32
502
`define IB_IMM          31
503
`define IB_MEM    30
504
`define IB_BT     28
505
`define IB_ALU          27
506
`define IB_ALU0         26
507
`define IB_FPU          25
508
`define IB_FC                   24
509
`define IB_CANEX        23
510
`define IB_LOAD         22
511
`define IB_PRELOAD      21
512
`define IB_MEMNDX       20
513
`define IB_RMW          19
514
`define IB_MEMDB        18
515
`define IB_MEMSB        17
516
`define IB_SHFT         16
517
`define IB_SEI          15
518
`define IB_AQ                   14
519
`define IB_RL                   13
520
`define IB_JMP          12
521
`define IB_BR                   11
522
`define IB_SYNC         10
523
`define IB_FSYNC        9
524
`define IB_RFW          8
525
`define IB_WE                   7:0
526
 
527
`define TLB                     6'h3F
528
`define TLB_NOP                 4'd0
529
`define TLB_P                           4'd1
530
`define TLB_RD                  4'd2
531
`define TLB_WR                  4'd3
532
`define TLB_WI                  4'd4
533
`define TLB_EN                  4'd5
534
`define TLB_DIS                 4'd6
535
`define TLB_RDREG               4'd7
536
`define TLB_WRREG               4'd8
537
`define TLB_INVALL      4'd9
538
`define TLB_RDAGE               4'd10
539
`define TLB_WRAGE               4'd11
540
 
541
`define TLBWired                        4'h0
542
`define TLBIndex                        4'h1
543
`define TLBRandom                       4'h2
544
`define TLBPageSize             4'h3
545
`define TLBVirtPage             4'h4
546
`define TLBPhysPage             4'h5
547
`define TLBASID                         4'h7
548
`define TLBMissAdr              4'd8
549
`define TLBPageTblAddr  4'd10
550
`define TLBPageTblCtrl  4'd11
551
`define TLBAFC                          4'd12
552
`define TLBPageCount    4'd13
553
 
554
`define EXC_RGS         6'h00
555
`define BRK_RGS         6'h10

powered by: WebSVN 2.1.0

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