-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcap_veriloga.va
33 lines (25 loc) · 858 Bytes
/
cap_veriloga.va
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// VerilogA code for capacitor - LLG
`include "constants.vams"
`include "disciplines.vams"
module cap(p,n,mx);
inout p,n,mx;
ground gnd;
electrical p,n,mx;
parameter real alpha = 0.005; //damping constant of the material
parameter real gamma = 17.32e10;//Gyro-magnetic ratio rad/(s.T)
parameter real Ms= 1.313e6 ;// in A\m
parameter real e = 1.602176487e-19 ; //electron charge in coloumbs
parameter real thickness = 2n ; //z-axis
parameter real length = 50n ;//x axis
parameter real width = 50n ; //yaxis
parameter real volume = 2n*50n*50n*3.14 ; //volume of Ferromagnet (free-layer)
parameter real pi = 3.14 ; // pi value
parameter real hbar = 1.0545716e-34; // Reduced Planck's constant
real C , cc ,Ns ;
analog begin
Ns = (2*Ms*volume)/(gamma*hbar);
C = Ns*e*(1+alpha*alpha);
cc = (1/C)*(I(p,n));
V(p,n) <+ idt(cc, V(mx,gnd));
end
endmodule