CODE:
class mem; rand int a[10]; rand int b[10]; constraint c_a_b { unique { b }; foreach ( a[i] ) { b[i] inside {[1:20]}; a[i] inside {[1:20]}; !(a[i] inside b); } } function void post_randomize(); $display ("A:%p",a); $display ("B:%p",b); endfunction: post_randomize endclass: mem module top; mem m; initial begin m = new; void'(m.randomize()); end endmodule: top
OUTPUT:
Compiler version U-2023.03-SP2_Full64; Runtime version U-2023.03-SP2_Full64; Aug 12 11:01 2025
A:'{4, 5, 17, 19, 8, 4, 5, 12, 9, 15}
B:'{18, 16, 3, 20, 1, 11, 7, 2, 10, 14}
V C S S i m u l a t i o n R e p o r t
No comments:
Post a Comment