I am trying to implement Capacitor and Inductor models in Verilog.
These models have Voltage and Current equations which involve time derivative dI/dt and dV/dt.
In Verilog AMS, we have a built-in function ddt().
But How do I implement these time derivative functions in Verilog ?
If f(t) changes linearly and time points are also linear (they are evenly spaced ) then, output df/dt will be a constant.
Even though the input is changing linearly with time, output remains constant.
Am I missing anything here ? How to solve this situation ?
How to solve what? You are describing an elementary property of derivative.
By the way, you are dealing with finite numerical quantities. So f(t) can't endlessly increase, it has to decrease at times and df/dt won't always stay constant.