I have a question about how does SV do type conversion between string and bit? Especially for “*”, “.”, “0”.
Why EDA tool not even throw a warning for assigning a bit with string type?
module tb;
bit a="*";
string b="*";
bit c="0";
bit d=".";
initial $display(a,,b,,c,,d);
endmodule
The output is:
0 * 0 0
#-------------------------#
string → bit
-
-> 0
. → 0
0 → 0
#--------------------------#