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
simple_expr is defined as an Spectre expression, which contains:
- Netlist parameters.
-
Current simulation time,
$time. -
Current frequency,
$freq. -
Node voltage,
v(a,b), whereaandbare nodes in the Spectre netlist, or node voltagev(a), which is the voltage between nodeaand ground. -
Branch currents,
i("inst_id:index"), whereinst_idis an instance name given in the netlist and index is the port index that starts from 1. The default value of index is 1.
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
Clipping Parameters
Noise Parameters
DC Mismatch Parameters
Other Parameters
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:
|
|
|
Mathematical Definitions
-
i = ddt(q) = ddt(simple_expr) -
v = ddt(phi) = ddt(simple_expr) -
v = i * r = i* simple_expr -
i = g * v = simple_expr * v -
i = c * ddt(v) = simple_expr * ddt(v) -
v = l * ddt(i) = simple_expr * ddt(i)
Operating Point Parameters
Capacitor
Conductor
Current Source
Inductor
Charge
Resistor
Voltage Source
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.
name ( node1 node2 ) model_name behav_param=freq_expression
-
nameis the name of the instance -
model_namecan be bsource, resistor, capacitor, and inductor -
behav_paramis the r, c or l parameter. -
freq_expressioncan be specified by arbitrary expressions using the$freqkeyword.
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.
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
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
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))
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
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