struct.error: unpack requires a buffer of 4 bytes
ptprasanna opened this issue · comments
Unable to execute any tests over isac on the coverage mode. Have tried execution fclass test, but without success. The age old buffer unpack issue looks not fixed yet on the latest isac version.
![Screenshot from 2022-08-24 17-16-08](https://user-images.githubusercontent.com/98386162/186413759-07e7abf0-2f25-4622-9f97-2a130f6b
Isac_Issue.log
21ed.png)
Attached are the logs out of the run done.
Can you provide the following details?
- Length of the floating point register file values in the log
FLEN
specified in the CLI while invokingriscv_isac
.
I believe that there is a mismatch in both of these values and hence the error. Can you also try using the length of the floating point register file values in the log as FLEN
and see if the error persists?
FLEN = 32
And riscof didn't show any warning or error message, it just hanging on the make line and user has to interrupt and debug through the make file generated by riscof, then found the issue is while invoking isac.
fclass_b1-01.log
Attached is the log file.
Below are the additional inputs from the investigation done. Sail (riscv_sim_RV32
) returns f31 <- 0xFFFFFFFF00000000
from the log, when isac parse this line from the log, the value is prefixed with 0xF
though the flen
is 32. The size of this value (8 Byte) is not matching with the size of fsgn_sz
(4 Byte), hence the error. The solution to handle this error from isac is as follows.
- Increase the size of
fsgn_sz
with respect to the length of the 0xF prefixed value - Understand from Sail point of view on the reason behind returning 0xF prefixed value for
xlen=32
andflen=32
and handle it appropriately in isac
Discussion Points on the ACT SIG (25 Aug 2022): This will be fixed as part of the next PR which @pawks will raise towards riscv-isac
update. Until then we can follow any of the below workaround.
- Making sail with the specific extension that we run can avoid this issue (for example, making sail with
F
extension explicitly configured can generate the 4 byte value as expected) - Have the
fsgn_sz
size dynamically to match thesail
log value inisac
@allenjbaum @pawks feel free to add if i have missed any