TGViewer
Verification Haven Verification Haven @verificationhaven · 184 subscribers
Post #8 594
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
  • 🔥 2
  • 👍 1
  • 😁 1
More from @verificationhaven
  1. Aug 22, 2026Post #10
  2. Aug 10, 2025Welcome to the latest entry in my blog: Unhinged assignment. This post takes you on a jour…
  3. Dec 30, 2024The frequency of my posts is only slightly higher than the frequency of snowfalls in Barce…
  4. Jan 1, 2024A short and light reading about one particular bad UVM agent design practice and how to av…
  5. Jan 1, 2024Channel photo updated
  6. Jan 1, 2024A broadcast channel to announce new posts in my blog: https://publish.obsidian.md/zvord/We…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →