8
8
9
9
10
10
class R (FieldAction ):
11
- """A read-only field action .
11
+ """A read-only :class:`~.csr.reg.FieldAction` .
12
12
13
- Parameters
14
- ----------
13
+ Arguments
14
+ ---------
15
15
shape : :ref:`shape-like object <lang-shapelike>`
16
16
Shape of the field.
17
17
18
- Interface attributes
19
- --------------------
20
- port : :class:` FieldPort`
18
+ Members
19
+ -------
20
+ port : :py:`In(csr.reg. FieldPort.Signature(shape, "r")) `
21
21
Field port.
22
- r_data : Signal (shape)
23
- Read data. Drives ``port.r_data``. See :class:`FieldPort`.
24
- r_stb : Signal()
25
- Read strobe. Driven by ``port.r_stb``. See :class:`FieldPort`.
22
+ r_data : :py:`In (shape)`
23
+ Read data. Drives ``port.r_data``.
24
+ r_stb : :py:`Out(1)`
25
+ Read strobe. Driven by ``port.r_stb``.
26
26
"""
27
27
def __init__ (self , shape ):
28
28
super ().__init__ (shape , access = "r" , members = {
@@ -40,21 +40,21 @@ def elaborate(self, platform):
40
40
41
41
42
42
class W (FieldAction ):
43
- """A write-only field action .
43
+ """A write-only :class:`~.csr.reg.FieldAction` .
44
44
45
- Parameters
46
- ----------
45
+ Arguments
46
+ ---------
47
47
shape : :ref:`shape-like object <lang-shapelike>`
48
48
Shape of the field.
49
49
50
- Interface attributes
51
- --------------------
52
- port : :class:` FieldPort`
50
+ Members
51
+ -------
52
+ port : :py:`In(csr.reg. FieldPort.Signature(shape, "w")) `
53
53
Field port.
54
- w_data : Signal (shape)
55
- Write data. Driven by ``port.w_data``. See :class:`FieldPort`.
56
- w_stb : Signal()
57
- Write strobe. Driven by ``port.w_stb``. See :class:`FieldPort`.
54
+ w_data : :py:`Out (shape)`
55
+ Write data. Driven by ``port.w_data``.
56
+ w_stb : :py:`Out(1)`
57
+ Write strobe. Driven by ``port.w_stb``.
58
58
"""
59
59
def __init__ (self , shape ):
60
60
super ().__init__ (shape , access = "w" , members = {
@@ -72,23 +72,23 @@ def elaborate(self, platform):
72
72
73
73
74
74
class RW (FieldAction ):
75
- """A read/write field action , with built-in storage.
75
+ """A read/write :class:`~.csr.reg.FieldAction` , with built-in storage.
76
76
77
77
Storage is updated with the value of ``port.w_data`` one clock cycle after ``port.w_stb`` is
78
78
asserted.
79
79
80
- Parameters
81
- ----------
80
+ Arguments
81
+ ---------
82
82
shape : :ref:`shape-like object <lang-shapelike>`
83
83
Shape of the field.
84
84
init : :class:`int`
85
85
Storage initial value.
86
86
87
- Interface attributes
88
- --------------------
89
- port : :class:` FieldPort`
87
+ Members
88
+ -------
89
+ port : :py:`In(csr.reg. FieldPort.Signature(shape, "rw")) `
90
90
Field port.
91
- data : Signal (shape)
91
+ data : :py:`Out (shape)`
92
92
Storage output.
93
93
"""
94
94
def __init__ (self , shape , * , init = 0 ):
@@ -100,6 +100,12 @@ def __init__(self, shape, *, init=0):
100
100
101
101
@property
102
102
def init (self ):
103
+ """Storage initial value.
104
+
105
+ Returns
106
+ -------
107
+ :class:`int`
108
+ """
103
109
return self ._init
104
110
105
111
def elaborate (self , platform ):
@@ -117,28 +123,29 @@ def elaborate(self, platform):
117
123
118
124
119
125
class RW1C (FieldAction ):
120
- """A read/write-one-to-clear field action , with built-in storage.
126
+ """A read/write-one-to-clear :class:`~.csr.reg.FieldAction` , with built-in storage.
121
127
122
128
Storage bits are:
129
+
123
130
* cleared by high bits in ``port.w_data``, one clock cycle after ``port.w_stb`` is asserted;
124
131
* set by high bits in ``set``, one clock cycle after they are asserted.
125
132
126
133
If a storage bit is set and cleared on the same clock cycle, setting it has precedence.
127
134
128
- Parameters
129
- ----------
135
+ Arguments
136
+ ---------
130
137
shape : :ref:`shape-like object <lang-shapelike>`
131
138
Shape of the field.
132
139
init : :class:`int`
133
140
Storage initial value.
134
141
135
- Interface attributes
136
- --------------------
137
- port : :class:` FieldPort`
142
+ Members
143
+ -------
144
+ port : :py:`In(csr.reg. FieldPort.Signature(shape, "rw")) `
138
145
Field port.
139
- data : Signal (shape)
146
+ data : :py:`Out (shape)`
140
147
Storage output.
141
- set : Signal (shape)
148
+ set : :py:`In (shape)`
142
149
Mask to set storage bits.
143
150
"""
144
151
def __init__ (self , shape , * , init = 0 ):
@@ -151,6 +158,12 @@ def __init__(self, shape, *, init=0):
151
158
152
159
@property
153
160
def init (self ):
161
+ """Storage initial value.
162
+
163
+ Returns
164
+ -------
165
+ :class:`int`
166
+ """
154
167
return self ._init
155
168
156
169
def elaborate (self , platform ):
@@ -171,40 +184,47 @@ def elaborate(self, platform):
171
184
172
185
173
186
class RW1S (FieldAction ):
174
- """A read/write-one-to-set field action , with built-in storage.
187
+ """A read/write-one-to-set :class:`~.csr.reg.FieldAction` , with built-in storage.
175
188
176
189
Storage bits are:
190
+
177
191
* set by high bits in ``port.w_data``, one clock cycle after ``port.w_stb`` is asserted;
178
192
* cleared by high bits in ``clear``, one clock cycle after they are asserted.
179
193
180
194
If a storage bit is set and cleared on the same clock cycle, setting it has precedence.
181
195
182
- Parameters
183
- ----------
196
+ Arguments
197
+ ---------
184
198
shape : :ref:`shape-like object <lang-shapelike>`
185
199
Shape of the field.
186
200
init : :class:`int`
187
201
Storage initial value.
188
202
189
- Interface attributes
190
- --------------------
191
- port : :class:` FieldPort`
203
+ Members
204
+ -------
205
+ port : :py:`In(csr.reg. FieldPort.Signature(shape, "rw")) `
192
206
Field port.
193
- data : Signal (shape)
207
+ data : :py:`Out (shape)`
194
208
Storage output.
195
- clear : Signal (shape)
209
+ clear : :py:`In (shape)`
196
210
Mask to clear storage bits.
197
211
"""
198
212
def __init__ (self , shape , * , init = 0 ):
199
213
super ().__init__ (shape , access = "rw" , members = {
200
- "clear" : In (shape ),
201
214
"data" : Out (shape ),
215
+ "clear" : In (shape ),
202
216
})
203
217
self ._storage = Signal (shape , init = init )
204
218
self ._init = init
205
219
206
220
@property
207
221
def init (self ):
222
+ """Storage initial value.
223
+
224
+ Returns
225
+ -------
226
+ :class:`int`
227
+ """
208
228
return self ._init
209
229
210
230
def elaborate (self , platform ):
@@ -228,14 +248,14 @@ class _Reserved(FieldAction):
228
248
_doc_template = """
229
249
{description}
230
250
231
- Parameters
232
- ----------
251
+ Arguments
252
+ ---------
233
253
shape : :ref:`shape-like object <lang-shapelike>`
234
254
Shape of the field.
235
255
236
- Interface attributes
237
- --------------------
238
- port : :class:` FieldPort`
256
+ Members
257
+ -------
258
+ port : :py:`In(csr.reg. FieldPort.Signature(shape, "nc")) `
239
259
Field port.
240
260
"""
241
261
def __init__ (self , shape ):
@@ -247,23 +267,23 @@ def elaborate(self, platform):
247
267
248
268
class ResRAW0 (_Reserved ):
249
269
__doc__ = _Reserved ._doc_template .format (description = """
250
- A reserved read-any/write-zero field action .
270
+ A reserved read-any/write-zero :class:`~.csr.reg.FieldAction` .
251
271
""" )
252
272
253
273
254
274
class ResRAWL (_Reserved ):
255
275
__doc__ = _Reserved ._doc_template .format (description = """
256
- A reserved read-any/write-last field action .
276
+ A reserved read-any/write-last :class:`~.csr.reg.FieldAction` .
257
277
""" )
258
278
259
279
260
280
class ResR0WA (_Reserved ):
261
281
__doc__ = _Reserved ._doc_template .format (description = """
262
- A reserved read-zero/write-any field action .
282
+ A reserved read-zero/write-any :class:`~.csr.reg.FieldAction` .
263
283
""" )
264
284
265
285
266
286
class ResR0W0 (_Reserved ):
267
287
__doc__ = _Reserved ._doc_template .format (description = """
268
- A reserved read-zero/write-zero field action .
288
+ A reserved read-zero/write-zero :class:`~.csr.reg.FieldAction` .
269
289
""" )
0 commit comments