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

Subversion Repositories or1200gct

[/] [or1200gct/] [trunk/] [or1200_defines.v] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  OR1200's definitions                                        ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Parameters of the OR1200 core                               ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - add parameters that are missing                          ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Damjan Lampret, lampret@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47
// Revision 1.1.1.1  2004/06/30 17:37:38  cvsadmin
48
// Initial import
49
//
50
 
51
 
52
//Configuration file from graphic configuration tool
53
`include "or1200_config.v"
54
 
55
//
56
// Operand width / register file address width
57
//
58
// (DO NOT CHANGE)
59
//
60
`define OR1200_OPERAND_WIDTH            32
61
`define OR1200_REGFILE_ADDR_WIDTH       5
62
 
63
 
64
//
65
// ALUOPs
66
//
67
`define OR1200_ALUOP_WIDTH      4
68
`define OR1200_ALUOP_NOP        4'd4
69
/* Order defined by arith insns that have two source operands both in regs
70
   (see binutils/include/opcode/or32.h) */
71
`define OR1200_ALUOP_ADD        4'd0
72
`define OR1200_ALUOP_ADDC       4'd1
73
`define OR1200_ALUOP_SUB        4'd2
74
`define OR1200_ALUOP_AND        4'd3
75
`define OR1200_ALUOP_OR         4'd4
76
`define OR1200_ALUOP_XOR        4'd5
77
`define OR1200_ALUOP_MUL        4'd6
78
`define OR1200_ALUOP_CUST5      4'd7
79
`define OR1200_ALUOP_SHROT      4'd8
80
`define OR1200_ALUOP_DIV        4'd9
81
`define OR1200_ALUOP_DIVU       4'd10
82
/* Order not specifically defined. */
83
`define OR1200_ALUOP_IMM        4'd11
84
`define OR1200_ALUOP_MOVHI      4'd12
85
`define OR1200_ALUOP_COMP       4'd13
86
`define OR1200_ALUOP_MTSR       4'd14
87
`define OR1200_ALUOP_MFSR       4'd15
88
 
89
//
90
// MACOPs
91
//
92
`define OR1200_MACOP_WIDTH      2
93
`define OR1200_MACOP_NOP        2'b00
94
`define OR1200_MACOP_MAC        2'b01
95
`define OR1200_MACOP_MSB        2'b10
96
 
97
//
98
// Shift/rotate ops
99
//
100
`define OR1200_SHROTOP_WIDTH    2
101
`define OR1200_SHROTOP_NOP      2'd0
102
`define OR1200_SHROTOP_SLL      2'd0
103
`define OR1200_SHROTOP_SRL      2'd1
104
`define OR1200_SHROTOP_SRA      2'd2
105
`define OR1200_SHROTOP_ROR      2'd3
106
 
107
// Execution cycles per instruction
108
`define OR1200_MULTICYCLE_WIDTH 2
109
`define OR1200_ONE_CYCLE                2'd0
110
`define OR1200_TWO_CYCLES               2'd1
111
 
112
// Operand MUX selects
113
`define OR1200_SEL_WIDTH                2
114
`define OR1200_SEL_RF                   2'd0
115
`define OR1200_SEL_IMM                  2'd1
116
`define OR1200_SEL_EX_FORW              2'd2
117
`define OR1200_SEL_WB_FORW              2'd3
118
 
119
//
120
// BRANCHOPs
121
//
122
`define OR1200_BRANCHOP_WIDTH           3
123
`define OR1200_BRANCHOP_NOP             3'd0
124
`define OR1200_BRANCHOP_J               3'd1
125
`define OR1200_BRANCHOP_JR              3'd2
126
`define OR1200_BRANCHOP_BAL             3'd3
127
`define OR1200_BRANCHOP_BF              3'd4
128
`define OR1200_BRANCHOP_BNF             3'd5
129
`define OR1200_BRANCHOP_RFE             3'd6
130
 
131
//
132
// LSUOPs
133
//
134
// Bit 0: sign extend
135
// Bits 1-2: 00 doubleword, 01 byte, 10 halfword, 11 singleword
136
// Bit 3: 0 load, 1 store
137
`define OR1200_LSUOP_WIDTH              4
138
`define OR1200_LSUOP_NOP                4'b0000
139
`define OR1200_LSUOP_LBZ                4'b0010
140
`define OR1200_LSUOP_LBS                4'b0011
141
`define OR1200_LSUOP_LHZ                4'b0100
142
`define OR1200_LSUOP_LHS                4'b0101
143
`define OR1200_LSUOP_LWZ                4'b0110
144
`define OR1200_LSUOP_LWS                4'b0111
145
`define OR1200_LSUOP_LD         4'b0001
146
`define OR1200_LSUOP_SD         4'b1000
147
`define OR1200_LSUOP_SB         4'b1010
148
`define OR1200_LSUOP_SH         4'b1100
149
`define OR1200_LSUOP_SW         4'b1110
150
 
151
// FETCHOPs
152
`define OR1200_FETCHOP_WIDTH            1
153
`define OR1200_FETCHOP_NOP              1'b0
154
`define OR1200_FETCHOP_LW               1'b1
155
 
156
//
157
// Register File Write-Back OPs
158
//
159
// Bit 0: register file write enable
160
// Bits 2-1: write-back mux selects
161
`define OR1200_RFWBOP_WIDTH             3
162
`define OR1200_RFWBOP_NOP               3'b000
163
`define OR1200_RFWBOP_ALU               3'b001
164
`define OR1200_RFWBOP_LSU               3'b011
165
`define OR1200_RFWBOP_SPRS              3'b101
166
`define OR1200_RFWBOP_LR                3'b111
167
 
168
// Compare instructions
169
`define OR1200_COP_SFEQ       3'b000
170
`define OR1200_COP_SFNE       3'b001
171
`define OR1200_COP_SFGT       3'b010
172
`define OR1200_COP_SFGE       3'b011
173
`define OR1200_COP_SFLT       3'b100
174
`define OR1200_COP_SFLE       3'b101
175
`define OR1200_COP_X          3'b111
176
`define OR1200_SIGNED_COMPARE 'd3
177
`define OR1200_COMPOP_WIDTH     4
178
 
179
//
180
// TAGs for instruction bus
181
//
182
`define OR1200_ITAG_IDLE        4'h0    // idle bus
183
`define OR1200_ITAG_NI          4'h1    // normal insn
184
`define OR1200_ITAG_BE          4'hb    // Bus error exception
185
`define OR1200_ITAG_PE          4'hc    // Page fault exception
186
`define OR1200_ITAG_TE          4'hd    // TLB miss exception
187
 
188
//
189
// TAGs for data bus
190
//
191
`define OR1200_DTAG_IDLE        4'h0    // idle bus
192
`define OR1200_DTAG_ND          4'h1    // normal data
193
`define OR1200_DTAG_AE          4'ha    // Alignment exception
194
`define OR1200_DTAG_BE          4'hb    // Bus error exception
195
`define OR1200_DTAG_PE          4'hc    // Page fault exception
196
`define OR1200_DTAG_TE          4'hd    // TLB miss exception
197
 
198
 
199
//////////////////////////////////////////////
200
//
201
// ORBIS32 ISA specifics
202
//
203
 
204
// SHROT_OP position in machine word
205
`define OR1200_SHROTOP_POS              7:6
206
 
207
// ALU instructions multicycle field in machine word
208
`define OR1200_ALUMCYC_POS              9:8
209
 
210
//
211
// Instruction opcode groups (basic)
212
//
213
`define OR1200_OR32_J                 6'b000000
214
`define OR1200_OR32_JAL               6'b000001
215
`define OR1200_OR32_BNF               6'b000011
216
`define OR1200_OR32_BF                6'b000100
217
`define OR1200_OR32_NOP               6'b000101
218
`define OR1200_OR32_MOVHI             6'b000110
219
`define OR1200_OR32_XSYNC             6'b001000
220
`define OR1200_OR32_RFE               6'b001001
221
/* */
222
`define OR1200_OR32_JR                6'b010001
223
`define OR1200_OR32_JALR              6'b010010
224
`define OR1200_OR32_MACI              6'b010011
225
/* */
226
`define OR1200_OR32_LWZ               6'b100001
227
`define OR1200_OR32_LBZ               6'b100011
228
`define OR1200_OR32_LBS               6'b100100
229
`define OR1200_OR32_LHZ               6'b100101
230
`define OR1200_OR32_LHS               6'b100110
231
`define OR1200_OR32_ADDI              6'b100111
232
`define OR1200_OR32_ADDIC             6'b101000
233
`define OR1200_OR32_ANDI              6'b101001
234
`define OR1200_OR32_ORI               6'b101010
235
`define OR1200_OR32_XORI              6'b101011
236
`define OR1200_OR32_MULI              6'b101100
237
`define OR1200_OR32_MFSPR             6'b101101
238
`define OR1200_OR32_SH_ROTI           6'b101110
239
`define OR1200_OR32_SFXXI             6'b101111
240
/* */
241
`define OR1200_OR32_MTSPR             6'b110000
242
`define OR1200_OR32_MACMSB            6'b110001
243
/* */
244
`define OR1200_OR32_SW                6'b110101
245
`define OR1200_OR32_SB                6'b110110
246
`define OR1200_OR32_SH                6'b110111
247
`define OR1200_OR32_ALU               6'b111000
248
`define OR1200_OR32_SFXX              6'b111001
249
//`define OR1200_OR32_CUST5             6'b111100
250
 
251
 
252
/////////////////////////////////////////////////////
253
//
254
// Exceptions
255
//
256
 
257
//
258
// Exception vectors per OR1K architecture:
259
// 0xPPPPP100 - reset
260
// 0xPPPPP200 - bus error
261
// ... etc
262
// where P represents exception prefix.
263
//
264
// Exception vectors can be customized as per
265
// the following formula:
266
// 0xPPPPPNVV - exception N
267
//
268
// P represents exception prefix
269
// N represents exception N
270
// VV represents length of the individual vector space,
271
//   usually it is 8 bits wide and starts with all bits zero
272
//
273
 
274
//
275
// PPPPP and VV parts
276
//
277
// Sum of these two defines needs to be 28
278
//
279
`define OR1200_EXCEPT_EPH0_P 20'h00000
280
`define OR1200_EXCEPT_EPH1_P 20'hF0000
281
`define OR1200_EXCEPT_V            8'h00
282
 
283
//
284
// N part width
285
//
286
`define OR1200_EXCEPT_WIDTH 4
287
 
288
//
289
// Definition of exception vectors
290
//
291
// To avoid implementation of a certain exception,
292
// simply comment out corresponding line
293
//
294
`define OR1200_EXCEPT_UNUSED            `OR1200_EXCEPT_WIDTH'hf
295
`define OR1200_EXCEPT_TRAP              `OR1200_EXCEPT_WIDTH'he
296
`define OR1200_EXCEPT_BREAK             `OR1200_EXCEPT_WIDTH'hd
297
`define OR1200_EXCEPT_SYSCALL           `OR1200_EXCEPT_WIDTH'hc
298
`define OR1200_EXCEPT_RANGE             `OR1200_EXCEPT_WIDTH'hb
299
`define OR1200_EXCEPT_ITLBMISS          `OR1200_EXCEPT_WIDTH'ha
300
`define OR1200_EXCEPT_DTLBMISS          `OR1200_EXCEPT_WIDTH'h9
301
`define OR1200_EXCEPT_INT               `OR1200_EXCEPT_WIDTH'h8
302
`define OR1200_EXCEPT_ILLEGAL           `OR1200_EXCEPT_WIDTH'h7
303
`define OR1200_EXCEPT_ALIGN             `OR1200_EXCEPT_WIDTH'h6
304
`define OR1200_EXCEPT_TICK              `OR1200_EXCEPT_WIDTH'h5
305
`define OR1200_EXCEPT_IPF               `OR1200_EXCEPT_WIDTH'h4
306
`define OR1200_EXCEPT_DPF               `OR1200_EXCEPT_WIDTH'h3
307
`define OR1200_EXCEPT_BUSERR            `OR1200_EXCEPT_WIDTH'h2
308
`define OR1200_EXCEPT_RESET             `OR1200_EXCEPT_WIDTH'h1
309
`define OR1200_EXCEPT_NONE              `OR1200_EXCEPT_WIDTH'h0
310
 
311
 
312
/////////////////////////////////////////////////////
313
//
314
// SPR groups
315
//
316
 
317
// Bits that define the group
318
`define OR1200_SPR_GROUP_BITS   15:11
319
 
320
// Width of the group bits
321
`define OR1200_SPR_GROUP_WIDTH  5
322
 
323
// Bits that define offset inside the group
324
`define OR1200_SPR_OFS_BITS 10:0
325
 
326
// List of groups
327
`define OR1200_SPR_GROUP_SYS    5'd00
328
`define OR1200_SPR_GROUP_DMMU   5'd01
329
`define OR1200_SPR_GROUP_IMMU   5'd02
330
`define OR1200_SPR_GROUP_DC     5'd03
331
`define OR1200_SPR_GROUP_IC     5'd04
332
`define OR1200_SPR_GROUP_MAC    5'd05
333
`define OR1200_SPR_GROUP_DU     5'd06
334
`define OR1200_SPR_GROUP_PM     5'd08
335
`define OR1200_SPR_GROUP_PIC    5'd09
336
`define OR1200_SPR_GROUP_TT     5'd10
337
 
338
 
339
/////////////////////////////////////////////////////
340
//
341
// System group
342
//
343
 
344
//
345
// System registers
346
//
347
`define OR1200_SPR_CFGR         7'd0
348
`define OR1200_SPR_RF           6'd32   // 1024 >> 5
349
`define OR1200_SPR_NPC          11'd16
350
`define OR1200_SPR_SR           11'd17
351
`define OR1200_SPR_PPC          11'd18
352
`define OR1200_SPR_EPCR         11'd32
353
`define OR1200_SPR_EEAR         11'd48
354
`define OR1200_SPR_ESR          11'd64
355
 
356
//
357
// SR bits
358
//
359
`define OR1200_SR_WIDTH 16
360
`define OR1200_SR_SM   0
361
`define OR1200_SR_TEE  1
362
`define OR1200_SR_IEE  2
363
`define OR1200_SR_DCE  3
364
`define OR1200_SR_ICE  4
365
`define OR1200_SR_DME  5
366
`define OR1200_SR_IME  6
367
`define OR1200_SR_LEE  7
368
`define OR1200_SR_CE   8
369
`define OR1200_SR_F    9
370
`define OR1200_SR_CY   10       // Unused
371
`define OR1200_SR_OV   11       // Unused
372
`define OR1200_SR_OVE  12       // Unused
373
`define OR1200_SR_DSX  13       // Unused
374
`define OR1200_SR_EPH  14
375
`define OR1200_SR_FO   15
376
`define OR1200_SR_CID  31:28    // Unimplemented
377
 
378
//
379
// Bits that define offset inside the group
380
//
381
`define OR1200_SPROFS_BITS 10:0
382
 
383
 
384
/////////////////////////////////////////////////////
385
//
386
// Power Management (PM)
387
//
388
 
389
// Bit positions inside PMR (don't change)
390
`define OR1200_PM_PMR_SDF 3:0
391
`define OR1200_PM_PMR_DME 4
392
`define OR1200_PM_PMR_SME 5
393
`define OR1200_PM_PMR_DCGE 6
394
`define OR1200_PM_PMR_UNUSED 31:7
395
 
396
// PMR offset inside PM group of registers
397
`define OR1200_PM_OFS_PMR 11'b0
398
 
399
// PM group
400
`define OR1200_SPRGRP_PM 5'd8
401
 
402
 
403
 
404
/////////////////////////////////////////////////////
405
//
406
// Debug Unit (DU)
407
//
408
 
409
// Number of DVR/DCR pairs if HW breakpoints enabled
410
`define OR1200_DU_DVRDCR_PAIRS 8
411
 
412
//
413
// Address offsets of DU registers inside DU group
414
//
415
// To not implement a register, do not define its address
416
//
417
`ifdef OR1200_DU_HWBKPTS
418
`define OR1200_DU_DVR0          11'd0
419
`define OR1200_DU_DVR1          11'd1
420
`define OR1200_DU_DVR2          11'd2
421
`define OR1200_DU_DVR3          11'd3
422
`define OR1200_DU_DVR4          11'd4
423
`define OR1200_DU_DVR5          11'd5
424
`define OR1200_DU_DVR6          11'd6
425
`define OR1200_DU_DVR7          11'd7
426
`define OR1200_DU_DCR0          11'd8
427
`define OR1200_DU_DCR1          11'd9
428
`define OR1200_DU_DCR2          11'd10
429
`define OR1200_DU_DCR3          11'd11
430
`define OR1200_DU_DCR4          11'd12
431
`define OR1200_DU_DCR5          11'd13
432
`define OR1200_DU_DCR6          11'd14
433
`define OR1200_DU_DCR7          11'd15
434
`endif
435
`define OR1200_DU_DMR1          11'd16
436
`ifdef OR1200_DU_HWBKPTS
437
`define OR1200_DU_DMR2          11'd17
438
`define OR1200_DU_DWCR0         11'd18
439
`define OR1200_DU_DWCR1         11'd19
440
`endif
441
`define OR1200_DU_DSR           11'd20
442
`define OR1200_DU_DRR           11'd21
443
`ifdef OR1200_DU_TB_IMPLEMENTED
444
`define OR1200_DU_TBADR         11'h0ff
445
`define OR1200_DU_TBIA          11'h1xx
446
`define OR1200_DU_TBIM          11'h2xx
447
`define OR1200_DU_TBAR          11'h3xx
448
`define OR1200_DU_TBTS          11'h4xx
449
`endif
450
 
451
// Position of offset bits inside SPR address
452
`define OR1200_DUOFS_BITS       10:0
453
 
454
// DCR bits
455
`define OR1200_DU_DCR_DP        0
456
`define OR1200_DU_DCR_CC        3:1
457
`define OR1200_DU_DCR_SC        4
458
`define OR1200_DU_DCR_CT        7:5
459
 
460
// DMR1 bits
461
`define OR1200_DU_DMR1_CW0      1:0
462
`define OR1200_DU_DMR1_CW1      3:2
463
`define OR1200_DU_DMR1_CW2      5:4
464
`define OR1200_DU_DMR1_CW3      7:6
465
`define OR1200_DU_DMR1_CW4      9:8
466
`define OR1200_DU_DMR1_CW5      11:10
467
`define OR1200_DU_DMR1_CW6      13:12
468
`define OR1200_DU_DMR1_CW7      15:14
469
`define OR1200_DU_DMR1_CW8      17:16
470
`define OR1200_DU_DMR1_CW9      19:18
471
`define OR1200_DU_DMR1_CW10     21:20
472
`define OR1200_DU_DMR1_ST       22
473
`define OR1200_DU_DMR1_BT       23
474
`define OR1200_DU_DMR1_DXFW     24
475
`define OR1200_DU_DMR1_ETE      25
476
 
477
// DMR2 bits
478
`define OR1200_DU_DMR2_WCE0     0
479
`define OR1200_DU_DMR2_WCE1     1
480
`define OR1200_DU_DMR2_AWTC     12:2
481
`define OR1200_DU_DMR2_WGB      23:13
482
 
483
// DWCR bits
484
`define OR1200_DU_DWCR_COUNT    15:0
485
`define OR1200_DU_DWCR_MATCH    31:16
486
 
487
// DSR bits
488
`define OR1200_DU_DSR_WIDTH     14
489
`define OR1200_DU_DSR_RSTE      0
490
`define OR1200_DU_DSR_BUSEE     1
491
`define OR1200_DU_DSR_DPFE      2
492
`define OR1200_DU_DSR_IPFE      3
493
`define OR1200_DU_DSR_TTE       4
494
`define OR1200_DU_DSR_AE        5
495
`define OR1200_DU_DSR_IIE       6
496
`define OR1200_DU_DSR_IE        7
497
`define OR1200_DU_DSR_DME       8
498
`define OR1200_DU_DSR_IME       9
499
`define OR1200_DU_DSR_RE        10
500
`define OR1200_DU_DSR_SCE       11
501
`define OR1200_DU_DSR_BE        12
502
`define OR1200_DU_DSR_TE        13
503
 
504
// DRR bits
505
`define OR1200_DU_DRR_RSTE      0
506
`define OR1200_DU_DRR_BUSEE     1
507
`define OR1200_DU_DRR_DPFE      2
508
`define OR1200_DU_DRR_IPFE      3
509
`define OR1200_DU_DRR_TTE       4
510
`define OR1200_DU_DRR_AE        5
511
`define OR1200_DU_DRR_IIE       6
512
`define OR1200_DU_DRR_IE        7
513
`define OR1200_DU_DRR_DME       8
514
`define OR1200_DU_DRR_IME       9
515
`define OR1200_DU_DRR_RE        10
516
`define OR1200_DU_DRR_SCE       11
517
`define OR1200_DU_DRR_BE        12
518
`define OR1200_DU_DRR_TE        13
519
 
520
 
521
/////////////////////////////////////////////////////
522
//
523
// Programmable Interrupt Controller (PIC)
524
//
525
 
526
// Address offsets of PIC registers inside PIC group
527
`define OR1200_PIC_OFS_PICMR 2'd0
528
`define OR1200_PIC_OFS_PICSR 2'd2
529
 
530
// Position of offset bits inside SPR address
531
`define OR1200_PICOFS_BITS 1:0
532
 
533
 
534
/////////////////////////////////////////////////////
535
//
536
// Tick Timer (TT)
537
//
538
 
539
// Address offsets of TT registers inside TT group
540
`define OR1200_TT_OFS_TTMR 1'd0
541
`define OR1200_TT_OFS_TTCR 1'd1
542
 
543
// Position of offset bits inside SPR group
544
`define OR1200_TTOFS_BITS 0
545
 
546
// TTMR bits
547
`define OR1200_TT_TTMR_TP 27:0
548
`define OR1200_TT_TTMR_IP 28
549
`define OR1200_TT_TTMR_IE 29
550
`define OR1200_TT_TTMR_M 31:30
551
 
552
 
553
 
554
//////////////////////////////////////////////
555
//
556
// MAC
557
//
558
`define OR1200_MAC_ADDR         0        // MACLO 0xxxxxxxx1, MACHI 0xxxxxxxx0
559
 
560
 
561
//////////////////////////////////////////////
562
//
563
// Data MMU (DMMU)
564
//
565
 
566
//
567
// Address that selects between TLB TR and MR
568
//
569
`define OR1200_DTLB_TM_ADDR     7
570
 
571
//
572
// DTLBMR fields
573
//
574
`define OR1200_DTLBMR_V_BITS    0
575
`define OR1200_DTLBMR_CID_BITS  4:1
576
`define OR1200_DTLBMR_RES_BITS  11:5
577
`define OR1200_DTLBMR_VPN_BITS  31:13
578
 
579
//
580
// DTLBTR fields
581
//
582
`define OR1200_DTLBTR_CC_BITS   0
583
`define OR1200_DTLBTR_CI_BITS   1
584
`define OR1200_DTLBTR_WBC_BITS  2
585
`define OR1200_DTLBTR_WOM_BITS  3
586
`define OR1200_DTLBTR_A_BITS    4
587
`define OR1200_DTLBTR_D_BITS    5
588
`define OR1200_DTLBTR_URE_BITS  6
589
`define OR1200_DTLBTR_UWE_BITS  7
590
`define OR1200_DTLBTR_SRE_BITS  8
591
`define OR1200_DTLBTR_SWE_BITS  9
592
`define OR1200_DTLBTR_RES_BITS  11:10
593
`define OR1200_DTLBTR_PPN_BITS  31:13
594
 
595
//
596
// DTLB configuration
597
//
598
`define OR1200_DMMU_PS          13                                      // 13 for 8KB page size
599
`define OR1200_DTLB_INDXW       6                                       // 6 for 64 entry DTLB  7 for 128 entries
600
`define OR1200_DTLB_INDXL       `OR1200_DMMU_PS                         // 13                   13
601
`define OR1200_DTLB_INDXH       `OR1200_DMMU_PS+`OR1200_DTLB_INDXW-1    // 18                   19
602
`define OR1200_DTLB_INDX        `OR1200_DTLB_INDXH:`OR1200_DTLB_INDXL   // 18:13                19:13
603
`define OR1200_DTLB_TAGW        32-`OR1200_DTLB_INDXW-`OR1200_DMMU_PS   // 13                   12
604
`define OR1200_DTLB_TAGL        `OR1200_DTLB_INDXH+1                    // 19                   20
605
`define OR1200_DTLB_TAG         31:`OR1200_DTLB_TAGL                    // 31:19                31:20
606
`define OR1200_DTLBMRW          `OR1200_DTLB_TAGW+1                     // +1 because of V bit
607
`define OR1200_DTLBTRW          32-`OR1200_DMMU_PS+5                    // +5 because of protection bits and CI
608
 
609
//
610
// Cache inhibit while DMMU is not enabled/implemented
611
//
612
// cache inhibited 0GB-4GB              1'b1
613
// cache inhibited 0GB-2GB              !dcpu_adr_i[31]
614
// cache inhibited 0GB-1GB 2GB-3GB      !dcpu_adr_i[30]
615
// cache inhibited 1GB-2GB 3GB-4GB      dcpu_adr_i[30]
616
// cache inhibited 2GB-4GB (default)    dcpu_adr_i[31]
617
// cached 0GB-4GB                       1'b0
618
//
619
`define OR1200_DMMU_CI                  dcpu_adr_i[31]
620
 
621
 
622
//////////////////////////////////////////////
623
//
624
// Insn MMU (IMMU)
625
//
626
 
627
//
628
// Address that selects between TLB TR and MR
629
//
630
`define OR1200_ITLB_TM_ADDR     7
631
 
632
//
633
// ITLBMR fields
634
//
635
`define OR1200_ITLBMR_V_BITS    0
636
`define OR1200_ITLBMR_CID_BITS  4:1
637
`define OR1200_ITLBMR_RES_BITS  11:5
638
`define OR1200_ITLBMR_VPN_BITS  31:13
639
 
640
//
641
// ITLBTR fields
642
//
643
`define OR1200_ITLBTR_CC_BITS   0
644
`define OR1200_ITLBTR_CI_BITS   1
645
`define OR1200_ITLBTR_WBC_BITS  2
646
`define OR1200_ITLBTR_WOM_BITS  3
647
`define OR1200_ITLBTR_A_BITS    4
648
`define OR1200_ITLBTR_D_BITS    5
649
`define OR1200_ITLBTR_SXE_BITS  6
650
`define OR1200_ITLBTR_UXE_BITS  7
651
`define OR1200_ITLBTR_RES_BITS  11:8
652
`define OR1200_ITLBTR_PPN_BITS  31:13
653
 
654
//
655
// ITLB configuration
656
//
657
`define OR1200_IMMU_PS          13                                      // 13 for 8KB page size
658
`define OR1200_ITLB_INDXW       6                                       // 6 for 64 entry ITLB  7 for 128 entries
659
`define OR1200_ITLB_INDXL       `OR1200_IMMU_PS                         // 13                   13
660
`define OR1200_ITLB_INDXH       `OR1200_IMMU_PS+`OR1200_ITLB_INDXW-1    // 18                   19
661
`define OR1200_ITLB_INDX        `OR1200_ITLB_INDXH:`OR1200_ITLB_INDXL   // 18:13                19:13
662
`define OR1200_ITLB_TAGW        32-`OR1200_ITLB_INDXW-`OR1200_IMMU_PS   // 13                   12
663
`define OR1200_ITLB_TAGL        `OR1200_ITLB_INDXH+1                    // 19                   20
664
`define OR1200_ITLB_TAG         31:`OR1200_ITLB_TAGL                    // 31:19                31:20
665
`define OR1200_ITLBMRW          `OR1200_ITLB_TAGW+1                     // +1 because of V bit
666
`define OR1200_ITLBTRW          32-`OR1200_IMMU_PS+3                    // +3 because of protection bits and CI
667
 
668
//
669
// Cache inhibit while IMMU is not enabled/implemented
670
// Note: all combinations that use icpu_adr_i cause async loop
671
//
672
// cache inhibited 0GB-4GB              1'b1
673
// cache inhibited 0GB-2GB              !icpu_adr_i[31]
674
// cache inhibited 0GB-1GB 2GB-3GB      !icpu_adr_i[30]
675
// cache inhibited 1GB-2GB 3GB-4GB      icpu_adr_i[30]
676
// cache inhibited 2GB-4GB (default)    icpu_adr_i[31]
677
// cached 0GB-4GB                       1'b0
678
//
679
`define OR1200_IMMU_CI                  1'b0
680
 
681
 
682
/////////////////////////////////////////////////
683
//
684
// Insn cache (IC)
685
//
686
 
687
//
688
// IC configurations
689
//
690
`ifdef OR1200_IC_1W_512B
691
`define OR1200_ICSIZE   9     // 512
692
`define OR1200_ICINDX   `OR1200_ICSIZE-2 // 7
693
`define OR1200_ICINDXH  `OR1200_ICSIZE-1 // 8
694
`define OR1200_ICTAGL   `OR1200_ICINDXH+1 // 9
695
`define OR1200_ICTAG    `OR1200_ICSIZE-`OR1200_ICLS // 5
696
`define OR1200_ICTAG_W  24
697
`endif
698
`ifdef OR1200_IC_1W_4KB
699
`define OR1200_ICSIZE                   12                      // 4096
700
`define OR1200_ICINDX                   `OR1200_ICSIZE-2        // 10
701
`define OR1200_ICINDXH                  `OR1200_ICSIZE-1        // 11
702
`define OR1200_ICTAGL                   `OR1200_ICINDXH+1       // 12
703
`define OR1200_ICTAG                    `OR1200_ICSIZE-`OR1200_ICLS     // 8
704
`define OR1200_ICTAG_W                  21
705
`endif
706
`ifdef OR1200_IC_1W_8KB
707
`define OR1200_ICSIZE                   13                      // 8192
708
`define OR1200_ICINDX                   `OR1200_ICSIZE-2        // 11
709
`define OR1200_ICINDXH                  `OR1200_ICSIZE-1        // 12
710
`define OR1200_ICTAGL                   `OR1200_ICINDXH+1       // 13
711
`define OR1200_ICTAG                    `OR1200_ICSIZE-`OR1200_ICLS     // 9
712
`define OR1200_ICTAG_W                  20
713
`endif
714
 
715
 
716
/////////////////////////////////////////////////
717
//
718
// Data cache (DC)
719
//
720
 
721
//
722
// DC configurations
723
//
724
`ifdef OR1200_DC_1W_4KB
725
`define OR1200_DCSIZE                   12                      // 4096
726
`define OR1200_DCINDX                   `OR1200_DCSIZE-2        // 10
727
`define OR1200_DCINDXH                  `OR1200_DCSIZE-1        // 11
728
`define OR1200_DCTAGL                   `OR1200_DCINDXH+1       // 12
729
`define OR1200_DCTAG                    `OR1200_DCSIZE-`OR1200_DCLS     // 8
730
`define OR1200_DCTAG_W                  21
731
`endif
732
`ifdef OR1200_DC_1W_8KB
733
`define OR1200_DCSIZE                   13                      // 8192
734
`define OR1200_DCINDX                   `OR1200_DCSIZE-2        // 11
735
`define OR1200_DCINDXH                  `OR1200_DCSIZE-1        // 12
736
`define OR1200_DCTAGL                   `OR1200_DCINDXH+1       // 13
737
`define OR1200_DCTAG                    `OR1200_DCSIZE-`OR1200_DCLS     // 9
738
`define OR1200_DCTAG_W                  20
739
`endif
740
 
741
 
742
//
743
// Base address and mask of QMEM
744
//
745
// Base address defines first address of QMEM. Mask defines
746
// QMEM range in address space. Actual size of QMEM is however
747
// determined with instantiated RAM/ROM. However bigger
748
// mask will reserve more address space for QMEM, but also
749
// make design faster, while more tight mask will take
750
// less address space but also make design slower. If
751
// instantiated RAM/ROM is smaller than space reserved with
752
// the mask, instatiated RAM/ROM will also be shadowed
753
// at higher addresses in reserved space.
754
//
755
`define OR1200_QMEM_IADDR       32'h0080_0000
756
`define OR1200_QMEM_IMASK       32'hfff0_0000   // Max QMEM size 1MB
757
`define OR1200_QMEM_DADDR  32'h0080_0000
758
`define OR1200_QMEM_DMASK  32'hfff0_0000 // Max QMEM size 1MB
759
 
760
 
761
/////////////////////////////////////////////////////
762
//
763
// VR, UPR and Configuration Registers
764
//
765
//
766
// VR, UPR and configuration registers are optional. If 
767
// implemented, operating system can automatically figure
768
// out how to use the processor because it knows 
769
// what units are available in the processor and how they
770
// are configured.
771
//
772
// This section must be last in or1200_defines.v file so
773
// that all units are already configured and thus
774
// configuration registers are properly set.
775
// 
776
 
777
 
778
// Offsets of VR, UPR and CFGR registers
779
`define OR1200_SPRGRP_SYS_VR            4'h0
780
`define OR1200_SPRGRP_SYS_UPR           4'h1
781
`define OR1200_SPRGRP_SYS_CPUCFGR       4'h2
782
`define OR1200_SPRGRP_SYS_DMMUCFGR      4'h3
783
`define OR1200_SPRGRP_SYS_IMMUCFGR      4'h4
784
`define OR1200_SPRGRP_SYS_DCCFGR        4'h5
785
`define OR1200_SPRGRP_SYS_ICCFGR        4'h6
786
`define OR1200_SPRGRP_SYS_DCFGR 4'h7
787
 
788
// VR fields
789
`define OR1200_VR_REV_BITS              5:0
790
`define OR1200_VR_RES1_BITS             15:6
791
`define OR1200_VR_CFG_BITS              23:16
792
`define OR1200_VR_VER_BITS              31:24
793
 
794
// VR values
795
`define OR1200_VR_REV                   6'h01
796
`define OR1200_VR_RES1                  10'h000
797
`define OR1200_VR_CFG                   8'h00
798
`define OR1200_VR_VER                   8'h12
799
 
800
// UPR fields
801
`define OR1200_UPR_UP_BITS              0
802
`define OR1200_UPR_DCP_BITS             1
803
`define OR1200_UPR_ICP_BITS             2
804
`define OR1200_UPR_DMP_BITS             3
805
`define OR1200_UPR_IMP_BITS             4
806
`define OR1200_UPR_MP_BITS              5
807
`define OR1200_UPR_DUP_BITS             6
808
`define OR1200_UPR_PCUP_BITS            7
809
`define OR1200_UPR_PMP_BITS             8
810
`define OR1200_UPR_PICP_BITS            9
811
`define OR1200_UPR_TTP_BITS             10
812
`define OR1200_UPR_RES1_BITS            23:11
813
`define OR1200_UPR_CUP_BITS             31:24
814
 
815
// UPR values
816
`define OR1200_UPR_UP                   1'b1
817
`ifdef OR1200_NO_DC
818
`define OR1200_UPR_DCP                  1'b0
819
`else
820
`define OR1200_UPR_DCP                  1'b1
821
`endif
822
`ifdef OR1200_NO_IC
823
`define OR1200_UPR_ICP                  1'b0
824
`else
825
`define OR1200_UPR_ICP                  1'b1
826
`endif
827
`ifdef OR1200_NO_DMMU
828
`define OR1200_UPR_DMP                  1'b0
829
`else
830
`define OR1200_UPR_DMP                  1'b1
831
`endif
832
`ifdef OR1200_NO_IMMU
833
`define OR1200_UPR_IMP                  1'b0
834
`else
835
`define OR1200_UPR_IMP                  1'b1
836
`endif
837
`define OR1200_UPR_MP                   1'b1    // MAC always present
838
`ifdef OR1200_DU_IMPLEMENTED
839
`define OR1200_UPR_DUP                  1'b1
840
`else
841
`define OR1200_UPR_DUP                  1'b0
842
`endif
843
`define OR1200_UPR_PCUP                 1'b0    // Performance counters not present
844
`ifdef OR1200_DU_IMPLEMENTED
845
`define OR1200_UPR_PMP                  1'b1
846
`else
847
`define OR1200_UPR_PMP                  1'b0
848
`endif
849
`ifdef OR1200_DU_IMPLEMENTED
850
`define OR1200_UPR_PICP                 1'b1
851
`else
852
`define OR1200_UPR_PICP                 1'b0
853
`endif
854
`ifdef OR1200_DU_IMPLEMENTED
855
`define OR1200_UPR_TTP                  1'b1
856
`else
857
`define OR1200_UPR_TTP                  1'b0
858
`endif
859
`define OR1200_UPR_RES1                 13'h0000
860
`define OR1200_UPR_CUP                  8'h00
861
 
862
// CPUCFGR fields
863
`define OR1200_CPUCFGR_NSGF_BITS        3:0
864
`define OR1200_CPUCFGR_HGF_BITS 4
865
`define OR1200_CPUCFGR_OB32S_BITS       5
866
`define OR1200_CPUCFGR_OB64S_BITS       6
867
`define OR1200_CPUCFGR_OF32S_BITS       7
868
`define OR1200_CPUCFGR_OF64S_BITS       8
869
`define OR1200_CPUCFGR_OV64S_BITS       9
870
`define OR1200_CPUCFGR_RES1_BITS        31:10
871
 
872
// CPUCFGR values
873
`define OR1200_CPUCFGR_NSGF             4'h0
874
`define OR1200_CPUCFGR_HGF              1'b0
875
`define OR1200_CPUCFGR_OB32S            1'b1
876
`define OR1200_CPUCFGR_OB64S            1'b0
877
`define OR1200_CPUCFGR_OF32S            1'b0
878
`define OR1200_CPUCFGR_OF64S            1'b0
879
`define OR1200_CPUCFGR_OV64S            1'b0
880
`define OR1200_CPUCFGR_RES1             22'h000000
881
 
882
// DMMUCFGR fields
883
`define OR1200_DMMUCFGR_NTW_BITS        1:0
884
`define OR1200_DMMUCFGR_NTS_BITS        4:2
885
`define OR1200_DMMUCFGR_NAE_BITS        7:5
886
`define OR1200_DMMUCFGR_CRI_BITS        8
887
`define OR1200_DMMUCFGR_PRI_BITS        9
888
`define OR1200_DMMUCFGR_TEIRI_BITS      10
889
`define OR1200_DMMUCFGR_HTR_BITS        11
890
`define OR1200_DMMUCFGR_RES1_BITS       31:12
891
 
892
// DMMUCFGR values
893
`ifdef OR1200_NO_DMMU
894
`define OR1200_DMMUCFGR_NTW             2'h0    // Irrelevant
895
`define OR1200_DMMUCFGR_NTS             3'h0    // Irrelevant
896
`define OR1200_DMMUCFGR_NAE             3'h0    // Irrelevant
897
`define OR1200_DMMUCFGR_CRI             1'b0    // Irrelevant
898
`define OR1200_DMMUCFGR_PRI             1'b0    // Irrelevant
899
`define OR1200_DMMUCFGR_TEIRI           1'b0    // Irrelevant
900
`define OR1200_DMMUCFGR_HTR             1'b0    // Irrelevant
901
`define OR1200_DMMUCFGR_RES1            20'h00000
902
`else
903
`define OR1200_DMMUCFGR_NTW             2'h0    // 1 TLB way
904
`define OR1200_DMMUCFGR_NTS 3'h`OR1200_DTLB_INDXW       // Num TLB sets
905
`define OR1200_DMMUCFGR_NAE             3'h0    // No ATB entries
906
`define OR1200_DMMUCFGR_CRI             1'b0    // No control register
907
`define OR1200_DMMUCFGR_PRI             1'b0    // No protection reg
908
`define OR1200_DMMUCFGR_TEIRI           1'b1    // TLB entry inv reg impl.
909
`define OR1200_DMMUCFGR_HTR             1'b0    // No HW TLB reload
910
`define OR1200_DMMUCFGR_RES1            20'h00000
911
`endif
912
 
913
// IMMUCFGR fields
914
`define OR1200_IMMUCFGR_NTW_BITS        1:0
915
`define OR1200_IMMUCFGR_NTS_BITS        4:2
916
`define OR1200_IMMUCFGR_NAE_BITS        7:5
917
`define OR1200_IMMUCFGR_CRI_BITS        8
918
`define OR1200_IMMUCFGR_PRI_BITS        9
919
`define OR1200_IMMUCFGR_TEIRI_BITS      10
920
`define OR1200_IMMUCFGR_HTR_BITS        11
921
`define OR1200_IMMUCFGR_RES1_BITS       31:12
922
 
923
// IMMUCFGR values
924
`ifdef OR1200_NO_IMMU
925
`define OR1200_IMMUCFGR_NTW             2'h0    // Irrelevant
926
`define OR1200_IMMUCFGR_NTS             3'h0    // Irrelevant
927
`define OR1200_IMMUCFGR_NAE             3'h0    // Irrelevant
928
`define OR1200_IMMUCFGR_CRI             1'b0    // Irrelevant
929
`define OR1200_IMMUCFGR_PRI             1'b0    // Irrelevant
930
`define OR1200_IMMUCFGR_TEIRI           1'b0    // Irrelevant
931
`define OR1200_IMMUCFGR_HTR             1'b0    // Irrelevant
932
`define OR1200_IMMUCFGR_RES1            20'h00000
933
`else
934
`define OR1200_IMMUCFGR_NTW             2'h0    // 1 TLB way
935
`define OR1200_IMMUCFGR_NTS 3'h`OR1200_ITLB_INDXW       // Num TLB sets
936
`define OR1200_IMMUCFGR_NAE             3'h0    // No ATB entry
937
`define OR1200_IMMUCFGR_CRI             1'b0    // No control reg
938
`define OR1200_IMMUCFGR_PRI             1'b0    // No protection reg
939
`define OR1200_IMMUCFGR_TEIRI           1'b1    // TLB entry inv reg impl
940
`define OR1200_IMMUCFGR_HTR             1'b0    // No HW TLB reload
941
`define OR1200_IMMUCFGR_RES1            20'h00000
942
`endif
943
 
944
// DCCFGR fields
945
`define OR1200_DCCFGR_NCW_BITS          2:0
946
`define OR1200_DCCFGR_NCS_BITS          6:3
947
`define OR1200_DCCFGR_CBS_BITS          7
948
`define OR1200_DCCFGR_CWS_BITS          8
949
`define OR1200_DCCFGR_CCRI_BITS         9
950
`define OR1200_DCCFGR_CBIRI_BITS        10
951
`define OR1200_DCCFGR_CBPRI_BITS        11
952
`define OR1200_DCCFGR_CBLRI_BITS        12
953
`define OR1200_DCCFGR_CBFRI_BITS        13
954
`define OR1200_DCCFGR_CBWBRI_BITS       14
955
`define OR1200_DCCFGR_RES1_BITS 31:15
956
 
957
// DCCFGR values
958
`ifdef OR1200_NO_DC
959
`define OR1200_DCCFGR_NCW               3'h0    // Irrelevant
960
`define OR1200_DCCFGR_NCS               4'h0    // Irrelevant
961
`define OR1200_DCCFGR_CBS               1'b0    // Irrelevant
962
`define OR1200_DCCFGR_CWS               1'b0    // Irrelevant
963
`define OR1200_DCCFGR_CCRI              1'b1    // Irrelevant
964
`define OR1200_DCCFGR_CBIRI             1'b1    // Irrelevant
965
`define OR1200_DCCFGR_CBPRI             1'b0    // Irrelevant
966
`define OR1200_DCCFGR_CBLRI             1'b0    // Irrelevant
967
`define OR1200_DCCFGR_CBFRI             1'b1    // Irrelevant
968
`define OR1200_DCCFGR_CBWBRI            1'b0    // Irrelevant
969
`define OR1200_DCCFGR_RES1              17'h00000
970
`else
971
`define OR1200_DCCFGR_NCW               3'h0    // 1 cache way
972
`define OR1200_DCCFGR_NCS (`OR1200_DCTAG)       // Num cache sets
973
`define OR1200_DCCFGR_CBS (`OR1200_DCLS-4)      // 16 byte cache block
974
`define OR1200_DCCFGR_CWS               1'b0    // Write-through strategy
975
`define OR1200_DCCFGR_CCRI              1'b1    // Cache control reg impl.
976
`define OR1200_DCCFGR_CBIRI             1'b1    // Cache block inv reg impl.
977
`define OR1200_DCCFGR_CBPRI             1'b0    // Cache block prefetch reg not impl.
978
`define OR1200_DCCFGR_CBLRI             1'b0    // Cache block lock reg not impl.
979
`define OR1200_DCCFGR_CBFRI             1'b1    // Cache block flush reg impl.
980
`define OR1200_DCCFGR_CBWBRI            1'b0    // Cache block WB reg not impl.
981
`define OR1200_DCCFGR_RES1              17'h00000
982
`endif
983
 
984
// ICCFGR fields
985
`define OR1200_ICCFGR_NCW_BITS          2:0
986
`define OR1200_ICCFGR_NCS_BITS          6:3
987
`define OR1200_ICCFGR_CBS_BITS          7
988
`define OR1200_ICCFGR_CWS_BITS          8
989
`define OR1200_ICCFGR_CCRI_BITS         9
990
`define OR1200_ICCFGR_CBIRI_BITS        10
991
`define OR1200_ICCFGR_CBPRI_BITS        11
992
`define OR1200_ICCFGR_CBLRI_BITS        12
993
`define OR1200_ICCFGR_CBFRI_BITS        13
994
`define OR1200_ICCFGR_CBWBRI_BITS       14
995
`define OR1200_ICCFGR_RES1_BITS 31:15
996
 
997
// ICCFGR values
998
`ifdef OR1200_NO_IC
999
`define OR1200_ICCFGR_NCW               3'h0    // Irrelevant
1000
`define OR1200_ICCFGR_NCS               4'h0    // Irrelevant
1001
`define OR1200_ICCFGR_CBS               1'b0    // Irrelevant
1002
`define OR1200_ICCFGR_CWS               1'b0    // Irrelevant
1003
`define OR1200_ICCFGR_CCRI              1'b0    // Irrelevant
1004
`define OR1200_ICCFGR_CBIRI             1'b0    // Irrelevant
1005
`define OR1200_ICCFGR_CBPRI             1'b0    // Irrelevant
1006
`define OR1200_ICCFGR_CBLRI             1'b0    // Irrelevant
1007
`define OR1200_ICCFGR_CBFRI             1'b0    // Irrelevant
1008
`define OR1200_ICCFGR_CBWBRI            1'b0    // Irrelevant
1009
`define OR1200_ICCFGR_RES1              17'h00000
1010
`else
1011
`define OR1200_ICCFGR_NCW               3'h0    // 1 cache way
1012
`define OR1200_ICCFGR_NCS (`OR1200_ICTAG)       // Num cache sets
1013
`define OR1200_ICCFGR_CBS (`OR1200_ICLS-4)      // 16 byte cache block
1014
`define OR1200_ICCFGR_CWS               1'b0    // Irrelevant
1015
`define OR1200_ICCFGR_CCRI              1'b1    // Cache control reg impl.
1016
`define OR1200_ICCFGR_CBIRI             1'b1    // Cache block inv reg impl.
1017
`define OR1200_ICCFGR_CBPRI             1'b0    // Cache block prefetch reg not impl.
1018
`define OR1200_ICCFGR_CBLRI             1'b0    // Cache block lock reg not impl.
1019
`define OR1200_ICCFGR_CBFRI             1'b1    // Cache block flush reg impl.
1020
`define OR1200_ICCFGR_CBWBRI            1'b0    // Irrelevant
1021
`define OR1200_ICCFGR_RES1              17'h00000
1022
`endif
1023
 
1024
// DCFGR fields
1025
`define OR1200_DCFGR_NDP_BITS           2:0
1026
`define OR1200_DCFGR_WPCI_BITS          3
1027
`define OR1200_DCFGR_RES1_BITS          31:4
1028
 
1029
// DCFGR values
1030
`ifdef OR1200_DU_HWBKPTS
1031
`define OR1200_DCFGR_NDP        3'h`OR1200_DU_DVRDCR_PAIRS // # of DVR/DCR pairs
1032
`ifdef OR1200_DU_DWCR0
1033
`define OR1200_DCFGR_WPCI               1'b1
1034
`else
1035
`define OR1200_DCFGR_WPCI               1'b0    // WP counters not impl.
1036
`endif
1037
`else
1038
`define OR1200_DCFGR_NDP                3'h0    // Zero DVR/DCR pairs
1039
`define OR1200_DCFGR_WPCI               1'b0    // WP counters not impl.
1040
`endif
1041
`define OR1200_DCFGR_RES1               28'h0000000

powered by: WebSVN 2.1.0

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