The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> bsource instantiation in Spectre
https://designers-guide.org/forum/YaBB.pl?num=1242405400

Message started by Kalimero on May 15th, 2009, 9:36am

Title: bsource instantiation in Spectre
Post by Kalimero on May 15th, 2009, 9:36am

I am at the end of my wits. After almost 30+ hours of messing around with this I’ve given up so I’m here to ask for help. I am using Spectre simulator on Cadence IC5141 and I want to include several behavioral components (Voltage source, Current Source, Resistor, Capacitor) in my design.

Implementation constraints:
1)      Avoid using Verilog A modules
2)      Avoid direct modification of netlist if at all possible

There was a post on Cadence community forum where someone had solved this problem by creating a bsource that could be instantiated in a schematic – the CDF parameter (v, I, r or c) could then be set to any value or expression, including “simple v(path.to.internal.net)”.
In an attempt to follow suit, I created a symbol (Spectre view) for a behavioral resistor subckt that I have pasted below..

Subckt b_r (PLUS MINUS)
Parameter r = 10
R1(PLUS MINUS) bsource r=r
Ends b_r


I have followed all the correct steps in creating a symbol for this subckt as outlined by Andrew Beckett in a previous post.
The instance of the  b_r subckt that I include in my schematics netlists as

I1 (vdd! net019) b_r r = <my expression>

the expression which i enter directly on the instance (object property)

However if the expression is a function of a net voltage such as:

r = v(19,0)*1000

It is mis-evaluated, for any and every net on my schematics. The voltage that the probe v(n1, n2) reads is some infinitely small number ( ..E-317 ). I am thinking it is the number stated Under element info, instance name, bs_par_0 (behavioral source Parameter 0 ?? maybe) .. in the result browser. I know IC 5141 version supports bsource, and I know that bsource can use voltage probe v(n1, n2) .. but it is not working for me .. any suggestions is greatly appreciated.

Title: Re: bsource instantiation in Spectre
Post by Kalimero on May 17th, 2009, 12:59pm

In a nut shell, my question is: what setting must be specified in order to use a voltage probe statement such as v(n1,n2) in a bsource parameter expression. for example, consider the netlist statement ...

R6 (vdd! net019) bsource r=v(26)*1000

is this statement enough to render component R6 a behavioral resistor whose resistance is a function of the voltage on net26 ??

It seems not to be because when i use it the v(X) statement consistently evaluates to zero.

I am using Virtuoso schematic editor spectre simulator IC5141 .. In the Spectre.out log file i see statements such as

Installed compiled interface for bsource_2
opening directory input.ahdlSimDB/bsource_1.input.ahdlcmi


Circuit inventory
              bsource_1 2
              bsource_2 1


so it seems that the bsource statement is being evaluated as a behavioral component but my probe statements are being ignored. Is there some setting that I am neglecting to specify before I use probe statement in component parameter expressions ... ?? Any suggestion would be helpful, Thank you .

Title: Re: bsource instantiation in Spectre
Post by Geoffrey_Coram on May 18th, 2009, 8:18am

I don't think you can pass an expression as a parameter -- probably the simulator is evaluating v(26)*1000 during initialization, and then your subckt gets a fixed value during simulation.  Can you do this:

.Subckt b_r (PLUS MINUS CTRL)
Parameter r = 10
R1(PLUS MINUS) bsource r=r*V(CTRL)
Ends b_r


Title: Re: bsource instantiation in Spectre
Post by Kalimero on May 18th, 2009, 10:07am

Thanks a lot for your response - The thing is, that was the whole point of using bsource, because looking around this forum I have ran into multiple post where a voltage probe such as v(n1,n2) has been used in an expression passed onto a bsource parameter (r, c, i, v).

I know I cant use variable-containing expressions directly in a CDF Parameter. Such components need to be coded in Verilog A. However according to Andrew B, "bsource" was introduced into Cadence Spectre IC5033 and this enables the direct passing of simple expression (that may be a function a node signal) to parameters of components defined as a "bsource".

I am using IC5141 release which has "bsource" capability .. so it must be that I am not using it properly , I think ....  Or am I wrong in thinking that an expression (that is a function of a simulation signal) can be passed to a component parameter in general, "bsource" or not ...?

Title: Re: bsource instantiation in Spectre
Post by Kalimero on May 18th, 2009, 10:11am

Oh wait, for some reason your suggestion on the subckt modification had skipped my notice initially, I just saw it !!!, I will try it right away - Thanks.

Title: Re: bsource instantiation in Spectre
Post by Kalimero on May 18th, 2009, 12:05pm

Wow ... Had almost given up on this .. i think it is working now . That is very exciting as I was completely stuck and unwilling to move past it, so now i can finally move on with my life .. Thanks*1M

Here is what I did .. following up on Geoffrey suggestion I changed the Subckt code as such

subckt b_r (PLUS MINUS CTRL)
Parameter r = 10
R1(PLUS MINUS) bsource r=r*v(CTRL)
ends b_r

If I use V(CTRL) I get an error during hierarchy flattening :"instance name.R1: parameter 'bs_par_1': Unknown parameter name 'CTRL' found in expression

I suppose bs_par_1 is short for behavioral source parameter 1

However if i use v(CTRL) which is the voltage probe notation the CTRL parameter is recognized and I get no error.

Then I have to add the new node, from the modified subckt code, (namely the 'CTRL') to the termOrder in CDF Simulation Information of my subcircuit symbol. termOrder: PLUS MINUS CTRL

Furthermore I have modify the subcircuit symbol itself by adding an extra port to it - Port Object Properties: Name=CTRL Direction=inputOutput  (I'm sure Direction=Input will also work)

Finally I have to connect the extra port that is now appearing on my b_r symbol component(sticking out of the side of the rectangular symbol shape) in my schematic to the node on which CDF parameter value depends on.

For example:
for my behavioral resistor I want  : r = 1K*v(26)

right click on the subcircuit symbol (b_r, as named above) and enter 1K for the CDF parameter r. Then connect the CTRL port of the symbol to net026 and simulate. Apparently there is no need to add the vprobe notation in the CDF parameter field as it is added in the subckt bsource statement : R1 bsource r = r*v(CTRL). In the CDF parameter field just add the r value which should be a constant part of the expression.  

some of the steps might be redundant but, judging by a cursory observation of the results I think it works.

I am very grateful for your guidance on this Geoffrey.

Title: Re: bsource instantiation in Spectre
Post by Geoffrey_Coram on May 19th, 2009, 5:02am

Glad to be of help.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.