soursethi17
Newbie level 4
I want to write these 3 equations with one boundary condition assosciated. I have coded the same in matlab and it works fine. But here i have some problems, i want the function to return me an array of values so i can plot them. I used this approach in matlab. But in verilog i dont knw what idt and ddt returns, array or function of t...
eq 1 : d(w(t))/dt = [uv*Ron.I(t)]/D #uv,Ron,D are constant and I(t) = input current, From here i get array of W for different I(t) ( or maybe w(t) ..? )
#boundary condition of equation 1 is w(0)=1.5e-9
eq 2 : R = Ron*w(t)/D + Roff(1- w(t)/D)
eq 3 : V(t)=R*I(t);
Error log :
eq 1 : d(w(t))/dt = [uv*Ron.I(t)]/D #uv,Ron,D are constant and I(t) = input current, From here i get array of W for different I(t) ( or maybe w(t) ..? )
#boundary condition of equation 1 is w(0)=1.5e-9
eq 2 : R = Ron*w(t)/D + Roff(1- w(t)/D)
eq 3 : V(t)=R*I(t);
Code:
Verilog A
[I]//Verilog a memristor model by Sourabh Sethi//
`include "disciplines.vams"
`include "constants.h"
//in outs
module Memristor_Linear(p, n);
input p;
output n;
electrical p,n;
ground gnd;
//parameters
parameter real D= 3e-9;
parameter real uv=1e-15;
parameter real Roff = 2e5;
parameter real Ron=100;
real w_temp;
real w;
real R;
//equations
analog begin[syntax=verilog][/syntax]
w_temp=(uv*Ron*I(p,n))/D;
w=idt(w_temp,1.5e-9); //initial condition w at t=0 is 1.5e-9
[B][I]R=(Ron*w)/D + (Roff*(1-(w/D); //Error is in this line[/I]
[I]V(p,n) <+ R*(I(p,n) ; // and this[/I][/B]
end
endmodule[/I]
Error log :
ERROR (VACOMP-2259): "R=(Ron*w)/D + (Roff*(1-(w/D);<<--? "
"/home/2018_2/resistive_ram/memristor_debug/veriloga/veriloga.va", line
32: syntax error.
ERROR (VACOMP-2259): "V(p) <+ R*(I ;<<--? "
"/home/2018_2/resistive_ram/memristor_debug/veriloga/veriloga.va", line
33: syntax error.