-
Notifications
You must be signed in to change notification settings - Fork 2
/
rram.va
43 lines (34 loc) · 1.41 KB
/
rram.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
`include "disciplines.vams"
`include "constants.vams"
module RRAM(t, b, nGap);
inout t, b, nGap;
electrical t, b, nGap;
parameter real g0 = 0.25 from (0:inf);
parameter real V0 = 0.25 from (0:inf);
parameter real Vel0 = 10 from (0:inf);
parameter real I0 = 1e-3 from (0:inf);
parameter real Beta = 0.8 from (0:inf);
parameter real gamma0 = 16 from (0:inf);
parameter real Ea = 0.6 from (0:inf);
parameter real a0 = 0.25 from (0:inf);
parameter real tox = 12 from (0:inf);
parameter real maxGap = 1.7 from (0:inf);
parameter real minGap = 0.2 from (0:inf);
parameter real smoothing = 1e-8 from (0:inf);
parameter real GMIN = 1e-12 from (0:inf);
parameter real Kclip = 50 from (0:inf);
real Gap, ddt_gap, Gamma, Fw1, Fw2, clip_0, clip_maxGap;
`include "smoothfunctions.va"
analog begin
Gap = V(nGap, b);
I(t, b) <+ I0 * limexp(-Gap/g0) * sinh(V(t, b)/V0) + GMIN*V(t, b);
Gamma = gamma0 - Beta * pow(Gap, 3);
ddt_gap = -Vel0*limexp(-Ea/$vt)*sinh(V(t, b)*Gamma*a0/tox/$vt);
Fw1 = smoothstep(minGap-Gap, smoothing);
Fw2 = smoothstep(Gap-maxGap, smoothing);
clip_minGap = (limexp(Kclip*(minGap-Gap)) - ddt_gap) * Fw1;
clip_maxGap = (-limexp(Kclip*(Gap-maxGap)) - ddt_gap) * Fw2;
I(nGap, b) <+ ddt_gap + clip_minGap + clip_maxGap;
I(nGap, b) <+ ddt(-1e-9*Gap);
end
endmodule