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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_50/] [or1ksim/] [cpu/] [or1k/] [spr_defs.h] - Blame information for rev 90

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 64 lampret
/* spr_defs.h -- Defines OR1K architecture specific special-purpose registers
2
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
3
 
4
This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
GNU General Public License for more details.
15
 
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20
/* This file is also used by microkernel test bench. Among
21
others it is also used in assembly file(s). */
22
 
23
/* Definition of special-purpose registers (SPRs) */
24
 
25
#define MAX_GRPS 32
26
#define MAX_SPRS_PER_GRP 0x1000
27
#define MAX_SPRS (MAX_GRPS * 0x1000000 / MAX_SPRS_PER_GRP)
28
 
29
/* Base addresses for the groups */
30
#define SPRGROUP_SYS    0x00000000
31
#define SPRGROUP_DMMU   0x01000000
32
#define SPRGROUP_IMMU   0x02000000
33
#define SPRGROUP_DC     0x03000000
34
#define SPRGROUP_IC     0x04000000
35
#define SPRGROUP_MAC    0x05000000
36 90 lampret
#define SPRGROUP_TT     0x09000000
37 64 lampret
 
38
/* System control and status group */
39
#define SPR_VR          (SPRGROUP_SYS + 0)
40
#define SPR_MPR         (SPRGROUP_SYS + 1)
41
#define SPR_SR          (SPRGROUP_SYS + 2)
42
#define SPR_EPCR_BASE   (SPRGROUP_SYS + 16)
43
#define SPR_EPCR_LAST   (SPRGROUP_SYS + 31)
44
#define SPR_CTR_BASE    (SPRGROUP_SYS + 32)
45
#define SPR_CTR_LAST    (SPRGROUP_SYS + 47)
46
#define SPR_EEAR_BASE   (SPRGROUP_SYS + 48)
47
#define SPR_EEAR_LAST   (SPRGROUP_SYS + 63)
48
#define SPR_ESR_BASE    (SPRGROUP_SYS + 64)
49
#define SPR_ESR_LAST    (SPRGROUP_SYS + 79)
50
 
51
/* Data MMU group */
52
#define SPR_DMMUCR      (SPRGROUP_DMMU + 0)
53
#define SPR_DTLBMR_BASE(WAY)    (SPRGROUP_DMMU + 0x200 + (WAY) * 0x200)
54
#define SPR_DTLBMR_LAST(WAY)    (SPRGROUP_DMMU + 0x2ff + (WAY) * 0x200)
55
#define SPR_DTLBTR_BASE(WAY)    (SPRGROUP_DMMU + 0x300 + (WAY) * 0x200)
56
#define SPR_DTLBTR_LAST(WAY)    (SPRGROUP_DMMU + 0x3ff + (WAY) * 0x200)
57
 
58
/* Instruction MMU group */
59
#define SPR_IMMUCR      (SPRGROUP_IMMU + 0)
60
#define SPR_ITLBMR_BASE(WAY)    (SPRGROUP_IMMU + 0x200 + (WAY) * 0x200)
61
#define SPR_ITLBMR_LAST(WAY)    (SPRGROUP_IMMU + 0x2ff + (WAY) * 0x200)
62
#define SPR_ITLBTR_BASE(WAY)    (SPRGROUP_IMMU + 0x300 + (WAY) * 0x200)
63
#define SPR_ITLBTR_LAST(WAY)    (SPRGROUP_IMMU + 0x3ff + (WAY) * 0x200)
64
 
65
/* Data cache group */
66
#define SPR_DCCR        (SPRGROUP_DC + 0)
67
#define SPR_DCR_BASE(WAY)       (SPRGROUP_DC + 0x200 + (WAY) * 0x200)
68
#define SPR_DCR_LAST(WAY)       (SPRGROUP_DC + 0x3ff + (WAY) * 0x200)
69
 
70
/* Instruction cache group */
71
#define SPR_ICCR        (SPRGROUP_IC + 0)
72
#define SPR_ICR_BASE(WAY)       (SPRGROUP_IC + 0x200 + (WAY) * 0x200)
73
#define SPR_ICR_LAST(WAY)       (SPRGROUP_IC + 0x3ff + (WAY) * 0x200)
74
 
75
/* MAC group */
76
#define SPR_MACLO (SPRGROUP_MAC + 1)
77
#define SPR_MACHI (SPRGROUP_MAC + 2)
78
 
79 90 lampret
/* Tick Timer group */
80
#define SPR_TTCR (SPRGROUP_TT + 0)
81
 
82 64 lampret
/*
83
 * Bit definitions for the Version Register
84
 *
85
 */
86
#define SPR_VR_VER      0xffff0000  /* Processor version */
87
#define SPR_VR_PT       0x0000f000  /* Predefined template */
88
#define SPR_VR_REV      0x0000003f  /* Processor revision */
89
 
90
/*
91
 * Bit definitions for the Module Present Register
92
 *
93
 */
94
#define SPR_MPR_SYS     0x00000001  /* System control and status module */
95
#define SPR_MPR_DMMU    0x00000002  /* Data MMU module */
96
#define SPR_MPR_IMMU    0x00000004  /* Instruction MMU module */
97
#define SPR_MPR_DC      0x00000008  /* Data cache module */
98
#define SPR_MPR_IC      0x00000010  /* Instruction cache module */
99
#define SPR_MPR_MAC     0x00000020  /* MAC module */
100
#define SPR_MPR_RES     0xffffffc0  /* Custom and future modules */
101
 
102
/*
103
 * Bit definitions for the Supervision Register
104
 *
105
 */
106
#define SPR_SR_CID      0xf0000000  /* Context ID */
107
#define SPR_SR_CF       0x00000100  /* Condition Flag */
108
#define SPR_SR_LEE      0x00000080  /* Little Endian Enable */
109
#define SPR_SR_IME      0x00000040  /* Instruction MMU Enable */
110
#define SPR_SR_DME      0x00000020  /* Data MMU Enable */
111
#define SPR_SR_ICE      0x00000010  /* Instruction Cache Enable */
112
#define SPR_SR_DCE      0x00000008  /* Data Cache Enable */
113
#define SPR_SR_EIR      0x00000004  /* External Interrupt Recognition */
114
#define SPR_SR_EXR      0x00000002  /* Exception Recognition */
115
#define SPR_SR_SUPV     0x00000001  /* Supervisor mode */
116
 
117
/*
118
 * Bit definitions for the Condition Code Register
119
 *
120
 */
121
#define SPR_CCR_OVERFL  0x00000004  /* Overflow */
122
#define SPR_CCR_CARRY   0x00000002  /* Carry */
123
#define SPR_CCR_FLAG    0x00000001  /* Compare Flag */
124
 
125
/*
126
 * Bit definitions for the Data MMU Control Register
127
 *
128
 */
129
#define SPR_DMMUCR_P2S  0x0000003e  /* Level 2 Page Size */
130
#define SPR_DMMUCR_P1S  0x000007c0  /* Level 1 Page Size */
131
#define SPR_DMMUCR_VADDR_WIDTH  0x0000f800  /* Virtual ADDR Width */
132
#define SPR_DMMUCR_PADDR_WIDTH  0x000f0000  /* Physical ADDR Width */
133
 
134
/*
135
 * Bit definitions for the Instruction MMU Control Register
136
 *
137
 */
138
#define SPR_IMMUCR_P2S  0x0000003e  /* Level 2 Page Size */
139
#define SPR_IMMUCR_P1S  0x000007c0  /* Level 1 Page Size */
140
#define SPR_IMMUCR_VADDR_WIDTH  0x0000f800  /* Virtual ADDR Width */
141
#define SPR_IMMUCR_PADDR_WIDTH  0x000f0000  /* Physical ADDR Width */
142
 
143
/*
144
 * Bit definitions for the Data TLB Match Register
145
 *
146
 */
147
#define SPR_DTLBMR_V    0x00000001  /* Valid */
148
#define SPR_DTLBMR_PL1  0x00000002  /* Page Level 1 (if 0 then PL2) */
149
#define SPR_DTLBMR_CID  0x0000003c  /* Context ID */
150
#define SPR_DTLBMR_LRU  0x000000c0  /* Least Recently Used */
151 77 lampret
#define SPR_DTLBMR_VPN  0xfffff000  /* Virtual Page Number */
152 64 lampret
 
153
/*
154
 * Bit definitions for the Data TLB Translate Register
155
 *
156
 */
157
#define SPR_DTLBTR_CC   0x00000001  /* Cache Coherency */
158
#define SPR_DTLBTR_CI   0x00000002  /* Cache Inhibit */
159
#define SPR_DTLBTR_WBC  0x00000004  /* Write-Back Cache */
160
#define SPR_DTLBTR_WOM  0x00000008  /* Weakly-Ordered Memory */
161
#define SPR_DTLBTR_A    0x00000010  /* Accessed */
162
#define SPR_DTLBTR_D    0x00000020  /* Dirty */
163
#define SPR_DTLBTR_URE  0x00000040  /* User Read Enable */
164
#define SPR_DTLBTR_UWE  0x00000080  /* User Write Enable */
165
#define SPR_DTLBTR_SRE  0x00000100  /* Supervisor Read Enable */
166
#define SPR_DTLBTR_SWE  0x00000200  /* Supervisor Write Enable */
167 77 lampret
#define SPR_DTLBTR_PPN  0xfffff000  /* Physical Page Number */
168 64 lampret
 
169
/*
170
 * Bit definitions for the Instruction TLB Match Register
171
 *
172
 */
173
#define SPR_ITLBMR_V    0x00000001  /* Valid */
174
#define SPR_ITLBMR_PL1  0x00000002  /* Page Level 1 (if 0 then PL2) */
175
#define SPR_ITLBMR_CID  0x0000003c  /* Context ID */
176
#define SPR_ITLBMR_LRU  0x000000c0  /* Least Recently Used */
177 77 lampret
#define SPR_ITLBMR_VPN  0xfffff000  /* Virtual Page Number */
178 64 lampret
 
179
/*
180
 * Bit definitions for the Instruction TLB Translate Register
181
 *
182
 */
183
#define SPR_ITLBTR_CC   0x00000001  /* Cache Coherency */
184
#define SPR_ITLBTR_CI   0x00000002  /* Cache Inhibit */
185
#define SPR_ITLBTR_WBC  0x00000004  /* Write-Back Cache */
186
#define SPR_ITLBTR_WOM  0x00000008  /* Weakly-Ordered Memory */
187
#define SPR_ITLBTR_A    0x00000010  /* Accessed */
188
#define SPR_ITLBTR_D    0x00000020  /* Dirty */
189
#define SPR_ITLBTR_URE  0x00000040  /* User Read Enable */
190
#define SPR_ITLBTR_UWE  0x00000080  /* User Write Enable */
191
#define SPR_ITLBTR_SRE  0x00000100  /* Supervisor Read Enable */
192
#define SPR_ITLBTR_SWE  0x00000200  /* Supervisor Write Enable (not used actually) */
193 77 lampret
#define SPR_ITLBTR_PPN  0xfffff000  /* Physical Page Number */
194 64 lampret
 
195 90 lampret
/*
196
 * Bit definitions for Tick Timer Control Register
197
 *
198
 */
199
#define SPR_TTCR_PERIOD 0x0fffffff  /* Time Period */
200
#define SPR_TTCR_IP     0x10000000  /* Interrupt Present */
201
#define SPR_TTCR_IE     0x20000000  /* Interrupt Enable */
202
#define SPR_TTCR_SR     0x40000000  /* Single Run */
203
#define SPR_TTCR_TTE    0x80000000  /* Tick Timer Enable */
204
 

powered by: WebSVN 2.1.0

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