Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Do you want to vary by simulator variable, by circuit voltage,
or what?
I suggest you look at whether veriloga is supported by your
HSPICE version and if so, scrounge for veriloga varactor code
you can modify to suit (or, find a varactor model you like and
just linearize or cal-map the C-V transfer function). If it's a
circuit driven variation you are looking for, and not just a
stepping of a variable.
Code dot - [expand] 1 2 3 4 5 6 7 *Title: Simple Verilog-A Resistor .hdl resistor.va .options post=1 X1 1 0 resistor r=1 VS 1 0 1 .dc VS 0 10 1 .end
Code dot - [expand] 1 2 3 4 5 6 7 8 9 // Simple resistor `include "disciplines.vams" module resistor(p,n); parameter R=1.0 from (0:inf); electrical p,n; analog I(p,n) <+ V(p,n)/R; endmodule
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 `include "constants.vams" `include "disciplines.vams" module vccap(Cp, Cn, Vp, Vn); input Vp, Vn; inout Cp, Cn; electrical Cp, Cn, Vp, Vn; real C; parameter real C0 = 0; parameter real CS = 1; analog begin C =c0+ CS * V(Vp,Vn); I(Cp,Cn) <+ C * ddt(V(Cp,Cn)); end endmodule