The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 29th, 2024, 3:28am
Pages: 1
Send Topic Print
Proper modelling of a current source in verilogAMS. (Read 2122 times)
edstrom
New Member
*
Offline



Posts: 3

Proper modelling of a current source in verilogAMS.
Nov 28th, 2019, 3:29am
 
Hi,

I am struggling with modelling a current source in verilogAMS.
An ideal current source with a load would be

      I(vdd, ibias)      <+  20e-6;
for a current pin ibias.

The problem with convergence comes with this implementation when the pin ibias is unloaded. The simulator will drive that current without any load, resulting in a very large voltage, resulting in a zero diagonal unsolvable matrix.

What would be necessary, is to model the output impedance properly.
I have tried to short the output through a large resistor.

      V(ibias,vss) <+I(ibias,vss)*100e6;

But the above statement still drives the current to the output ibias, generating convergence issues.

What would be the proper way to model this?
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Proper modelling of a current source in verilogAMS.
Reply #1 - Nov 29th, 2019, 10:58am
 
You can add a resistive clamp:
Code:
I(vdd,ibias) <+ 20u;
if (V(vdd,ibias) < 0)
    I(vdd,ibias) <= V(vdd,ibias)/1k; 



Not sure that code is right. I am in an airport and cannot try it. Bascially, it is designed to add a 1k resistor connected to Vdd when ibias goes above Vdd.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
edstrom
New Member
*
Offline



Posts: 3

Re: Proper modelling of a current source in verilogAMS.
Reply #2 - Dec 2nd, 2019, 11:39pm
 
Thanks Ken,

I tried your code snippet with some minor syntax changes. And i still experience convergence issues in the node ibias.

I to me, it makes sense. Because i will still drive a current from supply to a floating node
Back to top
 
 
View Profile   IP Logged
Horror Vacui
Senior Member
****
Offline



Posts: 127
Dresden, Germany
Re: Proper modelling of a current source in verilogAMS.
Reply #3 - Jun 28th, 2021, 1:20am
 
I've made the current a linear function of the voltage below a voltage threshold. Basically it is a resistor below the threshold and a current source above that. The current source will therefore pull the node to simply towards ground. It also mimics the reduced output resistance of current sources at low output voltages.
I do not got the code at hand, but it is simple to implement.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.