如何打印uvm_field_sarray_int?

遇到的问题:

In a transaction class, I have a static size array, and I registered it to UVM factory using "uvm_field_sarray_int".

在transaction class中,有一个固定大小的array,并且用uvm_field_sarray_int 宏注册了这个array。

The size of this array is 44.

array大小为44;
Now when I am trying to print this transaction class, either using transaction_class.print(), or using sprintf(), other members are getting print but for this array, it prints the first 5 entries and truncates the remaining. Is there anything UVM/SV specific that I am not using, which is making the printout to be truncated version? When I do a specific foreach loop to print all the contents of this array, I do see item getting printed.

当尝试使用transaction_class.print()或者sprintf()打印transaction内容时,输出的结果如下图所示,是截断的,只有前后的部分输出,如何将其全部打印输出呢? 难道要用for loop??
[0] integral 1 'h0
[1] integral 1 'h1
[2] integral 1 'h0
[3] integral 1 'h1
[4] integral 1 'h0
... ... ... ...
[39] integral 1 'h0
[40] integral 1 'h0
[41] integral 1 'h0
[42] integral 1 'h0
[43] integral 1 'h0

结论:

The field macros have significant limitations when printing different data types/arrays.

field宏打印输出时是有些限制的。

It is highly recommended to not use the field macros and instead implement the required transaction methods so you have control over how your transaction is displayed.

可以定义一个专门用于输出的函数。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值