Switch Level
Switch Level
Switch Level
Gate
nmos(drain,source,gate);
Source
Drain
Switch Instantiation
Gate
pmos(drain,source,gate);
Source
Drain
Switch Instantiation
Gate
nmos(drain,source,gate);
Source
Drain
Switch Instantiation
pgate
Source
Drain
ngate
data1
data2
control
tranif0 (data1, data2, control);
tranif1 (data1, data2, control);
Switch Delay
You can assign delays to some switch types:
The unidirectional coms,nmos,and pmos switches can have rise,fall,and turn-off
delays
coms #(<delay>) (d, s, ng, pg);
nmos #(<rise_delay>,<fall_delay>) (d, s, g);
pmos #(<rise_delay>,<fall_delay>),<turnoff_delay>) (d, s, g);
The bidirectional switches tranif0 and tranif1 can have turn-on and turn-off
delays,but no source-drain channel delays
tranif0 #(<delay>) (d, s, g);
tranif1 #(<turnon_delay>,<turnoff_delay>) (d, s, g);
The pulldown,pullup,and tran gates cannot have delays
Level 7 6 5 4 3 2 1 0
Drive supply strong pull weak highz
Charge large medium small
Strength Reduction
The switches can reduce the strength of signals passing through them:
The cmos,nmos,pmos,tran,tranif0,and tranif1 primitives reduce a
supply strength signal to a strong signal
The rcmos,rnmos,rpmos,rtran,rtranif0,and rtranif1 primitives reduce
signal strength according to the following table:
7 supply 5 pull
6 strong 5 pull
5 pull 3 weak
4 large 2 medium
3 weak 2 medium
2 medium 1 small
1 small 1 small
0 highz 0 highz
Switch-Level Networks
Switch networks may contain unidirectional and bidirectional switches.
Verilog-XL partitions switch-level networks into channel-connected regions.
The Switch-XL Algorithm
Use the Switch-XL algorithm to:
Accelerate simulation of bidirectional switches
--- The XL algorithm does not accelerate bidirectional switches
Simulate up to 250 relative drive strengths on switches
Simulate up to 250 relative charge strengths on trireg nets
s1 2 Transistor
Strengths
1 1
s2 s3
Selecting the Switch-XL Algorithm
Use the +switchxl option to globally enable the Switch-XL algorithm.
verilog source.v +switchxl
Use the `switch compiler directive to selectively enable the Switch-XL algorithm.
`switch XL
// control networks here
`switch default
// datapath networks here
Use the Switch-XL algorithm:
---For a significantly sized network of bidirectional switches
---For a network of switches you cannot otherwise correctly functionally model with
only 2 switch drive strengths and 4 (including none)net charge strengths
Use the default algorithm:
---For a network of densely-packed significantly-sized regularly-structured
pass transistors
The Switch-XL Strength Model
The drive strength expression must evaluate to a number from 1 to 250.
These statements declare tran switches and assign relative drive strengths.
Switch t1 has the largest conductance relative to t0 and rt.
tranif1 strength(3) t1 (s0,d0,g0);
tranif0 strength(2) t0 (s1,d1,g1);
rtran strength(1) rt (s2,d2);
The charge strength expression must evaluate to a number from 0 to 250.
These statements declare trireg nets and assign relative charge strengths.
Net a has the largest capacitance relative to b,c and d.
trireg strength(25) a;
trireg strength(10) b;
trireg strength(5) c;
trireg strength(1) d;
Switch-XL Strength Reduction
The Switch-XL and default algorithms reduce signal strength differently:
The default algorithm:
--- Reduces signal strength by 0,1,or 2 levels for each switch instance
--- An rtran reduces a weak drive to a medium charge
The Switch-XL algorithm:
--- Treats all drive strengths as higher than charge strengths
--- Maps standard strengths into the range of network strengths
--- Reduces strength once (by the highest resistance) in the channel
pullup pulldown
pullup pulldown
vdd
y
a
n1
b
vss
nmos
nmos nmos