Hi all,
Quick question on using std::randomize.
module randomize (
);
// variables given
bit [31:0] address;
initial begin
std::randomize(address) with {address[6:0] == 7'b0000000;
address[31:25] == 7'b0;
address[14:12] == 3'b111;
};
$display("Address: %0b", address);
$finish;
end
endmodule
I’m trying to constraint the following using std::randomize
- First 7 bits of the 32-bit address to be all 0’s
- the last 7 bits of the 32-bit address to be all 0’s
- bits 12 to 14 to be 111 in the 32-bit address
But I managed to get the all but the last 7 bits of the 32-bit address to be all 0’s. It works on everything except setting all to 0’s.
Is there something that I did wrong?
This was the result right after I ran my simulation on VCS
Sangwoo