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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64/] [rtl/] [common/] [FT64_defines.vh] - Blame information for rev 43

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 43 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 DEBUG_LOGIC 1'b1
26
`define HIGH        1'b1
27
`define LOW         1'b0
28
`define TRUE        1'b1
29
`define FALSE       1'b0
30
//`define Q2VECTORS   1'b1
31
 
32
`define ZERO            64'd0
33
 
34
`define BRK     6'h00
35
`define VECTOR  6'h01
36
`define VCMPRSS     6'h00
37
`define VCIDX       6'h01
38
`define VSCAN       6'h02
39
`define VABS        6'h03
40
`define VADD        6'h04
41
`define VSUB        6'h05
42
`define VSxx        6'h06
43
`define VSEQ            3'd0
44
`define VSNE            3'd1
45
`define VSLT            3'd2
46
`define VSGE            3'd3
47
`define VSLE            3'd4
48
`define VSGT            3'd5
49
`define VSUN            3'd7
50
`define VSxxS       6'h07
51
`define VAND        6'h08
52
`define VOR         6'h09
53
`define VXOR        6'h0A
54
`define VXCHG       6'h0B
55
`define VSHL        6'h0C
56
`define VSHR        6'h0D
57
`define VASR        6'h0E
58
`define VSxxSb          6'h0F
59
`define VSHLV       6'h10
60
`define VSHRV       6'h11
61
`define VROLV       6'h12
62
`define VRORV       6'h13
63
`define VADDS       6'h14
64
`define VSUBS       6'h15
65
`define VSxxSU      6'h17
66
`define VANDS       6'h18
67
`define VORS        6'h19
68
`define VXORS       6'h1A
69
`define VSxxSUb         6'h1F
70
`define VBITS2V     6'h20
71
`define V2BITS      6'h21
72
`define VEINS       6'h22
73
`define VEX         6'h23
74
`define VFLT2INT    6'h24
75
`define VINT2FLT    6'h25
76
`define VSIGN       6'h26
77
`define VSxxU       6'h27
78
`define VCNTPOP     6'h28
79
`define VMULS       6'h2A
80
`define VDIVS       6'h2E
81
`define VSxxUb          6'h2F
82
`define VMxx            6'h30
83
`define VMAND           3'h0
84
`define VMOR            3'h1
85
`define VMXOR           3'h2
86
`define VMXNOR          3'h3
87
`define VMPOP           3'h4
88
`define VMFILL          3'h5
89
`define VMFIRST         3'h6
90
`define VMLAST          3'h7
91
`define VMUL        6'h3A
92
`define VDIV        6'h3E
93
`define VSxxb       6'h3F
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 BccR    6'h03
100
`define SHL     4'h0
101
`define SHR     4'h1
102
`define ASL     4'h2
103
`define ASR     4'h3
104
`define ROL     4'h4
105
`define ROR     4'h5
106
`define SHLI    4'h8
107
`define SHRI    4'h9
108
`define ASLI    4'hA
109
`define ASRI    4'hB
110
`define ROLI    4'hC
111
`define RORI    4'hD
112
`define R1          6'h01
113
`define CNTLZ           5'h00
114
`define CNTLO           5'h01
115
`define CNTPOP          5'h02
116
`define ABS             5'h04
117
`define NOT             5'h05
118
`define REDOR           5'h06
119
`define MEMDB                   5'h10
120
`define MEMSB                   5'h11
121
`define SYNC            5'h12
122
`define CHAIN_OFF               5'h14
123
`define CHAIN_ON                5'h15
124
`define BMM                     6'h03
125
`define ADD             6'h04
126
`define SUB         6'h05
127
`define CMP         6'd6
128
`define CMPU        6'd7
129
`define AND         6'd8
130
`define OR          6'd9
131
`define XOR         6'h0A
132
`define NAND        6'h0C
133
`define NOR         6'h0D
134
`define XNOR        6'h0E
135
`define SHIFT       6'h0F
136
`define LHX         6'h10
137
`define LHUX        6'h11
138
`define LWX         6'h12
139
`define LBX         6'h13
140
`define SHX         6'h14
141
`define SBX         6'h15
142
`define SWX         6'h16
143
`define SWCX        6'h17
144
`define CALLR       6'h18
145
`define CMPP            6'h19
146
`define CMPUP           6'h1A
147
`define MUX         6'h1B
148
`define LWRX        6'h1D
149
`define CACHEX      6'h1E
150
`define SHIFTB      6'h1F
151
`define LCX         6'h20
152
`define LCUX        6'h21
153
`define MOV                     6'h22
154
`define LBUX        6'h23
155
`define SCX         6'h24
156
`define CASX        6'h25
157
`define LVWS        6'h26
158
`define SVWS        6'h27
159
`define CMOVEQ      6'h28
160
`define CMOVNE      6'h29
161
`define LBOX            6'h2A
162
`define LCOX            6'h2B
163
`define MIN         6'h2C
164
`define MAX         6'h2D
165
`define MAJ         6'h2E
166
`define SHIFTC      6'h2F
167
`define SEI         6'h30
168
`define WAIT        6'h31
169
`define RTI         6'h32
170
`define RTE         6'h32
171
`define VMOV        6'h33
172
`define LHOX            6'h35
173
`define LVX         6'h36
174
`define SVX         6'h37
175
`define MULU        6'h38
176
`define MULSU       6'h39
177
`define MUL         6'h3A
178
`define DIVMODU     6'h3C
179
`define DIVMODSU    6'h3D
180
`define DIVMOD      6'h3E
181
`define SHIFTH      6'h3F
182
`define ADDI    6'h04
183
`define CMPI    6'h06
184
`define CMPUI   6'h07
185
`define ANDI    6'h08
186
`define ORI     6'h09
187
`define XORI    6'h0A
188
`define EXEC    6'h0B
189
`define FSYNC       6'h36
190
`define REX     6'h0D
191
`define CSRRW   6'h0E
192
`define FLOAT   6'h0F
193
`define LH      6'h10
194
`define LHU     6'h11
195
`define LW      6'h12
196
`define LB      6'h13
197
`define SH      6'h14
198
`define SB      6'h15
199
`define SW          6'h16
200
`define SWC     6'h17
201
`define JAL         6'h18
202
`define CALL    6'h19
203
`define QOPI    6'h1A
204
`define QORI        3'd0
205
`define QADDI       3'd1
206
`define QANDI       3'd2
207
`define QXORI       3'd3
208
`define SccI    6'h1B
209
`define SEQ         4'h2
210
`define SNE         4'h3
211
`define SLT         4'h4
212
`define SGE         4'h5
213
`define SLE         4'h6
214
`define SGT         4'h7
215
`define SLTU        4'hC
216
`define SGEU        4'hD
217
`define SLEU        4'hE
218
`define SGTU        4'hF
219
`define NOP     6'h1C
220
`define LWR     6'h1D
221
`define CACHE   6'h1E
222
`define LC      6'h20
223
`define LCU     6'h21
224
`define BITFIELD    6'h22
225
`define BFINSI                  4'h4
226
`define LBU     6'h23
227
`define SC      6'h24
228
`define CAS     6'h25
229
`define BBc     6'b10011?
230
`define DBNZ            3'd7
231
`define JMP     6'h28
232
`define RET     6'h29
233
`define LBO     6'h2A
234
`define LCO     6'h2B
235
`define MODUI   6'h2C
236
`define MODSUI  6'h2D
237
`define MODI    6'h2E
238
`define AMO             6'h2F
239
`define AMO_SWAP        6'h00
240
`define AMO_ADD         6'h04
241
`define AMO_AND         6'h08
242
`define AMO_OR          6'h09
243
`define AMO_XOR         6'h0A
244
`define AMO_SHL         6'h0C
245
`define AMO_SHR         6'h0D
246
`define AMO_MIN         6'h1C
247
`define AMO_MAX         6'h1D
248
`define AMO_MINU        6'h1E
249
`define AMO_MAXU        6'h1F
250
`define Bcc     6'b11000?
251
`define BEQ         4'd0
252
`define BNE         4'd1
253
`define BLT         4'd2
254
`define BGE         4'd3
255
`define BLTU        4'd4
256
`define BGEU        4'd5
257
`define FBEQ        4'd8
258
`define FBNE        4'd9
259
`define FBLT        4'd10
260
`define FBGE        4'd11
261
`define FBUN        4'd15
262
`define BEQI    6'b11001?
263
`define CHK     6'h34
264
`define LHO             6'h35
265
`define LV      6'h36
266
`define SV      6'h37
267
`define MULUI   6'h38
268
`define MULSUI  6'h39
269
`define MULI    6'h3A
270
`define LVx     6'h3B
271
`define LVB                     3'h0
272
`define LVBU            3'h1
273
`define LVC                     3'h2
274
`define LVCU            3'h3
275
`define LVH                     3'h4
276
`define LVHU            3'h5
277
`define LVW                     3'h6
278
`define DIVUI   6'h3C
279
`define DIVSUI  6'h3D
280
`define DIVI    6'h3E
281
`define IMM             6'h3F
282
 
283
`define FMOV    6'h10
284
`define FTOI    6'h12
285
`define ITOF    6'h13
286
`define FNEG    6'h14
287
`define FABS    6'h15
288
`define FSIGN   6'h16
289
`define FMAN    6'h17
290
`define FNABS   6'h18
291
`define FCVTSD  6'h19
292
`define FCVTSQ  6'h1B
293
`define FSTAT   6'h1C
294
`define FTX     6'h20
295
`define FCX     6'h21
296
`define FEX     6'h22
297
`define FDX     6'h23
298
`define FRM     6'h24
299
`define FCVTDS  6'h29
300
 
301
`define FADD    6'h04
302
`define FSUB    6'h05
303
`define FCMP    6'h06
304
`define FMUL    6'h08
305
`define FDIV    6'h09
306
 
307
 
308
`define NOP_INSN    {26'd0,`NOP}
309
 
310
`define CSR_CR0     11'h000
311
`define CSR_HARTID  11'h001
312
`define CSR_TICK    11'h002
313
`define CSR_PCR     11'h003
314
`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_SEMA    11'h00C
319
`define CSR_SBL     11'h00E
320
`define CSR_SBU     11'h00F
321
`define CSR_FSTAT   11'h014
322
`define CSR_DBAD0   11'h018
323
`define CSR_DBAD1   11'h019
324
`define CSR_DBAD2   11'h01A
325
`define CSR_DBAD3   11'h01B
326
`define CSR_DBCTRL  11'h01C
327
`define CSR_DBSTAT  11'h01D
328
`define CSR_CAS     11'h02C
329
`define CSR_TVEC    11'b00000110???
330
`define CSR_IM_STACK    11'h040
331
`define CSR_OL_STACK    11'h041
332
`define CSR_PL_STACK    11'h042
333
`define CSR_RS_STACK    11'h043
334
`define CSR_STATUS      11'h044
335
`define CSR_EPC0    11'h048
336
`define CSR_EPC1    11'h049
337
`define CSR_EPC2    11'h04A
338
`define CSR_EPC3    11'h04B
339
`define CSR_EPC4    11'h04C
340
`define CSR_EPC5    11'h04D
341
`define CSR_EPC6    11'h04E
342
`define CSR_EPC7    11'h04F
343
`define CSR_CODEBUF 11'b00010??????
344
`define CSR_INFO    11'b111_1111_????
345
 
346
`define OL_USER         2'd3
347
`define OL_SUPERVISOR   2'd2
348
`define OL_HYPERVISOR   2'd1
349
`define OL_MACHINE      2'd0
350
 
351
// JALR and EXTENDED are synonyms
352
`define EXTEND  3'd7
353
 
354
// system-call subclasses:
355
`define SYS_NONE        3'd0
356
`define SYS_CALL        3'd1
357
`define SYS_MFSR        3'd2
358
`define SYS_MTSR        3'd3
359
`define SYS_RFU1        3'd4
360
`define SYS_RFU2        3'd5
361
`define SYS_RFU3        3'd6
362
`define SYS_EXC         3'd7    // doesn't need to be last, but what the heck
363
 
364
// exception types:
365
`define EXC_NONE        9'd000
366
`define EXC_HALT        9'd1
367
`define EXC_TLBMISS     9'd2
368
`define EXC_SIGSEGV     9'd3
369
`define EXC_INVALID     9'd4
370
 
371
`define FLT_NONE    9'd000
372
`define FLT_SSM     9'd480
373
`define FLT_DBG     9'd481
374
`define FLT_TGT     9'd482
375
`define FLT_IADR    9'd484
376
`define FLT_FLT     9'd486
377
`define FLT_CHK     9'd487
378
`define FLT_DBZ     9'd488
379
`define FLT_OFL     9'd489
380
`define FLT_EXF     9'd497
381
`define FLT_DWF     9'd498
382
`define FLT_DRF     9'd499
383
`define FLT_PRIV    9'd501
384
`define FLT_STK     9'd504
385
`define FLT_DBE     9'd508
386
`define FLT_IBE     9'd509
387
 
388
//`define INSTRUCTION_OP        15:13   // opcode
389
//`define INSTRUCTION_RA        12:10   // rA 
390
//`define INSTRUCTION_RB        9:7     // rB 
391
//`define INSTRUCTION_RC        2:0     // rC 
392
//`define INSTRUCTION_IM        6:0     // immediate (7-bit)
393
//`define INSTRUCTION_LI        9:0     // large unsigned immediate (10-bit, 0-extended)
394
//`define INSTRUCTION_SB        6       // immediate's sign bit
395
//`define INSTRUCTION_S1  6:4   // contains the syscall sub-class (NONE, CALL, MFSR, MTSR, EXC, etc.)
396
//`define INSTRUCTION_S2  3:0   // contains the sub-class identifier value
397
 
398
`define INSTRUCTION_OP  5:0
399
`define INSTRUCTION_RA  10:6
400
`define INSTRUCTION_RB  15:11
401
`define INSTRUCTION_RC  20:16
402
`define INSTRUCTION_RD  25:21
403
`define INSTRUCTION_IM  31:16
404
`define INSTRUCTION_SB  31
405
`define INSTRUCTION_S1  25:21
406
`define INSTRUCTION_S2  31:26
407
`define INSTRUCTION_COND    18:16
408
 
409
`define FORW_BRANCH     1'b0
410
`define BACK_BRANCH     1'b1
411
 
412
`define DRAMSLOT_AVAIL  3'b000
413
`define DRAMSLOT_BUSY   3'b001
414
`define DRAMSLOT_REQBUS 3'b101
415
`define DRAMSLOT_HASBUS 3'b110
416
`define DRAMREQ_READY   3'b111
417
 
418
`define INV     1'b0
419
`define VAL     1'b1
420
 
421
//
422
// define PANIC types
423
//
424
`define PANIC_NONE              4'd0
425
`define PANIC_FETCHBUFBEQ       4'd1
426
`define PANIC_INVALIDISLOT      4'd2
427
`define PANIC_MEMORYRACE        4'd3
428
`define PANIC_IDENTICALDRAMS    4'd4
429
`define PANIC_OVERRUN           4'd5
430
`define PANIC_HALTINSTRUCTION   4'd6
431
`define PANIC_INVALIDMEMOP      4'd7
432
`define PANIC_INVALIDFBSTATE    4'd9
433
`define PANIC_INVALIDIQSTATE    4'd10
434
`define PANIC_BRANCHBACK        4'd11
435
`define PANIC_BADTARGETID       4'd12
436
 
437
 

powered by: WebSVN 2.1.0

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