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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
use crate::metadata::ir::*;
pub(crate) static REGISTERS: IR = IR {
blocks: &[
Block {
name: "Ipc",
extends: None,
description: Some(
"Inter-Processor Communication. Four bidirectional channels, each carrying 8 status bits with independent enable/mask/set/clear, plus four 32-bit shared message slots for short messages.",
),
items: &[
BlockItem {
name: "ctlr",
description: Some(
"IPC control register. Per-channel TX/RX core ID routing, interrupt enables, auto-update mode and configuration lock.",
),
array: None,
byte_offset: 0x0,
inner: BlockItemInner::Register(
Register {
access: Access::ReadWrite,
bit_size: 32,
fieldset: Some(
"Ctlr",
),
},
),
},
BlockItem {
name: "isr",
description: Some(
"Per-channel interrupt status (read-only summary; bits set when channel state matches the configured trigger).",
),
array: None,
byte_offset: 0x4,
inner: BlockItemInner::Register(
Register {
access: Access::Read,
bit_size: 32,
fieldset: Some(
"Channels",
),
},
),
},
BlockItem {
name: "ism",
description: Some(
"Per-channel interrupt mask status (read-only; bit set means channel is currently raising an interrupt request to its routed core).",
),
array: None,
byte_offset: 0x8,
inner: BlockItemInner::Register(
Register {
access: Access::Read,
bit_size: 32,
fieldset: Some(
"Channels",
),
},
),
},
BlockItem {
name: "ena",
description: Some(
"Per-channel status-bit interrupt enable. Each enabled bit produces TX or RX interrupts based on the value in STS.",
),
array: None,
byte_offset: 0x10,
inner: BlockItemInner::Register(
Register {
access: Access::ReadWrite,
bit_size: 32,
fieldset: Some(
"Channels",
),
},
),
},
BlockItem {
name: "sts",
description: Some(
"Per-channel status register. Bit value 1 may raise an RX interrupt; bit value 0 may raise a TX interrupt (subject to ENA / IER configuration).",
),
array: None,
byte_offset: 0x14,
inner: BlockItemInner::Register(
Register {
access: Access::ReadWrite,
bit_size: 32,
fieldset: Some(
"Channels",
),
},
),
},
BlockItem {
name: "set",
description: Some(
"Per-channel status set register. Writing 1 sets the corresponding bit in STS (and in ENA when AUTOEN is on).",
),
array: None,
byte_offset: 0x18,
inner: BlockItemInner::Register(
Register {
access: Access::Write,
bit_size: 32,
fieldset: Some(
"Channels",
),
},
),
},
BlockItem {
name: "clr",
description: Some(
"Per-channel status clear register. Writing 1 clears the corresponding bit in STS.",
),
array: None,
byte_offset: 0x1c,
inner: BlockItemInner::Register(
Register {
access: Access::Write,
bit_size: 32,
fieldset: Some(
"Channels",
),
},
),
},
BlockItem {
name: "msg",
description: Some(
"32-bit inline message slot. Four slots are available to carry short messages without touching shared SRAM.",
),
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 4,
},
),
),
byte_offset: 0x20,
inner: BlockItemInner::Register(
Register {
access: Access::ReadWrite,
bit_size: 32,
fieldset: Some(
"Msg",
),
},
),
},
],
},
],
fieldsets: &[
FieldSet {
name: "Channels",
extends: None,
description: Some(
"Per-channel 8-bit value (used by ISR / ISM / ENA / STS / SET / CLR). Channel n occupies bits 8n..8n+7.",
),
bit_size: 32,
fields: &[
Field {
name: "ch",
description: Some(
"Channel byte. Each of the 8 bits is an independent status / enable / set / clear flag.",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 0,
},
),
bit_size: 8,
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 8,
},
),
),
enumm: None,
},
],
},
FieldSet {
name: "Ctlr",
extends: None,
description: Some(
"IPC control register. Each of the four channels occupies 8 bits (channel n at bits 8n..8n+7).",
),
bit_size: 32,
fields: &[
Field {
name: "tx_cid",
description: Some(
"Sender core ID. 0=route TX interrupt to hart 0 (V3F), 1=route to hart 1 (V5F).",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 0,
},
),
bit_size: 1,
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 8,
},
),
),
enumm: None,
},
Field {
name: "rx_cid",
description: Some(
"Receiver core ID. 0=route RX interrupt to hart 0, 1=route to hart 1.",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 2,
},
),
bit_size: 1,
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 8,
},
),
),
enumm: None,
},
Field {
name: "tx_ier",
description: Some(
"TX interrupt enable.",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 4,
},
),
bit_size: 1,
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 8,
},
),
),
enumm: None,
},
Field {
name: "rx_ier",
description: Some(
"RX interrupt enable.",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 5,
},
),
bit_size: 1,
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 8,
},
),
),
enumm: None,
},
Field {
name: "autoen",
description: Some(
"Status-bit auto-update. When set, writing to STS / SET also updates ENA to the same value so the interrupt fires immediately.",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 6,
},
),
bit_size: 1,
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 8,
},
),
),
enumm: None,
},
Field {
name: "lock",
description: Some(
"Channel configuration lock. Write 1 to freeze the channel's other control bits until reset.",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 7,
},
),
bit_size: 1,
array: Some(
Array::Regular(
RegularArray {
len: 4,
stride: 8,
},
),
),
enumm: None,
},
],
},
FieldSet {
name: "Msg",
extends: None,
description: Some(
"32-bit inline message register.",
),
bit_size: 32,
fields: &[
Field {
name: "data",
description: Some(
"32-bit message value.",
),
bit_offset: BitOffset::Regular(
RegularBitOffset {
offset: 0,
},
),
bit_size: 32,
array: None,
enumm: None,
},
],
},
],
enums: &[],
};