module V_t_ff(q,clk); input clk; output q; voltage q,clk; parameter real tdelay = 5n from [0:inf), ttransit = 5n from [0:inf), vout_high = 5, vout_low = 0 from (-inf:vout_high), vth = 1.4; parameter integer q_init = 0 from [0:1]; integer x; analog begin @(initial_step) x = q_init; @(cross(V(clk) - vth, +1 )) x = !x; V(q) <+ transition( vout_high*x + vout_low*!x, tdelay, ttransit ); end endmodule