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

Subversion Repositories thor

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

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 SIM             1'b1
26
//`define SUPPORT_SMT           1'b1
27
//`define DEBUG_LOGIC 1'b1
28
`define HIGH        1'b1
29
`define LOW         1'b0
30
`define TRUE        1'b1
31
`define FALSE       1'b0
32
//`define Q2VECTORS   1'b1
33
 
34
`define ZERO            64'd0
35
 
36
`define BRK     6'h00
37
`define FVECTOR 6'h01
38
`define VCMPRSS     6'h00
39
`define VCIDX       6'h01
40
`define VSCAN       6'h02
41
`define VABS        6'h03
42
`define VADD        6'h04
43
`define VSUB        6'h05
44
`define VSxx        6'h06
45
`define VSEQ            3'd0
46
`define VSNE            3'd1
47
`define VSLT            3'd2
48
`define VSGE            3'd3
49
`define VSLE            3'd4
50
`define VSGT            3'd5
51
`define VSUN            3'd7
52
`define VSxxS       6'h07
53
`define VAND        6'h08
54
`define VOR         6'h09
55
`define VXOR        6'h0A
56
`define VXCHG       6'h0B
57
`define VSHL        6'h0C
58
`define VSHR        6'h0D
59
`define VASR        6'h0E
60
`define VSxxSb          6'h0F
61
`define VSHLV       6'h10
62
`define VSHRV       6'h11
63
`define VROLV       6'h12
64
`define VRORV       6'h13
65
`define VADDS       6'h14
66
`define VSUBS       6'h15
67
`define VSxxSU      6'h17
68
`define VANDS       6'h18
69
`define VORS        6'h19
70
`define VXORS       6'h1A
71
`define VSxxSUb         6'h1F
72
`define VBITS2V     6'h20
73
`define V2BITS      6'h21
74
`define VEINS       6'h22
75
`define VEX         6'h23
76
`define VFLT2INT    6'h24
77
`define VINT2FLT    6'h25
78
`define VSIGN       6'h26
79
`define VSxxU       6'h27
80
`define VCNTPOP     6'h28
81
`define VMULS       6'h2A
82
`define VDIVS       6'h2E
83
`define VSxxUb          6'h2F
84
`define VMxx            6'h30
85
`define VMAND           3'h0
86
`define VMOR            3'h1
87
`define VMXOR           3'h2
88
`define VMXNOR          3'h3
89
`define VMPOP           3'h4
90
`define VMFILL          3'h5
91
`define VMFIRST         3'h6
92
`define VMLAST          3'h7
93
`define VMUL        6'h3A
94
`define VDIV        6'h3E
95
`define VSxxb       6'h3F
96
`define R2              6'h02
97
`define RR      6'h02
98
`define BCD         6'h00
99
`define BCDADD          5'h00
100
`define BCDSUB          5'h01
101
`define BCDMUL          5'h02
102
`define PCRELX          6'h02
103
`define AUIPC   6'h03
104
`define SHL     4'h0
105
`define SHR     4'h1
106
`define ASL     4'h2
107
`define ASR     4'h3
108
`define ROL     4'h4
109
`define ROR     4'h5
110
`define SHLI    4'h8
111
`define SHRI    4'h9
112
`define ASLI    4'hA
113
`define ASRI    4'hB
114
`define ROLI    4'hC
115
`define RORI    4'hD
116
// Register / Miscellaneous (01) Ops
117
`define R1              6'h01
118
`define CNTLZ       5'h00
119
`define CNTLO       5'h01
120
`define CNTPOP      5'h02
121
`define COM         5'h03
122
`define ABS         5'h04
123
`define NOT         5'h05
124
`define REDOR       5'h06
125
`define NEG         5'h07
126
`define ZXH                                     5'h08
127
`define ZXC                                     5'h09
128
`define ZXB                                     5'h0A
129
`define MEMDB                           5'h10
130
`define MEMSB                           5'h11
131
`define SYNC        5'h12
132
`define CHAIN_OFF               5'h14
133
`define CHAIN_ON                5'h15
134
`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
`define NAND        6'h0C
148
`define NOR         6'h0D
149
`define XNOR        6'h0E
150
`define SHIFT31     6'h0F
151
`define LHX         6'h10
152
`define LHUX        6'h11
153
`define LWX         6'h12
154
`define LBX         6'h13
155
`define SHX         6'h14
156
`define SBX         6'h15
157
`define SWX         6'h16
158
`define SWCX        6'h17
159
`define LEAX        6'h18
160
`define MUX         6'h1B
161
`define LWRX        6'h1D
162
`define CACHEX      6'h1E
163
`define SHIFT63     6'h1F
164
`define LCX         6'h20
165
`define LCUX        6'h21
166
`define MOV                                     6'h22
167
`define LBUX        6'h23
168
`define SCX         6'h24
169
`define CASX        6'h25
170
`define LVWS        6'h26
171
`define SVWS        6'h27
172
`define SLE                     6'h28
173
`define SLEU                    6'h29
174
`define CMOVEZ      6'h28       // 48 bit op
175
`define CMOVNZ      6'h29       // 48 bit op
176
`define MIN         6'h2C
177
`define MAX         6'h2D
178
`define MAJ         6'h2E
179
`define SHIFTR      6'h2F
180
`define SEI         6'h30
181
`define WAIT        6'h31
182
`define RTI         6'h32
183
`define RTE         6'h32
184
`define VMOV        6'h33
185
`define LVX         6'h36
186
`define SVX         6'h37
187
`define MULU        6'h38
188
`define MULSU       6'h39
189
`define MUL         6'h3A
190
`define DIVMODU     6'h3C
191
`define DIVMODSU    6'h3D
192
`define DIVMOD      6'h3E
193
`define SHIFTH      6'h3F
194
// Root Level Ops
195
`define ADDI            6'h04
196
`define CSRRW   6'h05
197
`define SLTI    6'h06
198
`define SLTUI   6'h07
199
`define ANDI    6'h08
200
`define ORI     6'h09
201
`define XORI    6'h0A
202
`define EXEC    6'h0B
203
`define SFx                     6'h0C
204
`define REX     6'h0D
205
`define XNORI           6'h0E
206
`define FLOAT   6'h0F
207
`define LB      6'h13
208
`define SB      6'h15
209
`define MEMNDX  6'h16
210
`define SWC     6'h17
211
`define JAL         6'h18
212
`define CALL    6'h19
213
`define INC                     6'h1A
214
`define SGTUI           6'h1C
215
`define LWR     6'h1D
216
`define CACHE   6'h1E
217
`define Lx      6'h20
218
`define LxU     6'h21
219
`define BITFIELD    6'h22
220
`define BFINSI                  4'h4
221
`define LBU     6'h23
222
`define Sx      6'h24
223
`define CAS     6'h25
224
`define BBc     6'h26
225
`define IBNE                    2'd2
226
`define DBNZ                    2'd3
227
`define LUI                     6'h27
228
`define JMP     6'h28
229
`define RET     6'h29
230
`define SGTI            6'h2C
231
`define MODI    6'h2E
232
`define AMO                     6'h2F
233
`define AMO_SWAP        6'h00
234
`define AMO_ADD         6'h04
235
`define AMO_AND         6'h08
236
`define AMO_OR          6'h09
237
`define AMO_XOR         6'h0A
238
`define AMO_SHL         6'h0C
239
`define AMO_SHR         6'h0D
240
`define AMO_MIN         6'h1C
241
`define AMO_MAX         6'h1D
242
`define AMO_MINU        6'h1E
243
`define AMO_MAXU        6'h1F
244
`define Bcc     6'h30
245
`define BEQ         3'd0
246
`define BNE         3'd1
247
`define BLT         3'd2
248
`define BGE         3'd3
249
`define BLTU        3'd6
250
`define BGEU        3'd7
251
`define IVECTOR 6'h31
252
`define BEQI    6'h32
253
`define BCHK    6'h33
254
`define CHK     6'h34
255
`define LV      6'h36
256
`define SV      6'h37
257
`define MULUI   6'h38
258
`define MULSUI  6'h39
259
`define MULI    6'h3A
260
`define LVx     6'h3B
261
`define DIVUI   6'h3C
262
`define NOP     6'h3D
263
`define DIVI    6'h3E
264
 
265
`define FMOV    6'h10
266
`define FTOI    6'h12
267
`define ITOF    6'h13
268
`define FNEG    6'h14
269
`define FABS    6'h15
270
`define FSIGN   6'h16
271
`define FMAN    6'h17
272
`define FNABS   6'h18
273
`define FCVTSD  6'h19
274
`define FCVTSQ  6'h1B
275
`define FSTAT   6'h1C
276
`define FTX     6'h20
277
`define FCX     6'h21
278
`define FEX     6'h22
279
`define FDX     6'h23
280
`define FRM     6'h24
281
`define FCVTDS  6'h29
282
`define FSYNC       6'h36
283
 
284
`define FADD    6'h04
285
`define FSUB    6'h05
286
`define FCMP    6'h06
287
`define FMUL    6'h08
288
`define FDIV    6'h09
289
 
290
`define EXR                     8'h7F
291
 
292
`define NOP_INSN    {42'd0,`NOP}
293
 
294
`define CSR_CR0     11'h000
295
`define CSR_HARTID  11'h001
296
`define CSR_TICK    11'h002
297
`define CSR_PCR     11'h003
298
`define CSR_CAUSE   11'h006
299
`define CSR_BADADR  11'h007
300
`define CSR_PCR2    11'h008
301
`define CSR_SCRATCH 11'h009
302
`define CSR_WBRCD       11'h00A
303
`define CSR_SEMA    11'h00C
304
`define CSR_SBL     11'h00E
305
`define CSR_SBU     11'h00F
306
`define CSR_TCB         11'h010
307
`define CSR_FSTAT   11'h014
308
`define CSR_DBAD0   11'h018
309
`define CSR_DBAD1   11'h019
310
`define CSR_DBAD2   11'h01A
311
`define CSR_DBAD3   11'h01B
312
`define CSR_DBCTRL  11'h01C
313
`define CSR_DBSTAT  11'h01D
314
`define CSR_CAS     11'h02C
315
`define CSR_TVEC    11'b00000110???
316
`define CSR_IM_STACK    11'h040
317
`define CSR_OL_STACK    11'h041
318
`define CSR_PL_STACK    11'h042
319
`define CSR_RS_STACK    11'h043
320
`define CSR_STATUS      11'h044
321
`define CSR_EPC0    11'h048
322
`define CSR_EPC1    11'h049
323
`define CSR_EPC2    11'h04A
324
`define CSR_EPC3    11'h04B
325
`define CSR_EPC4    11'h04C
326
`define CSR_EPC5    11'h04D
327
`define CSR_EPC6    11'h04E
328
`define CSR_EPC7    11'h04F
329
`define CSR_GOLEX0      12'h050
330
`define CSR_GOLEX1      12'h051
331
`define CSR_GOLEX2      12'h052
332
`define CSR_GOLEX3      12'h053
333
`define CSR_GOLEXVP     12'h054
334
`define CSR_CODEBUF 11'b00010??????
335
`define CSR_TIME        11'h7E0
336
`define CSR_INFO    11'b111_1111_????
337
 
338
`define OL_USER         2'd3
339
`define OL_SUPERVISOR   2'd2
340
`define OL_HYPERVISOR   2'd1
341
`define OL_MACHINE      2'd0
342
 
343
// JALR and EXTENDED are synonyms
344
`define EXTEND  3'd7
345
 
346
// system-call subclasses:
347
`define SYS_NONE        3'd0
348
`define SYS_CALL        3'd1
349
`define SYS_MFSR        3'd2
350
`define SYS_MTSR        3'd3
351
`define SYS_RFU1        3'd4
352
`define SYS_RFU2        3'd5
353
`define SYS_RFU3        3'd6
354
`define SYS_EXC         3'd7    // doesn't need to be last, but what the heck
355
 
356
// exception types:
357
`define EXC_NONE        9'd000
358
`define EXC_HALT        9'd1
359
`define EXC_TLBMISS     9'd2
360
`define EXC_SIGSEGV     9'd3
361
`define EXC_INVALID     9'd4
362
 
363
`define FLT_NONE    8'd00
364
`define FLT_SSM     8'd32
365
`define FLT_DBG     8'd33
366
`define FLT_TGT     8'd34
367
`define FLT_IADR    8'd36
368
`define FLT_FLT     8'd38
369
`define FLT_CHK     8'd39
370
`define FLT_DBZ     8'd40
371
`define FLT_OFL     8'd41
372
`define FLT_EXF     8'd49
373
`define FLT_DWF     8'd50
374
`define FLT_DRF     8'd51
375
`define FLT_PRIV    8'd53
376
`define FLT_BD          8'd55
377
`define FLT_STK     8'd56
378
`define FLT_DBE     8'd60
379
`define FLT_IBE     8'd61
380
 
381
`define INSTRUCTION_OP  5:0
382
`define INSTRUCTION_L2  7:6
383
`define INSTRUCTION_RA  12:8
384
`define INSTRUCTION_RB  17:13
385
`define INSTRUCTION_RC  22:18
386
`define INSTRUCTION_RD  27:23
387
`define INSTRUCTION_IM  31:18
388
`define INSTRUCTION_IML 47:18
389
`define INSTRUCTION_SB  31
390
`define INSTRUCTION_S1  22:18
391
`define INSTRUCTION_S2  31:26
392
`define INSTRUCTION_S2L 47:42
393
`define INSTRUCTION_COND    21:18
394
 
395
`define FORW_BRANCH     1'b0
396
`define BACK_BRANCH     1'b1
397
 
398
`define DRAMSLOT_AVAIL  3'b000
399
`define DRAMSLOT_BUSY   3'b001
400
`define DRAMSLOT_REQBUS 3'b101
401
`define DRAMSLOT_HASBUS 3'b110
402
`define DRAMREQ_READY   3'b111
403
 
404
`define INV     1'b0
405
`define VAL     1'b1
406
 
407
//
408
// define PANIC types
409
//
410
`define PANIC_NONE              4'd0
411
`define PANIC_FETCHBUFBEQ       4'd1
412
`define PANIC_INVALIDISLOT      4'd2
413
`define PANIC_MEMORYRACE        4'd3
414
`define PANIC_IDENTICALDRAMS    4'd4
415
`define PANIC_OVERRUN           4'd5
416
`define PANIC_HALTINSTRUCTION   4'd6
417
`define PANIC_INVALIDMEMOP      4'd7
418
`define PANIC_INVALIDFBSTATE    4'd9
419
`define PANIC_INVALIDIQSTATE    4'd10
420
`define PANIC_BRANCHBACK        4'd11
421
`define PANIC_BADTARGETID       4'd12
422
`define PANIC_ALU0ONLY  4'd13
423
 
424
`define IB_CONST        127:64
425
`define IB_LN                   63:61
426
`define IB_RT                   54:50
427
`define IB_RC             49:45
428
`define IB_RB                   44:40
429
`define IB_RA                   39:35
430
`define IB_A3V          34
431
`define IB_A2V          33
432
`define IB_A1V          32
433
`define IB_IMM          31
434
`define IB_MEM    30
435
`define IB_BT     28
436
`define IB_ALU          27
437
`define IB_ALU0         26
438
`define IB_FPU          25
439
`define IB_FC                   24
440
`define IB_CANEX        23
441
`define IB_LOAD         22
442
`define IB_PRELOAD      21
443
`define IB_MEMNDX       20
444
`define IB_RMW          19
445
`define IB_MEMDB        18
446
`define IB_MEMSB        17
447
`define IB_SHFT48       16
448
`define IB_SEI          15
449
`define IB_AQ                   14
450
`define IB_RL                   13
451
`define IB_JMP          12
452
`define IB_BR                   11
453
`define IB_SYNC         10
454
`define IB_FSYNC        9
455
`define IB_RFW          8
456
`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.