The simulator should not allow you to put a contribution V(out) <+ inside a cross event. And actually, now that I look at your code, you aren't; what you really have is
Code: @(cross(V(in) - vth, +1))
;
V(out) <+ transition(vout_high,tdelay,trise,tfall);
@(cross(V(in) - vth, -1))
;
V(out) <+ transition(vout_low,tdelay,trise,tfall);
So, the cross events only control the timesteps, and the contributions are always made, and I expect you end up with
V(out) <+ vout_high + vout_low;
You need a variable:
Code:real vout;
analog begin
@(initial_step)
vout = 0;
@(cross(V(in) - vth, +1))
vout = vout_high;
@(cross(V(in) - vth, -1))
vout = vout_low;
V(out) <+ transition(vout,tdelay,trise,tfall);
end
endmodule