I found that I could not get a T Flip-Flop without a reset to simulate in SystemVerilog, but I could get a JK Flip-Flop without a reset to simulate. This is because I can set a JK Flip-Flop to a known state using J = 0, K = 1 or K = 1, J = 0.
The design code:
module t_ff(input logic t, clk, output logic q, q_bar);
parameter HOLD = 1'b0,
TOGGLE = 1'b1;
always_ff @(posedge clk)
case (t)
HOLD: q <= q;
TOGGLE: q <= ~q;
default: q <= 1'bz;
endcase
assign q_bar = ~q;
endmodule
I tried using bit
in the testbench, but that did not work either (just as I expected). I understand that a reset is important for a Flip-Flop in IC Design, but can't we build a Flip-Flop without a reset? I think the T Flip-Flop can be used without a reset in applications when the input for the flip-flop comes from another digital circuit.
How is this problem handled in Gate-level simulations?