Hi All,
I am trying to use randcase to display all values of logic randomly.
But not able to get Z (high impedence) value.
May I know how to get z, means, for what operation we will get an output of Z?
===============================
program p1;
class parent;
rand logic payload;
function void post_randomize();
randcase
1: begin
payload = payload & 1;
end
1: begin
payload = !payload & 1;
end
1: begin
payload = payload & 'hx;
end
1: begin
payload = payload & 'hz;
end
endcase
$display("logic %0d",payload);
endfunction
endclass
parent c1;
initial begin
c1 = new;
repeat (6) begin
c1.randomize();
end
end
endprogram
output
xcelium> run
logic 1
logic x
logic 0
logic 0
logic 0
logic 0