Static vs Automatic Lifetime in SystemVerilog (With Side-by-Side Output)
In short: Lifetime decides how many copies of a variable exist. A static variable has one copy, created once and shared by every call; it remembers its value between calls. An automatic variable gets a fresh copy every time the task or function is called, and it disappears when the call ends. Tasks and functions…
