Verification Haven
135 subscribers
4 links
Download Telegram
Channel created
Channel photo updated
How many lines does one need to break VCS? Not much.


module tb;
logic a = 0;
logic b = 0;
logic bb = 0;
logic [1:0] c;

function automatic logic foo(logic x, logic y);
return x && y;
endfunction

always_comb begin
c = 0;
unique0 if (a) begin
c = 1;
end else if (foo(b, bb)) begin
c = 2;
end else begin
c = 3;
end
end

initial begin
#1;
a <= 1;
b <= 0;
bb <= 0;
#1;
a <= 0;
b <= 1;
bb <= 1;
#1;
end

initial begin
$monitor("%t : %b %b %b %0d", $time(), a, b, bb, c);
end

endmodule

Output:

0 : 0 0 0 0
1 : 1 0 0 1
2 : 0 1 1 0
🔥1😁1
Welcome to the latest entry in my blog: Unhinged assignment. This post takes you on a journey that begins with the fundamentals of non-blocking assignments and gradually immerses you in the horrific fascinating world of indeterminism and delta-cycle shenanigans.
🔥1