The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 4:06pm
Pages: 1
Send Topic Print
How to use bsource in spectre? (Read 16798 times)
microant
Junior Member
**
Offline



Posts: 16
China,SH
How to use bsource in spectre?
Aug 24th, 2008, 8:28pm
 
Hi all,
I want to use behavior model in cadence spectre, I found the help said that it can use bsource to achieve. well, I didn't find any instance in analogLib library can set the bsource attribute, would anyone can give me some suggestion?
thanks!

BR,
microant
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: How to use bsource in spectre?
Reply #1 - Aug 24th, 2008, 10:42pm
 
Never use the bsource. Learn and use Verilog-A. It will serve you much better in the long run.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
achim.graupner
Community Member
***
Offline



Posts: 51

Re: How to use bsource in spectre?
Reply #2 - Aug 25th, 2008, 1:05am
 
Hi there,

1. Ken is right.
2. for the quick hack in schematic in analogLib you have  {voltage; current} controlled {voltage; current} source: vcvs, ccvs, cccs, vccs. Do not try to model much more that a simple buffer - the schematic gets weired quickly soon.
Back to top
 
 

Achim Graupner
ZMD AG, Dresden, Silicon Saxony, Germany
View Profile   IP Logged
microant
Junior Member
**
Offline



Posts: 16
China,SH
Re: How to use bsource in spectre?
Reply #3 - Aug 25th, 2008, 4:51am
 
thanks for above!
But how to realize the following function in spectre such as in hspice?
E1 a b vol=v(n1,n2)*k max=cc min=0
Verilog-A is so strong while if the expression quote many voltage or current it need many input/output port.

BR,
microant
Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: How to use bsource in spectre?
Reply #4 - Aug 25th, 2008, 5:40am
 
microant wrote on Aug 24th, 2008, 8:28pm:
I want to use behavior model in cadence spectre, I found the help said that it can use bsource to achieve. well, I didn't find any instance in analogLib library can set the bsource attribute

Many simulators except for Cadence Spectre had enhanced controlled sources which were familiar in HSPICE or PSPICE.
Also many model files provided from foundary are written in HSPICE netlist.
So "bsource" was introduced into Cadence Spectre for porting HSPICE model file which includes enhanced controlled sources.

So Cadence doesn't provide spectre view of bsource.
But you can use bsource in netlist.
See the result of "spectre -h bsource".

Actually any bsources are replaced to Verilog-A internally in Cadence Spectre.

microant wrote on Aug 25th, 2008, 4:51am:
But how to realize the following function in spectre such as in hspice?
E1 a b vol=v(n1,n2)*k max=cc min=0
Verilog-A is so strong while if the expression quote many voltage or current it need many input/output port.

See http://www.designers-guide.org/Forum/YaBB.pl?num=1188726802/0
Back to top
 
« Last Edit: Aug 25th, 2008, 7:50pm by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   IP Logged
microant
Junior Member
**
Offline



Posts: 16
China,SH
Re: How to use bsource in spectre?
Reply #5 - Aug 25th, 2008, 7:19pm
 
Hi pancho_hideboo
thanks for your suggestion!
I find a alternative method to use bsource in spectre not by modifying the netlist.
copy instance 'vdc' from analogLib and modify the CDF parameter.
in simulation information, modify the item 'componetName' with bsource, in component parameters, add new param 'v', 'max_val' et, delete other params.
when use bsource, just like add voltage source and fill the expression in param 'v' and when generate netlist, it will be
v1 net1 net2 bsource v=express

BR,
Lin
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: How to use bsource in spectre?
Reply #6 - Aug 28th, 2008, 7:33am
 
I recommend that you start with this ...
Code:
`include "disciplines.vams"
module clamp (pout, nout, pin, nin);
output pout, nout;
input pin, nin;
electrical pout, nout, pin, nin;
parameter real gain=1;
parameter real minimum=0;
parameter real maximum = 1 from (minimum:inf);
real in;

analog begin
    in = V(pin, nin);
    if (in > maximum) in = maximum;
    if (in < minimum) in = minimum;
    V(pout,nout) <+ gain*in;
end
endmodule 

Back to top
 
 
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: How to use bsource in spectre?
Reply #7 - Aug 28th, 2008, 1:32pm
 
Ken -
Shouldn't you do
   out = gain * V(pin, nin);
   if (out > maximum) out = maximum;
   if (out < minimum) out = minimum;
   V(pout,nout) <+ out;
?
Not that either one is good for convergence, but I don't quite know what your maximum was doing.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: How to use bsource in spectre?
Reply #8 - Aug 29th, 2008, 3:58am
 
Geoffrey,
   Indeed, the model should be ...
Code:
`include "disciplines.vams"
module clamp (pout, nout, pin, nin);
output pout, nout;
input pin, nin;
electrical pout, nout, pin, nin;
parameter real gain=1;
parameter real minimum=0;
parameter real maximum = 1 from (minimum:inf);
real out;

analog begin
    out = gain*V(pin, nin);
    if (out > maximum) out = maximum;
    if (out < minimum) out = minimum;
    V(pout,nout) <+ out;
end
endmodule 


Why do you think convergence will be a problem?
-Ken
Back to top
 
 
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: How to use bsource in spectre?
Reply #9 - Aug 29th, 2008, 7:05am
 
Ken Kundert wrote on Aug 29th, 2008, 3:58am:
Why do you think convergence will be a problem?


I was thinking that, when it's clamping, there is no derivative information, so the linear solver wouldn't "know" to change the input voltage to fix the output.  I suppose, though, that it looks like an independent voltage source in that case, so it isn't a problem.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
imd1
Junior Member
**
Offline



Posts: 27

Re: How to use bsource in spectre?
Reply #10 - Sep 1st, 2008, 1:11am
 
How about the discontinuous jump in the derivative when the hard limiter kicks in ?

i mean, the solver is doing its N-R iterations and using the derivative to "slide towards" the circuit solution at the node. If the solution is just below the hard limit breakpoint and the current estimate is above that level, there's no gradient information to point in which direction to go.

I assume that a smoothing function would be useful . Comments?
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: How to use bsource in spectre?
Reply #11 - Sep 1st, 2008, 6:53pm
 
A common misconception.
Back to top
 
 
View Profile WWW   IP Logged
imd1
Junior Member
**
Offline



Posts: 27

Re: How to use bsource in spectre?
Reply #12 - Sep 2nd, 2008, 1:17am
 
Ken Kundert wrote on Sep 1st, 2008, 6:53pm:
A common misconception.


I see.

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.