STATIC and AUTOMATIC Lifetime:
Static: For a variable static lifetime is, its memory never de-allocated until simulation ends. Automatic: For a variable Automatic lifetime is, it is stack storage of variable (for multiple entries to a task, function, or block, it will have stack storage) and its memory will be de-allocated once execution of that method or block is…