forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrv_plic.hjson
210 lines (202 loc) · 5.58 KB
/
rv_plic.hjson
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
// Copyright lowRISC contributors (OpenTitan project).
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
# RV_PLIC register template
#
# Parameter (given by Python tool)
# - src: Number of Interrupt Sources
# - target: Number of Targets that handle interrupt requests
# - prio: Max value of interrupt priorities
# - module_instance_name: Module instance name.
{
name: "rv_plic",
human_name: "RISC-V platform level interrupt controller",
one_line_desc: "Interrupt controller, adhering to RISC-V PLIC specification",
one_paragraph_desc: '''
rv_plic is an interrupt controller which handles multiple interrupt sources. Each interrupt
source can be enabled or disabled, and can be given a priority. rv_plic generates an output
that identifies the source with the highest priority amongst those that are currently asserted.
'''
// Unique comportable IP identifier defined under KNOWN_CIP_IDS in the regtool.
cip_id: "33",
design_spec: "../doc",
dv_doc: "../doc/dv",
hw_checklist: "../doc/checklist",
sw_checklist: "/sw/device/lib/dif/dif_rv_plic",
revisions: [
{
version: "2.0.0",
life_stage: "L1",
design_stage: "D3",
verification_stage: "V2",
dif_stage: "S2",
commit_id: "",
notes: "Use FPV to perform block level verification.",
}
],
clocking: [{clock: "clk_i", reset: "rst_ni"}],
bus_interfaces: [
{ protocol: "tlul", direction: "device" }
],
param_list: [
{ name: "NumSrc",
desc: "Number of interrupt sources",
type: "int",
default: "186",
local: "true"
},
{ name: "NumTarget",
desc: "Number of Targets (Harts)",
type: "int",
default: "1",
local: "true",
},
{ name: "PrioWidth",
desc: "Width of priority signals",
type: "int",
default: "2",
local: "true",
},
],
// In order to not disturb the PLIC address map, we place the alert test
// register manually at a safe offset after the main CSRs.
no_auto_alert_regs: "True",
alert_list: [
{ name: "fatal_fault",
desc: '''
This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected.
'''
}
],
inter_signal_list: [
{ struct: "logic",
type: "uni",
name: "irq",
act: "req",
package: "",
width: "1"
},
{ struct: "logic",
type: "uni",
name: "irq_id",
act: "req",
package: "",
},
{ struct: "logic",
type: "uni",
name: "msip",
act: "req",
package: "",
width: "1"
},
]
countermeasures: [
{ name: "BUS.INTEGRITY",
desc: "End-to-end bus integrity scheme."
}
]
features: [
{ name: "RV_PLIC.PRIORITY",
desc: '''Each interrupt source can be given a configurable priority.'''
}
{ name: "RV_PLIC.ENABLE",
desc: '''Each target has an associated set of interrupt enable bits. Configuring these
controls whether a target will be notified when the interrupt is triggered.
'''
}
]
regwidth: "32",
registers: [
{ multireg:
{ name: "PRIO",
desc: "Interrupt Source Priority",
count: "NumSrc",
cname: "RV_PLIC",
swaccess: "rw",
hwaccess: "hro",
compact: false,
fields: [
{ bits: "1:0" }
],
}
}
{ skipto: "0x00001000" }
{ multireg: {
name: "IP",
desc: "Interrupt Pending",
count: "NumSrc",
cname: "RV_PLIC",
swaccess: "ro",
hwaccess: "hwo",
fields: [
{ bits: "0", name: "P", desc: "Interrupt Pending of Source" }
],
tags: [// IP is driven by intr_src, cannot auto-predict
"excl:CsrNonInitTests:CsrExclCheck"],
}
},
{ skipto: "0x2000" }
{ multireg: {
name: "IE0",
desc: "Interrupt Enable for Target 0",
count: "NumSrc",
cname: "RV_PLIC",
swaccess: "rw",
hwaccess: "hro",
fields: [
{ bits: "0", name: "E", desc: "Interrupt Enable of Source" }
],
}
}
{ skipto: "0x200000" }
{ name: "THRESHOLD0",
desc: "Threshold of priority for Target 0",
swaccess: "rw",
hwaccess: "hro",
fields: [
{ bits: "1:0" }
],
}
{ name: "CC0",
desc: '''Claim interrupt by read, complete interrupt by write for Target 0.
Value read/written is interrupt ID. Reading a value of 0 means no pending interrupts.''',
swaccess: "rw",
hwaccess: "hrw",
hwext: "true",
hwqe: "true",
hwre: "true",
fields: [
{ bits: "7:0" }
],
tags: [// CC register value is related to IP
"excl:CsrNonInitTests:CsrExclCheck"],
}
{ skipto: "0x4000000" }
{ name: "MSIP0",
desc: '''msip for Hart 0.
Write 1 to here asserts software interrupt for Hart msip_o[0], write 0 to clear.''',
swaccess: "rw",
hwaccess: "hro",
fields: [
{ bits: "0",
desc: "Software Interrupt Pending register",
}
],
}
{ skipto: "0x4004000" }
{ name: "ALERT_TEST",
desc: '''Alert Test Register.''',
swaccess: "wo",
hwaccess: "hro",
hwqe: "True",
hwext: "True",
fields: [
{ bits: "0",
name: "fatal_fault",
desc: "'Write 1 to trigger one alert event of this kind.'",
}
],
}
],
}