Flipflop structural code and test bench code
I don't know where I have made a mistake. I am getting few errors in the output.
`timescale 1ns/1ps
module t_ff (
input clk,t,rst_n,
output reg q);
always@(posedge clk ,negedge rst_n)
begin
if (!rst_n)
q <= 1'b0;
else if(t)
q <= ~q;
else
q <= q;
end
endmodule
@@@test bench@@@@
`timescale 1ns/1ps
module tb_tff;
reg RST_n, CLK,T;
wire Q;
t_ff TFF (.clk(CLK) ,.rst_n(RST_n) ,.q( Q ),.t(T));
initial begin
RST_n = 1'b0;
CLK =1'b0;
T =1'b0;
#5 RST_n = 1'b1;
#13 RST_n = 1'b0;
#7 RST_n = 1'b1;
#45 $finish;
end
always #3 CLK = ~CLK;
always #6 T = ~T;
always @(posedge CLK ,negedge RST_n)
$strobe("time =%0t \t INPUT VALUES \t T =%b RST_n =%b \t OUTPUT VALUES
Q=%d",$time,T,RST_n,Q);
endmodule
Getting the errors like this:
Error-[V2KS] Verilog IEEE 1364-2000 syntax used
TFlipflop.v, 4 Verilog 2000 IEEE 1364-2000 syntax used : Combined port and type declaration. Please compile with +v2k to support this construct.
Error-[V2KS] Verilog IEEE 1364-2000 syntax used
TFlipflop.v, 4 Verilog 2000 IEEE 1364-2000 syntax used : Ansi style port declaration. Please compile with +v2k to support this construct.
Error-[V2KS] Verilog IEEE 1364-2000 syntax used
TFlipflop.v, 6 Verilog 2000 IEEE 1364-2000 syntax used : Comma separated sensitivity lists. Please compile with +v2k to support this construct.
Parsing design file 'test_TFlipflop.v'
Error-[V2KS] Verilog IEEE 1364-2000 syntax used
test_TFlipflop.v, 21 Verilog 2000 IEEE 1364-2000 syntax used : Comma separated sensitivity lists. Please compile with +v2k to support this construct.
4 errors CPU time: .036 seconds