Product Documentation
Spectre Circuit Simulator Reference
Product Version 23.1, September 2023

Behavioral Source Use Model (bsource)

Description

Behavioral source enables you to model a resistor, inductor, capacitor, voltage or current source as a behavioral component. Using bsource, you can express the value of a resistance, capacitance, voltage or current as a combination of node voltages, branch currents, time expression, and built-in Spectre expressions.

The syntax for bsource is as follows:

name (node1 node2) bsource behav_param param_list 

where behav_param can be:

c=simple_expr,

capacitance between the nodes

g=simple_expr,

conductance between the nodes

i=generic_expr,

current through bsource

l=simple_expr,

inductance between the nodes

phi=simple_expr,

flux in the bsource device

q=simple_expr,

charge in bsource device

r=simple_expr,

resistance between the nodes

v=generic_expr,

voltage across the nodes

simple_expr is defined as an Spectre expression, which contains:

generic_expr is defined as a simple_expr or ddt() or idt() of simple_expr.

param_list is param_name=value.

param_name can have the multiplicity factor m. The value of m defaults to 1.

Temperature Parameters

tc1

Linear temperature co-efficient. Valid for all behavioral elements. Default value is 0 1/C.

tc2

Quadratic temperature co-efficient. Valid for all behavioral elements. Default value is 0 C^-2.

temp

Parameter for ambient temperature. Valid for all behavioral elements. Default value is $temperature - 273.15.

tnom

Parameters measurement temperature. Valid for all behavioral elements. Default value is 27.0.

trise

Temperature rise for ambient. Valid for all behavioral elements. Default value is 0.0.

T

Effective value of temperature. Valid for all behavioral elements. Default value is temp+trise-tnom.

tc1c

Linear temperature coefficient of capacitor. Valid for resistor type behavioral element. Default value is 0 1/C.

tc2c

Quadratic temperature coefficient of capacitor. Valid for resistor type behavioral element. Default value is 0 C^-2.

Clipping Parameters

max_val

Maximum value of bsource expression. Valid for all behavioral elements, but used with i and v elements to clip the current or voltage between the specified values.

min_val

Minimum value of bsource expression. Valid for all behavioral elements, but used with i and v elements to clip the current or voltage between the specified values.

bv_max

Generate a warning when bsource voltage of two terminals exceeds the value specified by bv_max. Valid for resistor and capacitor.

Noise Parameters

af

Flicker noise exponent. Valid for r and g elements. Default value is 2.

fexp

Flicker noise frequency exponent. Valid for r, g, v, and i elements. Default value is 1.

ef

The alias parameter of fexp.

ldexp

Flicker (1/f) noise L exponent. Valid for r and g elements. Default value is 1.0.

lf

The alias parameter of ldexp.

wdexp

Flicker (1/f) noise W exponent. Valid for r  and g elements. Default value is 1.0.

wf

The alias parameter of wdexp.

isnoisy

Specifies whether to generate noise. Valid for r, g, i, and v elements. Valid values are yes and no. Default value is yes.

kf

Flicker noise co-efficient. Valid for r and g elements. Default value is 0.

white_noise

White noise expression. Valid for v and i elements.

flicker_noise

Flicker noise expression. Valid for v and i elements.

DC Mismatch Parameters

mr

DC-Mismatch parameter. Valid only for r.

Other Parameters

scale, scaleb, scaler, scalei, scalec

Bsource scaling factor. Default value is 1.0.

ctype

Different implementations of a capacitor. When the value is 1, bsource current is ddt(cap*V(node1, node2)), where cap is the bsource capacitor value with temp effect, mfactor effect, scale effect and so on. V(node1, node2) is the voltage between the bsource terminals. When the value is 2, the current is ddt(cap). When the value is 0 or any other value, the current value is cap*ddt(V(node1, node2)). Default value is 0.

For the detailed algorithm, refer to "Affirma Spectre DC Device Matching Analysis Tutorial."

All the parameters in the param_name table are instance parameters. white_noise and flicker_noise may be assigned behavioral expressions; the other parameters must be assigned constant or parametric expressions.

Supported Instance Parameters

bsource supports the following instance parameters for Spectre primitives:

Resistor  

isnoisy, m, r, tc1, tc2, trise, kf, af, fexp, ldexp, wdexp, l, w, mr

Capacitor  

c, m, tc1, tc2, trise, ic, ctype

Inductor  

l, m, tc1, tc2, trise

Mathematical Definitions

Operating Point Parameters

Capacitor

cap (F)

Capacitance at operating point

Conductor

g (S)

Conductance at operating point

v (V)

Voltage at operating point

i (A)

Current through the conductor

pwr (W)

Power dissipation.

Current Source

v (V)

Voltage across the source

i (A)

Current through the source

pwr (W)

Power dissipation

Inductor

ind (H)

Inductance at operating point

i (A)

Current at operating point

Charge

cap (F)

Capacitance at operating point

ddt_v (V/s)

Voltage gradient at operating point

Resistor

v (V)

Voltage at operating point

i (A)

Current through the resistor

res (Ohm)

Resistance at operating point

pwr (W)

Power dissipation

Voltage Source

v (V)

Voltage across the source

i (A)

Current through the source

pwr (W)

Power dissipation

Temperature Effects on bsource

The equation for computing temperature factor is as follows:

tempFactor = [1 + tc1*(temp+trise-tnom)+tc2*(temp+trise-tnom)^2]

Frequency Effects on bsource

The support for frequency-dependent bsource is available. You can use a frequency-dependent resistor, capacitor, inductor, or bsource component in ac/noise/xf/sp/hb/hbac/hbnoise analyses.

The syntax is as follows:

name ( node1 node2 ) model_name behav_param=freq_expression

where:

Following are some examples using $freq:

res (n1 n2) bsource r= 100 + sqrt($freq)/1e6
res (n1 n2) resistor  r= 100 + sqrt($freq)/1e6
cap (n1 n2) bsource c=1e-12/(1+($freq)/1e9)
cap (n1 n2) capacitor c=1e-12/(1+($freq)/1e9)
ind (n1 n2) bsource l=1e-9+1e-9/(1+($freq)/1e9)
ind (n1 n2) inductor l=1e-9+1e-9/(1+($freq)/1e9)

Examples of bsource Usage

Non-linear resistor/capacitor/inductor modeling

Frequency-dependent resistor component

res1  (n1 n2)  bsource r=100*(1+(1/2)*v(n1,n2)) 
res2  (n1 n2)  resistor r=100*(1+(1/2)*v(n1,n2)) 

In this example, the resistance of res1 is frequency-dependent. Therefore, if you run hb and hbnoise analyses for different frequencies, the resistance varies accordingly.

Frequency-dependent capacitor component

C1  (1  0) capacitor c=1e-12/(1+($freq)/1e9)
V1 (1 0 ) vsource type=sine freq=1G  fundname="freq" 
ac ac start=1 stop=100M 
hb hb tstab=0n funds=["freq"] maxharms=[5] errpreset=conservative 
hbac hbac start=1 stop=1G dec=3

In this example, the capacitance of C1 is frequency-dependent. Therefore, if you run hb and hbnoise analyses for different frequencies, the capacitance varies accordingly.

Frequency-dependent inductor component

L1  (1  0) inductor l=1e-9+1e-9/(1+($freq)/1e9) 
V1 (1 0 ) vsource type=sine freq=1G  fundname="freq"  
ac ac start=1 stop=100M 
hb hb tstab=0n funds=["freq"] maxharms=[5] errpreset=conservative 

In this example, the inductance of L1 is frequency-dependent. Therefore, if you run hb analysis for different frequencies, the inductance varies accordingly.

Charge model for capacitor

cap  (n1 n2) bsource q=1.0e-6*v(n1,n2) 

Voltage and current (Sinewave) source

vsrc (n1 n2) bsource v=10.0*sin(2*pi*freq*$time) 
isrc (n1 n2) bsource i=1.0e-3*sin(2*pi*freq*$time) 

Current-controlled current source

vsrc (n1 n2) vsource v=10 
cccs1 (n3 n4) bsource i=gain*i("vsrc:1") 

Current-controlled voltage source

vsrc (n1 n2) vsource v=10
ccvs1 (n3 n4) bsource v=100*i("vsrc:1") 

Voltage-controlled voltage source

vsrc (n1 n2) resistor r=100k 
vcvs1 (n3 n4) bsource v=gain*v(n1,n2)

Voltage-controlled current source

vsrc (n1 n2) resistor r=100k 
vccs1 (n3 n4) bsource i=v(n1,n2)/2000.0 

Restricting voltage limit

res (n1 n2) bsource r=100*(1+(1/2)*v(n1,n2)) max_val=105 min_val=95 

Using temperature coefficient for resistor

res (n1 n2) bsource r=100  tc1=0.01 tc2=0.003 trise=10 tnom=30

Using DC mismatch parameter for resistor

res (n1 n2) bsource r=100  mr=0.3

Using model card

model model_card_res resistor tc1=0.1 tc2=0.1
res (n1 n2) model_card_res r=100*(1+(1/2)*v(n1,n2))

Sample netlist with bsource

vsrc1 (n1 n2) bsource v=10*sin(2*pi*freq1*$time)
vsrc2 (n3 n4) bsource v=10*cos(2*pi*freq2*$time)
cccs1 (n5 n6) bsource i=gain*i("vsrc1:1")
res   (n5 n6) bsource r=100*(1+(1/2)*v(n5,n6))
        
tran1 tran stop=1u
        
altAnal altergroup {
 cccs1 (n5 n6) bsource i=gain*i("vsrc2:1")
 res   (n5 n6) bsource r=100*(1+(1/3)*pow(v(n5,n6),2))
}
tran2 tran stop=1u
With standard (simple) syntax for resistor/capacitor/inductor, the bsource keyword is not required in the statement. However, if the keyword is specified, Spectre treats the resistor/capacitor/inductor as a behavioral source.

bsource Compilation

Spectre automatically translates bsource components into verilogA models for simulation. As such, they are compiled prior to simulation just like any other verilogA model.


Return to top
 ⠀
X