I am getting this error when I am compiling my file which Using Behaviour Modelling is designing a positive edge triggered T-Flip-Flop with asynchronous clear in Verilog code.
module t_flip_flop (input clk, input pr, input clr, input d, output q);
reg q_next;
always @ (posedge clk or negedge clr) begin
if (clr == 0) q_next <= 1'b0;
else if (pr == 1) q_next <= d;
else if (clk == 1'b1) q <= q_next;
end
endmodule
module t_flip_flop_testbench;
reg clk, pr, clr, d;
wire q;
t_flip_flop tff (clk, pr, clr, d, q);
initial begin
clk = 0;
pr = 0;
clr = 0;
d = 0;
#10
clk = 1;
#10
clk = 0;
pr = 1;
d = 1;
#10
clk = 1;
#10
clk = 0;
pr = 0;
d = 0;
#10
clk = 1;
#10
clr = 1;
#10
clr = 0;
#10
$finish;
end
endmodule