-
Notifications
You must be signed in to change notification settings - Fork 1
/
g_current_veriloga.va
79 lines (60 loc) · 2.8 KB
/
g_current_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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// VerilogA for LLG, g_current_source, veriloga
`include "constants.vams"
`include "disciplines.vams"
module g_current_source(myy,mx,my,mz,sx,sy,sz,hx,hy,hz,sotx,soty,sotz);
input mx,my,mz,hx,hy,hz,sx,sy,sz,sotx,soty,sotz;
output myy;
ground gnd;
electrical mx,my,mz,hx,hy,hz,sx,sy,sz,myy,sotx,soty,sotz;
parameter real alpha = 0.005; //damping constant of the material
parameter real gamma = 17.32e10; // Gyro-magnetic ratio rad/(s.T)
parameter real u0 = 1.25663706e-6; //Permitivity of free space
parameter real Ms= 1.313e6 ;// in A\m
parameter real e = 1.602176487e-19 ; //electron charge in coulombs
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
// STT parameters
parameter real P = 0.33; // Polarization of STT ( fixed layer)
parameter real lambda = 0.38 ; // The angle dependent parameter of STT
parameter real beta = -0.1; // Ratio of FieldLikeTorque to DampingLikeTorque in STT (zero for only DLT)
// SHE AND RASHBA EFFECT PARAMETERS
parameter real thetash = 0.15; // Spin - Hall angle of Ta
parameter real area_fm = 3.14*50n*50n; // Area of the FM attached
parameter real tshe = 4n; // Thickness of the SHE layer
parameter real Wshe =200e-9; // Width of the SHE layer
parameter real beta2 = 1 ; // Ratio of FieldLikeTorque to DampingLikeTorque in SOT (zero for only DLT)
real X,s1x,s1y,s1z,m1x,m1y,m1z,h1x,h1y,h1z,p1,p2,Ns,sotx1,soty1,sotz1,p3 , L0_dlt ,L2_dlt , L0_flt ,L2_flt,p4,p5;
analog begin
Ns = (2*Ms*volume)/(gamma*hbar);
// STT currents (0 for only SOT)
s1x =V(sx) ;
s1y =V(sy) ;
s1z =V(sz);
// SOT currents (0 for only STT)
sotx1 = V(sotx,gnd);
soty1 = V(soty,gnd);
sotz1 = V(sotz,gnd);
// Calculated effective fields
h1x = V(hx,gnd) ;
h1y = V(hy,gnd) ;
h1z = V(hz,gnd) ;
// Magnetization projection in the x,y,z plane
m1x = V(mx,gnd) ;
m1y = V(my,gnd) ;
m1z = V(mz,gnd) ;
//STT coffecients of the LLG
p1 = P/(1+lambda*m1z);//STT coeffecient for DLT
p3 = (beta*(P))/(1+lambda*m1z);//STT coeffecient for FLT
// SOT coeffeicents of the LLG
p2 =(thetash*area)/(tshe*Wshe);// SOT coeffecient DLT
p5 = beta2*p2;
// Solution to the LLG equation for FLT and DLT included
I(myy,gnd) <+ ( -(p2*sotx1)*m1x*m1y + (p2*sotx1)*m1x*m1x*m1z*alpha + (p2*sotx1)*m1y*m1y*m1z*alpha + (p2*sotx1)*m1z*m1z*m1z*alpha -p1*s1z*m1y*m1z -p1*s1z*m1x*alpha -p3*s1z*m1x + p3*s1z*m1y*m1z*alpha );
I(myy,gnd) <+ (-h1z*m1x*Ns*e*gamma*u0 + h1x*m1z*Ns*e*gamma*u0 - h1y*m1x*m1x*Ns*e*alpha*gamma*u0 + h1x*m1x*m1y*Ns*e*alpha*gamma*u0 + h1z*m1y*m1z*Ns*e*alpha*gamma*u0 - h1y*m1z*m1z*Ns*e*alpha*gamma*u0);
I(myy,gnd) <+ -(- alpha*m1x*m1y*( p5*sotx1) - m1z*( p5*sotx1));//correction done in sign
end
endmodule