I believe that randomize()/std::randomize() fall into a similar bucket where the LRM defines the return value as int type, but the only possible return values are 0 or 1.
This causes code like the following to flag truncation warnings. Can 'getEffectiveWidth' be setup for this built-in function to return 1 similar to the exists() built-in for associative-arrays?
slangtest157.sv:4:16: warning: implicit conversion truncates from 32 to 1 bits [-Wwidth-trunc]
bit rc = std::randomize(x);
^ ~~~~~~~~~~~~~~~~~.
class C;
function bit f();
bit x;
bit rc = std::randomize(x);
assert (rc);
return x;
endfunction
endclass
This is a continuation of info from #909
I believe that randomize()/std::randomize() fall into a similar bucket where the LRM defines the return value as int type, but the only possible return values are 0 or 1.
This causes code like the following to flag truncation warnings. Can 'getEffectiveWidth' be setup for this built-in function to return 1 similar to the exists() built-in for associative-arrays?