2
votes

I use this command to print the contents of the transaction class in Questasim:

`uvm_info("VALUES", tx.sprint(), UVM_LOW)

My transaction has a variable ans. The problem is it is printing it as HEX rather than DECIMAL.

It shows:

ans integral 8 'h1c

How can I get it to display it as:

ans  integral        8     'd28
2

2 Answers

5
votes

You need to enable the UVM_DEC flag when register your uvm class:

`uvm_object_utils_begin(your_class)
`uvm_field_int(ans, UVM_ALL_ON | UVM_DEC)
`uvm_object_utils_end
0
votes

Due to the inefficiency of uvm_field_macros, it would be best to overwrite the convert2string() method, and specify the format as you wish.