My input is following, // VerilogA for Memristor, V_ramp, veriloga `include "constants.vams" `include "disciplines.vams" module V_ramp(vout, gnd); electrical vout, gnd; parameter real period = 4.0; // Full cycle duration (4 sec) parameter real amplitude = 1.0; // Peak voltage level real time_offset; analog begin time_offset = $abstime % period; // Get time within the cycle if (time_offset 0)) ) begin //Warning! Entering contact mode. The model is not valid anymore. ic1 = 0; contact_mode=1; end else if ((gap>L-atomic_radius) & (I(fil,filAtu)<0)) begin ic1 = 0; end else begin ic1 = Kdep*I(fil,filAtu); end end else begin $monitor("WARNING: Contact Mode, left boundary conditions of the model, no reset possible anymore"); ic1 = 0; end // Calculaton of the state variable gap, that is, gap b/w the filament and top electrode gap = L- idt(ic1, ic); V(n_fil, gnd) <+ V(fil, filAtu); V(n_ac, gnd) <+ V(te, ion); V(track_gap, gnd) <+ gap; end endmodule
↧