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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [rtl/] [common/] [FT64_defines.vh] - Blame information for rev 59

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 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 SXH                                     5'h18
132
`define SXC                                     5'h19
133
`define SXB                                     5'h1A
134
// Register-Register (02) Ops
135
`define RTOP                            6'h00
136
`define BMM                                     6'h03
137
`define ADD             6'h04
138
`define SUB         6'h05
139
`define SLT         6'h06
140
`define SLTU        6'h07
141
`define AND         6'h08
142
`define OR          6'h09
143
`define XOR         6'h0A
144
`define NAND        6'h0C
145
`define NOR         6'h0D
146
`define XNOR        6'h0E
147
`define SHIFT31     6'h0F
148 50 robfinch
`define MODU                            6'h14
149
`define MODSU                           6'h15
150
`define MOD                                     6'h16
151 48 robfinch
`define LEAX        6'h18
152
`define MUX         6'h1B
153
`define SHIFT63     6'h1F
154 50 robfinch
`define MOV                                     6'b01001?
155
`define MULUH                           6'h24
156
`define MULSUH                  6'h25
157
`define MULH                            6'h26
158 48 robfinch
`define SLE                     6'h28
159
`define SLEU                    6'h29
160
`define CMOVEZ      6'h28       // 48 bit op
161
`define CMOVNZ      6'h29       // 48 bit op
162
`define MIN         6'h2C
163
`define MAX         6'h2D
164
`define MAJ         6'h2E
165
`define SHIFTR      6'h2F
166
`define SEI         6'h30
167
`define WAIT        6'h31
168
`define RTI         6'h32
169
`define RTE         6'h32
170
`define VMOV        6'h33
171
`define MULU        6'h38
172
`define MULSU       6'h39
173
`define MUL         6'h3A
174 50 robfinch
`define DIVU                    6'h3C
175
`define DIVSU                   6'h3D
176
`define DIV                     6'h3E
177 48 robfinch
`define SHIFTH      6'h3F
178
// Root Level Ops
179
`define ADDI            6'h04
180
`define CSRRW   6'h05
181
`define SLTI    6'h06
182
`define SLTUI   6'h07
183
`define ANDI    6'h08
184
`define ORI     6'h09
185
`define XORI    6'h0A
186
`define EXEC    6'h0B
187
`define SFx                     6'h0C
188
`define REX     6'h0D
189
`define XNORI           6'h0E
190
`define FLOAT   6'h0F
191
`define LB      6'h13
192
`define SB      6'h15
193
`define MEMNDX  6'h16
194 50 robfinch
`define LVBX                            6'h00
195
`define LVBUX                           6'h01
196
`define LVCX                            6'h02
197
`define LVCUX                           6'h03
198
`define LVHX                            6'h04
199
`define LVHUX                           6'h05
200
`define LVWX                            6'h06
201
`define LHX         6'h10
202
`define LHUX        6'h11
203
`define LWX         6'h12
204
`define LBX         6'h13
205
`define SHX         6'h14
206
`define SBX         6'h15
207
`define SWX         6'h16
208
`define SWCX        6'h17
209
`define LWRX        6'h1D
210
`define CACHEX      6'h1E
211
`define LCX         6'h20
212
`define LCUX        6'h21
213
`define LBUX        6'h23
214
`define SCX         6'h24
215
`define CASX        6'h25
216
`define LVWS        6'h26
217
`define SVWS        6'h27
218
`define LVX         6'h36
219
`define SVX         6'h37
220 48 robfinch
`define SWC     6'h17
221
`define JAL         6'h18
222
`define CALL    6'h19
223
`define INC                     6'h1A
224 55 robfinch
`define LFx                     6'h1B
225 48 robfinch
`define SGTUI           6'h1C
226
`define LWR     6'h1D
227
`define CACHE   6'h1E
228
`define Lx      6'h20
229
`define LxU     6'h21
230
`define BITFIELD    6'h22
231
`define BFINSI                  4'h4
232
`define LBU     6'h23
233
`define Sx      6'h24
234
`define CAS     6'h25
235
`define BBc     6'h26
236
`define IBNE                    2'd2
237
`define DBNZ                    2'd3
238
`define LUI                     6'h27
239
`define JMP     6'h28
240
`define RET     6'h29
241 55 robfinch
`define SFx                     6'h2B
242 48 robfinch
`define SGTI            6'h2C
243 55 robfinch
`define CMPRSSD 6'h2D
244 48 robfinch
`define MODI    6'h2E
245
`define AMO                     6'h2F
246
`define AMO_SWAP        6'h00
247
`define AMO_ADD         6'h04
248
`define AMO_AND         6'h08
249
`define AMO_OR          6'h09
250
`define AMO_XOR         6'h0A
251
`define AMO_SHL         6'h0C
252
`define AMO_SHR         6'h0D
253
`define AMO_MIN         6'h1C
254
`define AMO_MAX         6'h1D
255
`define AMO_MINU        6'h1E
256
`define AMO_MAXU        6'h1F
257
`define Bcc     6'h30
258
`define BEQ         3'd0
259
`define BNE         3'd1
260
`define BLT         3'd2
261
`define BGE         3'd3
262
`define BLTU        3'd6
263
`define BGEU        3'd7
264
`define IVECTOR 6'h31
265
`define BEQI    6'h32
266
`define BCHK    6'h33
267
`define CHK     6'h34
268
`define LV      6'h36
269
`define SV      6'h37
270
`define MULUI   6'h38
271
`define MULSUI  6'h39
272
`define MULI    6'h3A
273
`define LVx     6'h3B
274
`define DIVUI   6'h3C
275
`define NOP     6'h3D
276
`define DIVI    6'h3E
277
 
278
`define FMOV    6'h10
279
`define FTOI    6'h12
280
`define ITOF    6'h13
281
`define FNEG    6'h14
282
`define FABS    6'h15
283
`define FSIGN   6'h16
284
`define FMAN    6'h17
285
`define FNABS   6'h18
286
`define FCVTSD  6'h19
287
`define FCVTSQ  6'h1B
288
`define FSTAT   6'h1C
289
`define FTX     6'h20
290
`define FCX     6'h21
291
`define FEX     6'h22
292
`define FDX     6'h23
293
`define FRM     6'h24
294
`define FCVTDS  6'h29
295
`define FSYNC       6'h36
296
 
297
`define FADD    6'h04
298
`define FSUB    6'h05
299
`define FCMP    6'h06
300
`define FMUL    6'h08
301
`define FDIV    6'h09
302
 
303
`define EXR                     8'h7F
304
 
305
`define NOP_INSN    {42'd0,`NOP}
306 59 robfinch
`define INSN_FLT_EXF  16'h1180
307
`define INSN_FLT_IBE    16'h10A0
308 48 robfinch
 
309
`define CSR_CR0     11'h000
310
`define CSR_HARTID  11'h001
311
`define CSR_TICK    11'h002
312
`define CSR_PCR     11'h003
313 49 robfinch
`define CSR_PMR                 11'h005
314 48 robfinch
`define CSR_CAUSE   11'h006
315
`define CSR_BADADR  11'h007
316
`define CSR_PCR2    11'h008
317
`define CSR_SCRATCH 11'h009
318
`define CSR_WBRCD       11'h00A
319
`define CSR_SEMA    11'h00C
320
`define CSR_SBL     11'h00E
321
`define CSR_SBU     11'h00F
322
`define CSR_TCB         11'h010
323
`define CSR_FSTAT   11'h014
324
`define CSR_DBAD0   11'h018
325
`define CSR_DBAD1   11'h019
326
`define CSR_DBAD2   11'h01A
327
`define CSR_DBAD3   11'h01B
328
`define CSR_DBCTRL  11'h01C
329
`define CSR_DBSTAT  11'h01D
330
`define CSR_CAS     11'h02C
331
`define CSR_TVEC    11'b00000110???
332
`define CSR_IM_STACK    11'h040
333
`define CSR_OL_STACK    11'h041
334
`define CSR_PL_STACK    11'h042
335
`define CSR_RS_STACK    11'h043
336
`define CSR_STATUS      11'h044
337
`define CSR_EPC0    11'h048
338
`define CSR_EPC1    11'h049
339
`define CSR_EPC2    11'h04A
340
`define CSR_EPC3    11'h04B
341
`define CSR_EPC4    11'h04C
342
`define CSR_EPC5    11'h04D
343
`define CSR_EPC6    11'h04E
344
`define CSR_EPC7    11'h04F
345
`define CSR_GOLEX0      12'h050
346
`define CSR_GOLEX1      12'h051
347
`define CSR_GOLEX2      12'h052
348
`define CSR_GOLEX3      12'h053
349
`define CSR_GOLEXVP     12'h054
350
`define CSR_CODEBUF 11'b00010??????
351
`define CSR_TIME        11'h7E0
352
`define CSR_INFO    11'b111_1111_????
353
 
354
`define OL_USER         2'd3
355
`define OL_SUPERVISOR   2'd2
356
`define OL_HYPERVISOR   2'd1
357
`define OL_MACHINE      2'd0
358
 
359
// JALR and EXTENDED are synonyms
360
`define EXTEND  3'd7
361
 
362
// system-call subclasses:
363
`define SYS_NONE        3'd0
364
`define SYS_CALL        3'd1
365
`define SYS_MFSR        3'd2
366
`define SYS_MTSR        3'd3
367
`define SYS_RFU1        3'd4
368
`define SYS_RFU2        3'd5
369
`define SYS_RFU3        3'd6
370
`define SYS_EXC         3'd7    // doesn't need to be last, but what the heck
371
 
372
// exception types:
373
`define EXC_NONE        9'd000
374
`define EXC_HALT        9'd1
375
`define EXC_TLBMISS     9'd2
376
`define EXC_SIGSEGV     9'd3
377
`define EXC_INVALID     9'd4
378
 
379
`define FLT_NONE    8'd00
380
`define FLT_SSM     8'd32
381
`define FLT_DBG     8'd33
382
`define FLT_TGT     8'd34
383
`define FLT_IADR    8'd36
384 49 robfinch
`define FLT_UNIMP               8'd37
385 48 robfinch
`define FLT_FLT     8'd38
386
`define FLT_CHK     8'd39
387
`define FLT_DBZ     8'd40
388
`define FLT_OFL     8'd41
389
`define FLT_EXF     8'd49
390
`define FLT_DWF     8'd50
391
`define FLT_DRF     8'd51
392
`define FLT_PRIV    8'd53
393
`define FLT_BD          8'd55
394
`define FLT_STK     8'd56
395
`define FLT_DBE     8'd60
396
`define FLT_IBE     8'd61
397
 
398
`define INSTRUCTION_OP  5:0
399
`define INSTRUCTION_L2  7:6
400
`define INSTRUCTION_RA  12:8
401
`define INSTRUCTION_RB  17:13
402
`define INSTRUCTION_RC  22:18
403
`define INSTRUCTION_RD  27:23
404
`define INSTRUCTION_IM  31:18
405
`define INSTRUCTION_IML 47:18
406
`define INSTRUCTION_SB  31
407
`define INSTRUCTION_S1  22:18
408
`define INSTRUCTION_S2  31:26
409
`define INSTRUCTION_S2L 47:42
410
`define INSTRUCTION_COND    21:18
411
 
412
`define FORW_BRANCH     1'b0
413
`define BACK_BRANCH     1'b1
414
 
415
`define DRAMSLOT_AVAIL  3'b000
416
`define DRAMSLOT_BUSY   3'b001
417
`define DRAMSLOT_REQBUS 3'b101
418
`define DRAMSLOT_HASBUS 3'b110
419
`define DRAMREQ_READY   3'b111
420
 
421
`define INV     1'b0
422
`define VAL     1'b1
423
 
424
//
425
// define PANIC types
426
//
427
`define PANIC_NONE              4'd0
428
`define PANIC_FETCHBUFBEQ       4'd1
429
`define PANIC_INVALIDISLOT      4'd2
430
`define PANIC_MEMORYRACE        4'd3
431
`define PANIC_IDENTICALDRAMS    4'd4
432
`define PANIC_OVERRUN           4'd5
433
`define PANIC_HALTINSTRUCTION   4'd6
434
`define PANIC_INVALIDMEMOP      4'd7
435
`define PANIC_INVALIDFBSTATE    4'd9
436
`define PANIC_INVALIDIQSTATE    4'd10
437
`define PANIC_BRANCHBACK        4'd11
438
`define PANIC_BADTARGETID       4'd12
439
`define PANIC_ALU0ONLY  4'd13
440
 
441 51 robfinch
`define IB_CONST        143:80
442
`define IB_LN                   78:76
443
`define IB_RT                   75:71
444
`define IB_RC             70:66
445
`define IB_RB                   65:61
446
`define IB_RA                   60:56
447
`define IB_IRQ          42
448
`define IB_RTI          41
449
`define IB_BRK          40
450
`define IB_RET          39
451
`define IB_JAL          38
452 50 robfinch
`define IB_ODDBALL      37
453
`define IB_STORE        36
454
`define IB_MEMSZ        35:33
455
`define IB_LOADV        32
456 48 robfinch
`define IB_IMM          31
457
`define IB_MEM    30
458
`define IB_BT     28
459
`define IB_ALU          27
460
`define IB_ALU0         26
461
`define IB_FPU          25
462
`define IB_FC                   24
463
`define IB_CANEX        23
464
`define IB_LOAD         22
465
`define IB_PRELOAD      21
466
`define IB_MEMNDX       20
467
`define IB_RMW          19
468
`define IB_MEMDB        18
469
`define IB_MEMSB        17
470
`define IB_SHFT48       16
471
`define IB_SEI          15
472
`define IB_AQ                   14
473
`define IB_RL                   13
474
`define IB_JMP          12
475
`define IB_BR                   11
476
`define IB_SYNC         10
477
`define IB_FSYNC        9
478
`define IB_RFW          8
479
`define IB_WE                   7:0

powered by: WebSVN 2.1.0

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