-
Notifications
You must be signed in to change notification settings - Fork 722
Description
$sformat('%p', s1) does not work if the s1 is a struct which contains a real value. For example, if s1 has fields f1:int and f2:real, the output looks like:
p='{f1:'h1, f2:140729929255072}
btw, I was hoping to use this with SVUnit as a way to implement FAIL_UNLESS_EQUAL(a,b) while showing the actual values of a and b by converting a and b to a string and then checking for equality. This would prevent a, b from being evaluated twice in case they have side effects.
Also, I could not get this type of assignment to work:
simple_struct_t f1 = '{1, 2.2};
It gives a warning that 2.2 will be converted to an int.
Can you attach an example that shows the issue?
I modified these two attached files under test_regress/t to show the issue.
What 'verilator' command line do we use to run your example?
Copy the files to test_regress/t, then
./t_display_real.py
What 'verilator --version' are you using? Did you try it with the git master version?
Verilator 5.033 devel rev v5.032-8-g036c1fb0f (mod)
Built from source, yes, I tried master version
What OS and distribution are you using?
AlmaLinux 9 in WSL
May we assist you in trying to fix this in Verilator yourself?
yes
t_display_real.zip