is it possible to print negative hexadecimals in Specman?
For example:
var foo : int;
foo = -0x5;
print foo;
will print: foo = 0xfffffffb
.
How can I display the output as -0x5
?
Really appreciate any help.
is it possible to print negative hexadecimals in Specman?
For example:
var foo : int;
foo = -0x5;
print foo;
will print: foo = 0xfffffffb
.
How can I display the output as -0x5
?
Really appreciate any help.
After having a look in the doc, I don't think this is possible. Hex notation is usually used to figure out the bit representation so it doesn't really make sense to show a -
. If you want to see it in decimal format (regardless of the radix settings), do:
print foo using dec;
or:
print dec(foo);
You can try a trick as follows: