How to create random dynamic 2D arrays in SystemVerilog?
问题 I know how to create a random dynamic array in SystemVerilog: class packet; rand int unsigned len; rand byte data[]; constraint size_con { len < 2000; data.size = len; } endclass: packet but I can't figure out how to use random 2d dynamic array? 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