patrick wrote on Oct 14th, 2008, 9:38pm:If you can post the netlist and VA pwl that's not working I'm happy to take a look.
Patrick
Hi, patrick, the following is my va module:
`include "disciplines.vams"
`include "constants.vams"
module divider4 (out, in);
input in;
output out ;
electrical in, out;
parameter real vlo=0;
parameter real vhi=1.2;
parameter real vth = (vhi+vlo)/2;
parameter integer dir=1 from [-1:1] exclude 0;
parameter real trf=100p from (0:inf);
parameter real td=0 from [0:inf);
parameter real ttol=1p from (0:inf);
parameter integer ratio=4;
integer count, n;
analog begin
@(cross(V(in) - vth, dir, ttol)) begin
count = count + 1;
if (count >= ratio) count = 0;
end
n = (2*count >= ratio);
V(out) <+ transition(n ? vhi : vlo, td, trf);
end
endmodule
Even I simulated just two inverters with/without this va module, I got different results too!~
You can try to simulate any circuits module with this va module.
Of course, the difference is not obvious in this simple circuit. But with more complex circuits, the difference would more and more obvious.