Quote:I need to locate the input voltage peaks and store them in an array. Since the input voltage waveform is arbitrary, the array size is also varying. Is there any way to implement such array?
No, not that I know of, not within Verilog-A. You could write the peaks to a file.
Quote:In addition, to find the peak, I am considering to use d/dt function. When the time derivative changes sign, the peak is found. But right at the peak (for a linear voltage waveform), the time derivative is not defined. I am not clear how that is handled in circuit simulation. Or do you have any other idea to find the peak?
Try it and see.
If you don't like the result, consider simply saving two points back and determine the peaks that way.
-Ken