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

Subversion Repositories thor

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 60 robfinch
// ============================================================================
2
//        __
3 61 robfinch
//   \\__/ o\    (C) 2017-2019  Robert Finch, Waterloo
4 60 robfinch
//    \  __ /    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 61 robfinch
`define EXEC                            5'h13
130 60 robfinch
`define CHAIN_OFF               5'h14
131
`define CHAIN_ON                5'h15
132
`define SETWB                           5'h16
133 61 robfinch
`define REDAND                  5'h17
134 60 robfinch
`define SXH                                     5'h18
135
`define SXC                                     5'h19
136
`define SXB                                     5'h1A
137
// Register-Register (02) Ops
138
`define RTOP                            6'h00
139
`define BMM                                     6'h03
140
`define ADD             6'h04
141
`define SUB         6'h05
142
`define SLT         6'h06
143
`define SLTU        6'h07
144
`define AND         6'h08
145
`define OR          6'h09
146
`define XOR         6'h0A
147 61 robfinch
`define SEQ                                     6'h0B
148 60 robfinch
`define NAND        6'h0C
149
`define NOR         6'h0D
150
`define XNOR        6'h0E
151
`define SHIFT31     6'h0F
152
`define CMP                                     6'h12
153
`define MODU                            6'h14
154
`define MODSU                           6'h15
155
`define MOD                                     6'h16
156
`define LEAX        6'h18
157
`define MUX         6'h1B
158
`define SHIFT63     6'h1F
159
`define MOV                                     6'b01001?
160
`define MULUH                           6'h24
161
`define MULSUH                  6'h25
162
`define MULH                            6'h26
163
`define SLE                     6'h28
164
`define SLEU                    6'h29
165
`define MULF                            6'h2A
166
// The following two instructions are 48 bit ops
167
`define CMOVEZ      6'h28
168
`define CMOVNZ      6'h29
169
`define MIN         6'h2C
170
`define MAX         6'h2D
171
`define MAJ         6'h2E
172
`define SHIFTR      6'h2F
173
`define SEI         6'h30
174
`define WAIT        6'h31
175
`define RTI         6'h32
176
`define RTE         6'h32
177
`define VMOV        6'h33
178 61 robfinch
`define MOV2SEG                 6'h37
179 60 robfinch
`define MULU        6'h38
180
`define MULSU       6'h39
181
`define MUL         6'h3A
182
`define FXMUL                           6'h3B
183
`define DIVU                    6'h3C
184
`define DIVSU                   6'h3D
185
`define DIV                     6'h3E
186
`define SHIFTH      6'h3F
187
// Root Level Ops
188
`define ADDI            6'h04
189
`define CSRRW   6'h05
190
`define SLTI    6'h06
191
`define SLTUI   6'h07
192
`define ANDI    6'h08
193
`define ORI     6'h09
194
`define XORI    6'h0A
195 61 robfinch
`define SEQI    6'h0B
196 60 robfinch
`define REX     6'h0D
197
`define XNORI           6'h0E
198
`define FLOAT   6'h0F
199 61 robfinch
`define BLcc            6'h10
200
`define BAND                            3'd0
201
`define BOR                                     3'd1
202
`define BXOR                            3'd2
203
`define BNAND                           3'd4
204
`define BNOR                            3'd5
205
`define BXOR                            3'd6
206 60 robfinch
`define LVxU            6'h11
207 61 robfinch
`define BNEI            6'h12
208 60 robfinch
`define LB      6'h13
209 61 robfinch
`define PUSHC           6'h14
210 60 robfinch
`define SB      6'h15
211
`define MEMNDX  6'h16
212
`define LVBX                            6'h00
213
`define LVBUX                           6'h01
214
`define LVCX                            6'h02
215
`define LVCUX                           6'h03
216
`define LVHX                            6'h04
217
`define LVHUX                           6'h05
218
`define LVWX                            6'h06
219
`define LCX         6'h08
220
`define LCUX        6'h09
221
`define LBUX        6'h0A
222
`define LHX         6'h10
223
`define LHUX        6'h11
224
`define LWX         6'h12
225
`define LBX         6'h13
226
`define LWRX                            6'h14
227
`define LVWS        6'h18
228
`define LVX         6'h19
229
`define CACHEX      6'h1E
230
`define SHX         6'h21
231
`define SBX         6'h20
232
`define SWX         6'h22
233
`define SWCX        6'h23
234
`define SCX         6'h24
235
`define CASX        6'h25
236
`define SVWS        6'h27
237
`define INCX                            6'h2A
238
`define PUSH                            6'h33
239
`define SVX         6'h37
240
`define SWC     6'h17
241
`define JAL         6'h18
242
`define CALL    6'h19
243
`define INC                     6'h1A
244
`define LFx                     6'h1B
245
`define SGTUI           6'h1C
246
`define LWR     6'h1D
247
`define CACHE   6'h1E
248
`define Lx      6'h20
249
`define LxU     6'h21
250
`define BITFIELD    6'h22
251
`define BFINSI                  4'h4
252
`define LBU     6'h23
253
`define Sx      6'h24
254
`define CAS     6'h25
255
`define BBc     6'h26
256
`define IBNE                    2'd2
257
`define DBNZ                    2'd3
258
`define LUI                     6'h27
259
`define JMP     6'h28
260
`define RET     6'h29
261
`define MULFI           6'h2A
262
`define SFx                     6'h2B
263
`define SGTI            6'h2C
264
`define CMPRSSD 6'h2D
265
`define MODI    6'h2E
266
`define AMO                     6'h2F
267
`define AMO_SWAP        6'h00
268
`define AMO_ADD         6'h04
269
`define AMO_AND         6'h08
270
`define AMO_OR          6'h09
271
`define AMO_XOR         6'h0A
272
`define AMO_SHL         6'h0C
273
`define AMO_SHR         6'h0D
274
`define AMO_MIN         6'h1C
275
`define AMO_MAX         6'h1D
276
`define AMO_MINU        6'h1E
277
`define AMO_MAXU        6'h1F
278
`define Bcc     6'h30
279
`define BEQ         3'd0
280
`define BNE         3'd1
281
`define BLT         3'd2
282
`define BGE         3'd3
283
`define BLTU        3'd6
284
`define BGEU        3'd7
285
`define IVECTOR 6'h31
286
`define BEQI    6'h32
287
`define BCHK    6'h33
288
`define CHK     6'h34
289
`define LV      6'h36
290
`define SV      6'h37
291
`define MULUI   6'h38
292
`define MULSUI  6'h39
293
`define MULI    6'h3A
294
`define LVx     6'h3B
295
`define DIVUI   6'h3C
296
`define NOP     6'h3D
297
`define DIVI    6'h3E
298
 
299
`define FMOV    6'h10
300
`define FTOI    6'h12
301
`define ITOF    6'h13
302
`define FNEG    6'h14
303
`define FABS    6'h15
304
`define FSIGN   6'h16
305
`define FMAN    6'h17
306
`define FNABS   6'h18
307
`define FCVTSD  6'h19
308
`define FCVTSQ  6'h1B
309
`define FSTAT   6'h1C
310
`define FTX     6'h20
311
`define FCX     6'h21
312
`define FEX     6'h22
313
`define FDX     6'h23
314
`define FRM     6'h24
315
`define FCVTDS  6'h29
316
`define FSYNC       6'h36
317
 
318
`define FADD    6'h04
319
`define FSUB    6'h05
320
`define FCMP    6'h06
321
`define FMUL    6'h08
322
`define FDIV    6'h09
323
 
324
`define EXR                     8'h7F
325
 
326
`define NOP_INSN    {42'd0,`NOP}
327 61 robfinch
`define PFI                                             16'h1F80        // reserved for PFI
328 60 robfinch
`define INSN_FLT_EXF  16'h1180
329
`define INSN_FLT_IBE    16'h10A0
330
`define INSN_FLT_TLB    16'h1280
331
 
332
`define CSR_CR0     10'h000
333
`define CSR_HARTID  10'h001
334
`define CSR_TICK    10'h002
335
`define CSR_PCR     10'h003
336
`define CSR_PMR                 10'h005
337
`define CSR_CAUSE   10'h006
338
`define CSR_BADADR  10'h007
339
`define CSR_PCR2    10'h008
340
`define CSR_SCRATCH 10'h009
341
`define CSR_WBRCD       10'h00A
342
`define CSR_BADINSTR    10'h00B
343
`define CSR_SEMA    10'h00C
344
`define CSR_KEYS                10'h00E
345
`define CSR_TCB                 10'h010
346
`define CSR_FSTAT   10'h014
347
`define CSR_DBAD0   10'h018
348
`define CSR_DBAD1   10'h019
349
`define CSR_DBAD2   10'h01A
350
`define CSR_DBAD3   10'h01B
351
`define CSR_DBCTRL  10'h01C
352
`define CSR_DBSTAT  10'h01D
353
`define CSR_CAS     10'h02C
354
`define CSR_TVEC    10'b00000110???
355
`define CSR_IM_STACK    10'h040
356 66 robfinch
`define CSR_ODL_STACK   10'h041
357 60 robfinch
`define CSR_PL_STACK    10'h042
358
`define CSR_RS_STACK    10'h043
359
`define CSR_STATUS      10'h044
360
`define CSR_BRS_STACK   10'h046
361
`define CSR_EPC0    10'h048
362
`define CSR_EPC1    10'h049
363
`define CSR_EPC2    10'h04A
364
`define CSR_EPC3    10'h04B
365
`define CSR_EPC4    10'h04C
366
`define CSR_EPC5    10'h04D
367
`define CSR_EPC6    10'h04E
368
`define CSR_EPC7    10'h04F
369
`define CSR_GOLEX0      10'h050
370
`define CSR_GOLEX1      10'h051
371
`define CSR_GOLEX2      10'h052
372
`define CSR_GOLEX3      10'h053
373
`define CSR_GOLEXVP     10'h054
374
`define CSR_CODEBUF 10'b00010??????
375
`define CSR_TB                  10'h0C0
376
`define CSR_CBL                 10'h0C1
377
`define CSR_CBU                 10'h0C2
378
`define CSR_RO                  10'h0C3
379
`define CSR_DBL                 10'h0C4
380
`define CSR_DBU                 10'h0C5
381
`define CSR_SBL                 10'h0C6
382
`define CSR_SBU                 10'h0C7
383
`define CSR_ENU                 10'h0C8
384
`define CSR_PREGS               10'h0F0
385
`define CSR_Q_CTR               10'h3C0
386
`define CSR_BM_CTR      10'h3C1
387
`define CSR_ICL_CTR     10'h3C2
388
`define CSR_IRQ_CTR     10'h3C3
389 61 robfinch
`define CSR_BR_CTR      10'h3C4
390 60 robfinch
`define CSR_TIME                10'h3E0
391
`define CSR_INFO    10'b11_1111_????
392
 
393
`define OL_USER         2'd3
394
`define OL_SUPERVISOR   2'd2
395
`define OL_HYPERVISOR   2'd1
396
`define OL_MACHINE      2'd0
397
 
398
// JALR and EXTENDED are synonyms
399
`define EXTEND  3'd7
400
 
401
// system-call subclasses:
402
`define SYS_NONE        3'd0
403
`define SYS_CALL        3'd1
404
`define SYS_MFSR        3'd2
405
`define SYS_MTSR        3'd3
406
`define SYS_RFU1        3'd4
407
`define SYS_RFU2        3'd5
408
`define SYS_RFU3        3'd6
409
`define SYS_EXC         3'd7    // doesn't need to be last, but what the heck
410
 
411
// exception types:
412
`define EXC_NONE        9'd000
413
`define EXC_HALT        9'd1
414
`define EXC_TLBMISS     9'd2
415
`define EXC_SIGSEGV     9'd3
416
`define EXC_INVALID     9'd4
417
 
418
`define FLT_NONE    8'd00
419
`define FLT_IBE     8'd01
420
`define FLT_EXF     8'd02
421
`define FLT_TLB                 8'd04
422
`define FLT_SSM     8'd32
423
`define FLT_DBG     8'd33
424
`define FLT_TGT     8'd34
425
`define FLT_IADR    8'd36
426
`define FLT_UNIMP               8'd37
427
`define FLT_FLT     8'd38
428
`define FLT_CHK     8'd39
429
`define FLT_DBZ     8'd40
430
`define FLT_OFL     8'd41
431
`define FLT_SEG                 8'd47
432
`define FLT_ALN                 8'd48
433
`define FLT_DWF     8'd50
434
`define FLT_DRF     8'd51
435
`define FLT_SGB                 8'd52
436
`define FLT_PRIV    8'd53
437
`define FLT_CMT                 8'd54
438
`define FLT_BD                  8'd55
439
`define FLT_STK     8'd56
440
`define FLT_DBE     8'd60
441 61 robfinch
`define FLT_STP                 8'd232          // segment type
442
`define FLT_STZ                 8'd233          // stack segment zero
443
`define FLT_SNP                 8'd234          // segment not present
444 60 robfinch
 
445
`define INSTRUCTION_OP  5:0
446
`define INSTRUCTION_L2  7:6
447
`define INSTRUCTION_RA  12:8
448
`define INSTRUCTION_RT  17:13
449
`define INSTRUCTION_RB  22:18
450
`define INSTRUCTION_RC  27:23
451
`define INSTRUCTION_IM  31:18
452
`define INSTRUCTION_IML 47:18
453
`define INSTRUCTION_SB  31
454
`define INSTRUCTION_S1  22:18
455
`define INSTRUCTION_S2  31:26
456
`define INSTRUCTION_S2L 47:42
457
`define INSTRUCTION_COND    21:18
458
 
459
`define FORW_BRANCH     1'b0
460
`define BACK_BRANCH     1'b1
461
 
462
`define DRAMSLOT_AVAIL  3'b000
463
`define DRAMSLOT_BUSY           3'b001
464 66 robfinch
`define DRAMSLOT_BUSY2  3'b010
465 60 robfinch
`define DRAMSLOT_REQBUS 3'b101
466
`define DRAMSLOT_HASBUS 3'b110
467
`define DRAMREQ_READY           3'b111
468
 
469
`define INV     1'b0
470
`define VAL     1'b1
471
 
472
//
473
// define PANIC types
474
//
475
`define PANIC_NONE              4'd0
476
`define PANIC_FETCHBUFBEQ       4'd1
477
`define PANIC_INVALIDISLOT      4'd2
478
`define PANIC_MEMORYRACE        4'd3
479
`define PANIC_IDENTICALDRAMS    4'd4
480
`define PANIC_OVERRUN           4'd5
481
`define PANIC_HALTINSTRUCTION   4'd6
482
`define PANIC_INVALIDMEMOP      4'd7
483
`define PANIC_INVALIDFBSTATE    4'd9
484
`define PANIC_INVALIDIQSTATE    4'd10
485
`define PANIC_BRANCHBACK        4'd11
486
`define PANIC_BADTARGETID       4'd12
487
`define PANIC_ALU0ONLY  4'd13
488
 
489
`define IB_CONST        143:80
490
`define IB_LN                   78:76
491
`define IB_RT                   75:71
492
`define IB_RC             70:66
493
`define IB_RB                   65:61
494
`define IB_RA                   60:56
495 61 robfinch
`define IB_LOADSEG      53
496 60 robfinch
`define IB_PRFW         52
497
`define IB_CMP          51
498
`define IB_PUSH         47
499
`define IB_TLB          46
500
`define IB_SZ                   45:43
501
`define IB_IRQ          42
502
`define IB_RTI          41
503
`define IB_BRK          40
504
`define IB_RET          39
505
`define IB_JAL          38
506
`define IB_ODDBALL      37
507
`define IB_STORE        36
508
`define IB_MEMSZ        35:33
509
`define IB_LOADV        32
510
`define IB_IMM          31
511
`define IB_MEM    30
512
`define IB_BT     28
513
`define IB_ALU          27
514
`define IB_ALU0         26
515
`define IB_FPU          25
516
`define IB_FC                   24
517
`define IB_CANEX        23
518
`define IB_LOAD         22
519
`define IB_PRELOAD      21
520
`define IB_MEMNDX       20
521
`define IB_RMW          19
522
`define IB_MEMDB        18
523
`define IB_MEMSB        17
524
`define IB_SHFT         16
525
`define IB_SEI          15
526
`define IB_AQ                   14
527
`define IB_RL                   13
528
`define IB_JMP          12
529
`define IB_BR                   11
530
`define IB_SYNC         10
531
`define IB_FSYNC        9
532
`define IB_RFW          8
533
`define IB_WE                   7:0
534
 
535
`define TLB                     6'h3F
536
`define TLB_NOP                 4'd0
537
`define TLB_P                           4'd1
538
`define TLB_RD                  4'd2
539
`define TLB_WR                  4'd3
540
`define TLB_WI                  4'd4
541
`define TLB_EN                  4'd5
542
`define TLB_DIS                 4'd6
543
`define TLB_RDREG               4'd7
544
`define TLB_WRREG               4'd8
545
`define TLB_INVALL      4'd9
546
`define TLB_RDAGE               4'd10
547
`define TLB_WRAGE               4'd11
548
 
549
`define TLBWired                        4'h0
550
`define TLBIndex                        4'h1
551
`define TLBRandom                       4'h2
552
`define TLBPageSize             4'h3
553
`define TLBVirtPage             4'h4
554
`define TLBPhysPage             4'h5
555
`define TLBASID                         4'h7
556
`define TLBMissAdr              4'd8
557
`define TLBPageTblAddr  4'd10
558
`define TLBPageTblCtrl  4'd11
559
`define TLBAFC                          4'd12
560
`define TLBPageCount    4'd13
561
 
562
`define EXC_RGS         6'h00
563
`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.