-
Notifications
You must be signed in to change notification settings - Fork 1
/
memory_map.txt
213 lines (179 loc) · 9.3 KB
/
memory_map.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
Address | Size | Description
-----------------------------------------------------------------
0x0000_0000 | 0x1000_0000 (256 MiB) | RAM
0xF000_0000 | 0x0000_1000 (4 KiB) | Debug Print Peripheral
0xF001_0000 | 0x0000_1000 (4 KiB) | GPU Peripheral
0xF002_0000 | 0x0000_1000 (4 KiB) | DSP DMA Peripheral
0xF003_0000 | 0x0000_1000 (4 KiB) | Interrupt Bus Peripheral
0xF004_0000 | 0x0000_1000 (4 KiB) | Core 1 Controller
0xF005_0000 | 0x0000_1000 (4 KiB) | Sound Peripheral
0xF006_0000 | 0x0000_1000 (4 KiB) | MTimer Peripheral (Hart Local, per-hart)
0xF007_0000 | 0x0000_1000 (4 KiB) | Math Accelerator (Hart Local, per-hart)
0xF008_0000 | 0x0000_1000 (4 KiB) | Cart loader
0xF009_0000 | 0x0000_1000 (4 KiB) | Input Peripheral
Debug Peripheral
================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Message Addr/Data | Address of message string or Data to print
0x0004 | Message Length | Length of message string to print
0x0008 | Error | Error code from device
0x000C | Print Trigger | Trigger to write debug message
GPU Peripheral
==============
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Mode | GPU Mode set register
0x0004 | Present MMFB | GPU Present MMFB Trigger
0x0008 | Sync Int Enable | VSync Interrupt Enable
DSP DMA Peripheral
==================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Type | Command data type
0x0004 | Index | Command index
0x0008 | Param 0 | Command param 0
0x000C | Param 1 | Command param 1
0x0010 | Param 2 | Command param 2
0x0014 | Param 3 | Command param 3
0x0018 | Param 4 | Command param 4
0x001C | Param 5 | Command param 5
0x0020 | Command | Command
0x0024 | Transfer Size | Tansfer Size
0x0028 | Error | Operation Error
0x002C | Error Param 0 | Error param 0
0x0030 | Error Param 1 | Error param 1
0x0034 | Error Param 2 | Error param 2
Interrupt Bus Peripheral
========================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Vsync Int State | State of Vsync Interrupt
0x0004 | Sound Int State | State of Sound Frame Interrupt
CPU 1 Controller Peripheral
===========================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Start Address | Start Address for Core 1
0x0004 | Startup Trigger | Trigger to start Core 1
0x0008 | Core State | State of Core 1
Sound Peripheral
================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Enable | Sound Enable
0x0004 | FIFO Length | Sound FIFO Length
0x0008 | FIFO Int Enable | Sound Interrupt Enable
0x000C | FIFO Fill Pointer | Sound FIFO Fill Source Pointer
0x0010 | FIFO Fill Trigger | Sound FIFO Fill Trigger
0x0010 | FIFO Read Count | Sound FIFO Last frame read count
MTimer Peripheral
=================
Offset | Name | Description
---------------------------------------------------------------------------
0x0000 | mtime | low 32 bits of mtime
0x0004 | mtime-high | high 32 bits of mtime
0x0008 | mtime-buffer low | low 32 bits of mtime atomic load/store buffer
0x000C | mtime-buffer high | high 32 bits of mtime atomic load/store buffer
0x0010 | mtime read trig | mtime atomic read trigger
0x0014 | mtime write trig | mtime atomic write trigger
0x0018 | mtime swap trig | mtime atomic swap trigger
0x0020 | mtimecmp | low 32 bits of mtimecmp
0x0024 | mtimecmp-high | high 32 bits of mtimecmp
0x0028 | mtimecmp-buff low | low 32 bits of mtimecmp atomic load/store buffer
0x002C | mtimecmp-buff high| high 32 bits of mtimecmp atomic load/store buffer
0x0030 | mtimecmp rd trig | mtimecmp atomic read trigger
0x0034 | mtimecmp wr trig | mtimecmp atomic write trigger
0x0038 | mtimecmp sw trig | mtimecmp atomic swap trigger
0x0040 | dual write trig | mtime and mtimecmp simulatneous atomic write trigger
0x0040 | dual swap trigger | mtime and mtimecmp simulatneous atomic swap trigger
Math Accelerator
================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | reg 0 | register 0
0x0004 | reg 1 | register 1
0x0008 | reg 2 | register 2
0x000C | reg 3 | register 3
... | ... | ...
0x00F0 | reg 60 | register 60
0x00F4 | reg 61 | register 61
0x00F8 | reg 62 | register 62
0x00FC | reg 63 | register 63
-----------------------------------------------------------------------
0x0100 | vec2 0 load | vector load trigger for r0, r1
0x0104 | vec2 1 load | vector load trigger for r4, r5
0x0108 | vec2 2 load | vector load trigger for r8, r9
... | ... | ...
0x0134 | vec2 13 load | vector load trigger for r52, r53
0x0138 | vec2 14 load | vector load trigger for r56, r57
0x013C | vec2 15 load | vector load trigger for r60, r61
-----------------------------------------------------------------------
0x0140 | vec2 0 store | vector store trigger for r0, r1
0x0144 | vec2 1 store | vector store trigger for r4, r5
0x0148 | vec2 2 store | vector store trigger for r8, r9
... | ... | ...
0x0174 | vec2 13 store | vector store trigger for r52, r53
0x0188 | vec2 14 store | vector store trigger for r56, r57
0x017C | vec2 15 store | vector store trigger for r60, r61
-----------------------------------------------------------------------
0x0180 | vec3 0 load | vector load trigger for r0, r1, r2
0x0184 | vec3 1 load | vector load trigger for r4, r5, r6
0x0188 | vec3 2 load | vector load trigger for r8, r9, r10
... | ... | ...
0x01B4 | vec3 13 load | vector load trigger for r52, r53, r54
0x01B8 | vec3 14 load | vector load trigger for r56, r57, r55
0x01BC | vec3 15 load | vector load trigger for r60, r61, r62
-----------------------------------------------------------------------
0x01C0 | vec3 0 store | vector store trigger for r0, r1, r2
0x01C4 | vec3 1 store | vector store trigger for r4, r5, r6
0x01C8 | vec3 2 store | vector store trigger for r8, r9, r10
... | ... | ...
0x01F4 | vec3 13 store | vector store trigger for r52, r53, r54
0x01F8 | vec3 14 store | vector store trigger for r56, r57, r58
0x01FC | vec3 15 store | vector store trigger for r60, r61, r62
-----------------------------------------------------------------------
0x0200 | vec4 0 load | vector load trigger for r0, r1, r2, r3
0x0204 | vec4 1 load | vector load trigger for r4, r5, r6, r7
0x0208 | vec4 2 load | vector load trigger for r8, r9, r10, r11
... | ... | ...
0x0234 | vec4 13 load | vector load trigger for r52, r53, r54, r55
0x0238 | vec4 14 load | vector load trigger for r56, r57, r58, r59
0x023C | vec4 15 load | vector load trigger for r60, r61, r62, r63
-----------------------------------------------------------------------
0x0240 | vec4 0 store | vector store trigger for r0, r1, r2, r3
0x0244 | vec4 1 store | vector store trigger for r4, r5, r6, r7
0x0248 | vec4 2 store | vector store trigger for r8, r9, r10, r11
... | ... | ...
0x0274 | vec4 13 store | vector store trigger for r52, r53, r54, r55
0x0278 | vec4 14 store | vector store trigger for r56, r57, r58, r59
0x027C | vec4 15 store | vector store trigger for r60, r61, r62, r63
-----------------------------------------------------------------------
0x03F8 | error | error code register
0x03FC | command | command register
Cart Loader Peripheral
======================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Command | Command register
0x0004 | Param 0 | Command param 0 register
0x0008 | Param 1 | Command param 1 register
0x000C | Param 2 | Command param 2 register
0x0010 | Param 3 | Command param 3 register
0x0014 | Param 4 | Command param 4 register
0x0018 | Param 5 | Command param 5 register
0x001C | Cartridge Count | Cartridge count register
Input Peripheral
================
Offset | Name | Description
-----------------------------------------------------------------------
0x0000 | Key events 0-31 | Event status for keys 0 - 31
0x0004 | Key events 32-63 | Event status for keys 32 - 63
0x0008 | Key events 64-95 | Event status for keys 64 - 95
0x000C | Key states 0-31 | Key state for keys 0 - 31
0x0010 | Key states 32-63 | Key state for keys 32 - 63
0x0014 | Key states 64-95 | Key state for keys 64 - 95
0x0018 | Key event bclear | Broad clear trigger for key events
0x0020 | Mouse events | Mouse event status
0x0024 | Mouse X | Mouse x position
0x0028 | Mouse Y | Mouse y position