A number of functions are classed as analog operators. These functions store state information. That is, their return value depends on previous history and not just on the current value of its arguments. Because of this, analog operators are subject to some restrictions on where they may be used. These restrictions are as follows:
if (V(n1)>0) I(out) <+ ddt(cap*V(out)) ;In the above V(n1)>0 could change in a transient analysis if the voltage on node n1 rises above or below zero. This means that ddt would only get executed some of the time and so its state history would not always be correct. The following is permitted
paramter integer enable_cap = 0 ; ... if (enable_cap) I(out) <+ ddt(cap*V(out)) ;this is OK because enable_cap is a parameter and will have a fixed value during the course of a transient analysis. So either ddt will always be executed or it will never be executed. Both scenarios will work correctly.
Analog operators are permitted in analog for loops. These are for loops controlled by a genvar controlling variable. This is explained in Analog For Loops and genvars.
◄ Verilog-A Functions | Overview ▶ |