Systemverilog function synthesis - automatic vs static

1.6k Views Asked by At

In the context of combinatorial logic synthesis (not simulation): When should a function be declared as automatic ? When should a function be declared as static ?

1

There are 1 best solutions below

4
dave_59 On

A function should never be declared with a static lifetime. There is no case where a function would be automatic by default and need to be explicitly declared static. (and this would be illegal do in a class method anyways).

There are cases where a function must be declared with automatic lifetime so it cn be called recursively and the arguments won't be overwritten.

This is the part of the subject of my DVCon2021 paper "The Life of a SystemVerilog Variable".