@@ -192,28 +192,29 @@ class Multiplexer(Elaboratable):
192
192
are possible for connecting the CSR bus to the CPU:
193
193
* The CPU could access the CSR bus directly (with no intervening logic other than simple
194
194
translation of control signals). In this case, the register alignment should be set
195
- to 1, and each *w*-bit register would occupy *ceil(w/n)* addresses from the CPU
196
- perspective, requiring the same amount of memory instructions to access.
195
+ to 1 (i.e. `alignment` should be set to 0), and each *w*-bit register would occupy
196
+ *ceil(w/n)* addresses from the CPU perspective, requiring the same amount of memory
197
+ instructions to access.
197
198
* The CPU could also access the CSR bus through a width down-converter, which would issue
198
199
*k/n* CSR accesses for each CPU access. In this case, the register alignment should be
199
200
set to *k/n*, and each *w*-bit register would occupy *ceil(w/k)* addresses from the CPU
200
201
perspective, requiring the same amount of memory instructions to access.
201
202
202
- If alignment is greater than 1, it affects which CSR bus write is considered a write to
203
- the last register chunk. For example, if a 24-bit register is used with a 8-bit CSR bus and
204
- a CPU with a 32-bit datapath, a write to this register requires 4 CSR bus writes to complete
205
- and the 4th write is the one that actually writes the value to the register. This allows
206
- determining write latency solely from the amount of addresses the register occupies in
207
- the CPU address space, and the width of the CSR bus.
203
+ If the register alignment (i.e. `2 ** alignment`) is greater than 1, it affects which CSR bus
204
+ write is considered a write to the last register chunk. For example, if a 24-bit register is
205
+ used with a 8-bit CSR bus and a CPU with a 32-bit datapath, a write to this register requires
206
+ 4 CSR bus writes to complete and the 4th write is the one that actually writes the value to
207
+ the register. This allows determining write latency solely from the amount of addresses the
208
+ register occupies in the CPU address space, and the width of the CSR bus.
208
209
209
210
Parameters
210
211
----------
211
212
addr_width : int
212
213
Address width. See :class:`Interface`.
213
214
data_width : int
214
215
Data width. See :class:`Interface`.
215
- alignment : int
216
- Register alignment. See :class:`Interface `.
216
+ alignment : log2 of int
217
+ Register alignment. See :class:`..memory.MemoryMap `.
217
218
218
219
Attributes
219
220
----------
@@ -327,8 +328,8 @@ class Decoder(Elaboratable):
327
328
Address width. See :class:`Interface`.
328
329
data_width : int
329
330
Data width. See :class:`Interface`.
330
- alignment : int
331
- Window alignment. See :class:`Interface `.
331
+ alignment : log2 of int
332
+ Window alignment. See :class:`..memory.MemoryMap `.
332
333
333
334
Attributes
334
335
----------
0 commit comments