Hi,
The function declaration of ovm_set_attribute_by_name is as follows:
function void ovm_set_attribute_by_name (TRH txh,
string nm,
logic [1023:0] value,
string radix,
TRH numbits=0);
I notice that there is a radix argument in this function.
It seems that this argument is used to record the radix of the attribute.
How can user set the radix of the attribute in a transaction so that ovm_set_attribute_by_name() can record the radix? Should user call any macro to set radix of specific attribute in the transaction?
As you might be aware in ovm, these are functions to be simulator neutral for transaction recording purpose.
If you are using ncsim/irun simulator,these are just wrappers over the $sdi_* system tasks/functions.To understand how these methods work, kindly look at the documentation for $sdi* tasks (Cadence Transaction recording SDI/HDL reference) .
There is a function :
$sdi_set_attribute_by_name(fiber_handle, // Required
attribute_name, // Required
verilog_variable // Required
format_string,
position, // Optional
)
and the format_string descriptions are
Hi Chinmay,
Thanks for your information. I am curious about if user can call the macro like ovm_field_int(arg,flag) to specify the radix of attribute in a transaction. In fact, I have traced the codes in OVM library and found that radix argument of ovm_set_attribute_by_name() is affected by the flag of ovm_field_int() AND OVM_RADIX.
Accoding my calculation, the value is always 0, which is equal to OVM_NORADIX.
So I guess that users can NOT control the radix of attribute in a transaction. If I am wrong, please let me know. Thanks!