10. Apparatus for modeling multiple instances of an electronic circuit, comprising: a computer configured to define a program using an imperative programming language; wherein said program includes multiple calls to a function, said function having a persistent variable associated with an internal state of said electronic circuit; wherein said function is configured to initialize said persistent variable based on at least one call path to said function in said program and to maintain a first lookup table and a second lookup table; wherein said first lookup table includes values of said persistent variable respectively associated with keys, each of said keys being defined by a call path to said function in said program and a name of said persistent variable; wherein said second lookup table includes a last call path value associated with a key, said last call path variable being indicative of a last call path to said function in said program, said key being defined by said name of said persistent variable and a name of said function; and wherein said function is further configured to, for each of said multiple calls: access said second lookup table to obtain said last call path value; store a current value of said persistent variable in said first lookup table using a current key defined by said last call path value and said name of said persistent variable; and update said last call path value in said second lookup table to refer to a current call path to said function in said program.
10. Apparatus for modeling multiple instances of an electronic circuit, comprising: a computer configured to define a program using an imperative programming language; wherein said program includes multiple calls to a function, said function having a persistent variable associated with an internal state of said electronic circuit; wherein said function is configured to initialize said persistent variable based on at least one call path to said function in said program and to maintain a first lookup table and a second lookup table; wherein said first lookup table includes values of said persistent variable respectively associated with keys, each of said keys being defined by a call path to said function in said program and a name of said persistent variable; wherein said second lookup table includes a last call path value associated with a key, said last call path variable being indicative of a last call path to said function in said program, said key being defined by said name of said persistent variable and a name of said function; and wherein said function is further configured to, for each of said multiple calls: access said second lookup table to obtain said last call path value; store a current value of said persistent variable in said first lookup table using a current key defined by said last call path value and said name of said persistent variable; and update said last call path value in said second lookup table to refer to a current call path to said function in said program. 11. The apparatus of claim 10 , wherein said function is further configured to, for each of said multiple calls: form a new key from said current call path and said name of said persistent variable; determine whether said new key is associated with one of said values in said first lookup table; and if said new key is not associated with any of said values in said first lookup table, store an initial value in said first lookup table using said new key.