2

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
toolic
  • 57,801
  • 17
  • 75
  • 117
Vineeth
  • 111
  • 2
  • 11

2 Answers2

5

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
AldoT
  • 913
  • 1
  • 8
  • 34
  • Its working But one small problem.. some times instead of 'd12 it is displaying only 12.Like this mostly for all number greater than 7. – Vineeth Oct 07 '14 at 07:21
0

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

GoChanGo
  • 61
  • 1
  • 1
  • 8