Ovm_comparer doesn't print negative values

Because I couldn’t manage the ovm_comparer to print negative values of object members, I’ve tested the following minimal example.


my_comparer.compare_field_int("negative value test",3,-5,4,OVM_DEC);

I get the following unexpected output from Questa.

OVM_INFO @ 3220: reporter [MISCMP] Miscompare for negative value test: lhs = 3 : rhs = 11

Two’s complement is always printed for negative values, what I’m doing wrong?

BR,
Steffen

The problem is that some of the people that wrote the OVM/UVM have no idea what an int is. Sometimes it is a 4K bit unsigned vector, sometimes its a 64-bit unsigned integer. It is never a 32-bit signed integer, like it is supposed to be.

You options are:

  1. Live wit h it.
  2. use compare_field_real
  3. override the the ovm_comparer class
  4. write your own compare method.

In reply to dave_59:

Probably the reason why the case OVM_UNSIGNED isn’t implemented for the compare_field() and compare_field_int() functions in ovm_comparer.

Thx.