I want to write a VerilogA model which monitors input current and prints a message if it is above certain level. I also want output to be same as input current.
I wrote a model and it works but throws out below error when I add a line for output current to be equal to input. Any suggestions what I'm doing wrong here?
[code]`include "constants.vams"`include "disciplines.vams"
input Iin;output Iout;electrical Iin,Iout;
real Ivalue;parameter real IT2Limit=1m;
if (Ivalue>=IT2Limit) $strobe("WARNING:Value of current at node Iin has exceeded %g at %m, Iin=%g at simulation time t=%e",IT2Limit,Ivalue,$abstime); else $strobe("Current at node Iin=%g, simulation time=%e",Ivalue,$abstime);end
Here is the error message:
ERROR (SPECTRE-16384): Signal V(Iout) = -732.434 GV exceeds the blowup limit for the quantity `V' which is (1 GV). It is likely that the circuit is unstable. If you really want signals this large, set the `blowup' parameter of this quantity to a larger value.
You might want to modify the current contribution statement to (note the '-' sign):
I(Iout) <+ -I(Iin);
If the current flowing into the model/block is assumed positive, then the current flowing out should be negative i.e.have inverse polarity. So, this could be one of the reasons why your circuit is struggling to converge.
Thanks Saloni for your suggestion.
I tried that but now I have the same error with opposite polarity on output voltage blow up limit as shown below:
ERROR (SPECTRE-16384): Signal V(Iout) = 732.434 GV exceeds the blowup limit for the quantity `V' which is (1 GV). It is likely that the circuit is unstable. If you really want signals this large, set the `blowup' parameter of this quantity to a larger value.
I tried to model output voltage but it won't let me. Any further suggestions?