You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On occurence of a sizing cast syntax like (n)'(/expr/) where n is a positive integer, the standard says the following:
When changing the size, the cast shall return the value that a packed array type with a single [n-1:0] dimension would hold after being assigned the expression, where n is the cast size.
1800-2023, p. 141
As far as I can tell slang does not follow that, instead it might be applying self-determined sizing to /expr/ irrespective the value of n.
TEST_CASE("Size cast upstream influence") {
ScriptSession session;
auto value = session.eval("(3)'(1'b1 << 2)");
CHECK(value.integer() == 4);
}
Additional context
On p. 140 the standard also says the below, but the mention of padding/truncation is somewhat vague and not what other tools seem to be following, exactly:
If the casting type is a constant expression with a positive integral value, the expression in parentheses shall
be padded or truncated to the size specified. It shall be an error if the size specified is zero or negative.
Describe the bug
On occurence of a sizing cast syntax like
(n)'(/expr/)
wheren
is a positive integer, the standard says the following:1800-2023, p. 141
As far as I can tell slang does not follow that, instead it might be applying self-determined sizing to
/expr/
irrespective the value ofn
.To Reproduce
This test fails as of f04d7a0 (current master)
Additional context
On p. 140 the standard also says the below, but the mention of padding/truncation is somewhat vague and not what other tools seem to be following, exactly:
Downstream issue povik/yosys-slang#78
The text was updated successfully, but these errors were encountered: