-
Notifications
You must be signed in to change notification settings - Fork 99
Description
The specification contains an ambiguity regarding how the Access Memory abstract command determines its Argument Width, specifically the relationship between DXLEN, the aamsize field, and the data register mapping table.
Section 3.7 states:
"The argument width depends on the command being executed, and is DXLEN where not explicitly specified."
Table 3.2 "Use of Data Registers" shows:
- 32-bit Argument Width: arg1 is in data1
- 64-bit Argument Width: arg1 is in data2-data3
- 128-bit Argument Width: arg1 is in data4-data7
The Access Memory command includes an aamsize field:
0 = 8-bit memory access
1 = 16-bit memory access
2 = 32-bit memory access
3 = 64-bit memory access
4 = 128-bit memory access
The specification does not clearly state:
-
Is Argument Width always equal to DXLEN for Access Memory?
- If yes: On a DXLEN=32 system, arg1 is always in data1, regardless of aamsize.
- This raises the question: Can aamsize exceed DXLEN? Can a 32-bit system do 128-bit memory accesses?
-
Does aamsize "explicitly specify" Argument Width and override DXLEN?
- If yes: Setting aamsize=4 forces arg1 into data4-data7, even on a 32-bit system
- This seems illogical (why use 128 bits for a 32-bit address?)
-
Are there constraints on valid aamsize values based on DXLEN?
- Must aamsize ≤ DXLEN?
- Can a hart access memory wider than its native word size?
The specification contains a comment:
aamsize does not affect Argument Width. #420
which suggests this issue may have been previously discussed, but the resolution is not reflected in the current text.
My interpretation is that its actually possible to perform 128-bit reads on a 32-bit system by fetching, for example, four 32-bit chunks (or however the halt handles it). The aamsize field determines how many data* registers are used. This raises the question: if aamsize is 0 or 1, does that imply we only use data0 for arg0 and data1 for arg1, and so on?