我找不到可以在我的测试平台中使用的uvm_field_ *宏。我定义了一个结构:
typedef struct {
unsigned byte red;
unsigned byte green;
unsigned byte blue;
} pixel;
现在,在我的序列项目中,我声明:
rand pixel unsigned data[];
rand int unsigned height;
rand int unsigned width;
`uvm_object_utils_begin(cgs_rgb_trans_t)
`uvm_field_int(height, UVM_ALL_ON)
`uvm_field_int(width, UVM_ALL_ON)
`uvm_field_array_pixel(data, UVM_ALL_ON)
`uvm_object_utils_end
我怀疑这会奏效。我可以将它注册为`uvm_field_array_int吗?这样做的方法是什么?
答案 0 :(得分:2)
我们Mentor不建议使用现场自动化宏,因为这些限制,自动配置哪些情况的混淆,以及它们带来的严重性能损失。此外,所谓的UVM 整数在内部表示为4K位向量,浪费了大量内存。有关更多信息和替代方案,请参阅this article。
答案 1 :(得分:1)
你总是可以使用'uvm_field_array_int
和一对pack / unpack函数将像素信息转换为int(你仍然可以使用int的一个字节),反之亦然。您的序列将具有一个int数组,而不是一个像素数组,然后您可以在驱动程序和监视器中从/转换。