-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to elaborate cva6 (ariane) [possible UHDM issue] #3972
Comments
@alaindargelas @hzeller are there any updated on this issue? |
We kinda got all busy with other things, so currently is slow progress. |
@hzeller thanks for letting me know. When you have time to look at this let me know if there is anything else I can provide to help. |
@hzeller @alaindargelas any updates on this? |
@gadfort I myself don't have time to work on this , but I can find a developer for hire to dig into it. Do you have a $ budget for this? |
Adding some notes to reproduce and run through a debugger: Built surelog in debug mode and put in some 'installation' directory:
then, in the reproduce untar directory When it crashes (call
Which is in UHDM/templates/ExprEval.cpp:2530 Snippet (with relevant comments added): if (ttps == UHDM_OBJECT_TYPE::uhdmstruct_typespec) {
struct_typespec *stpt = (struct_typespec *)ts;
uint64_t from = 0; // <-- initialized to zero
uint64_t width = 0;
for (typespec_member *member : *stpt->Members()) {
if (member->VpiName() == elemName) {
width = size(member, invalidValue, inst, pexpr, true);
if (cons->VpiSize() <= 64) {
uint64_t iv = get_value(invalidValue, cons);
uint64_t mask = 0;
for (uint64_t i = from; i < uint64_t(from + width); i++) {
mask |= ((uint64_t)1 << i);
}
uint64_t res = iv & mask;
res = res >> (from);
cons->VpiValue("UINT:" + std::to_string(res));
cons->VpiSize(static_cast<int32_t>(width));
cons->VpiConstType(vpiUIntConst);
return cons;
} else {
std::string_view val = cons->VpiValue();
int32_t ctype = cons->VpiConstType();
if (ctype == vpiHexConst) {
std::string_view vval =
val.substr(strlen("HEX:"), std::string::npos);
std::string bin = NumUtils::hexToBin(vval);
std::string res = bin.substr(from, width);
cons->VpiValue("BIN:" + res);
cons->VpiSize(static_cast<int32_t>(width));
cons->VpiConstType(vpiBinaryConst);
return cons;
} else if (ctype == vpiBinaryConst) {
std::string_view bin =
val.substr(strlen("BIN:"), std::string::npos);
std::string_view res = bin.substr(from, width); // <-- here, from is 323 but bin.size() is only 1
cons->VpiValue("BIN:" + std::string(res));
cons->VpiSize(static_cast<int32_t>(width));
cons->VpiConstType(vpiBinaryConst);
return cons;
}
}
} else {
from += size(member, invalidValue, inst, pexpr, true); // <-- only way to get bigger.
}
} So from the binary value, which is of size 1, we try to request a substring 323 from the beginning. I don't know this part of the code, but hopefully this helps to start digging. |
When I attempt to elaborate the v5.0.1 version of cva6 (ariane followon) I get the following error (using version v1.83):
Attached is a testcase you can run to see the issue:
sc_issue_cva6_job0_import0_20240524-222628.tar.gz
Let me know if you need additional information.
The text was updated successfully, but these errors were encountered: