【发布时间】:2016-11-21 16:00:52
【问题描述】:
我知道如何在 SystemVerilog 中创建随机动态数组:
class packet;
rand int unsigned len;
rand byte data[];
constraint size_con {
len < 2000;
data.size = len;
}
endclass: packet
但我不知道如何使用随机二维动态数组?
class video_frame;
rand int unsigned width;
rand int unsigned height;
rand int unsigned data[][];
constraint size_con {
width >= 8;
width <= 4096;
height >= 8;
height >= 2048;
// How to constraint data.size to be [height, width]
}
endclass: video_frame;
【问题讨论】:
标签: system-verilog