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

Subversion Repositories thor

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

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