pascalkuthe / OpenVAF

An innovative Verilog-A compiler
https://openvaf.semimod.de/
GNU General Public License v3.0
123 stars 20 forks source link

Request for implementing $discontinuity #58

Open arpadbuermen opened 1 year ago

arpadbuermen commented 1 year ago

Hi,

Please support $disconitnuity. Much like $bound_step it should be simple to implement but would make it possible to correctly define signal sources with discontinuous derivatives in OpenVAF compiled models.

During instance evaluation all reached $discontinuity(n) statements should be recorded. The argument of $discontinuity should be an expression that evaluates to a non-negative integer. It can depend only on parameters and constants, not on quantities like voltages and currents computed by the simulator.

The instance data structure should have two additional information available:

1) was there a $disconitunity reached during last instance evaluation (true/false)? 2) what was the smallest value of the argument passed to reached $discontinuity statements during last instance evaluation.

Thanks, Arpad