Unverified Commit c5f1e079 by Miodrag Milanović Committed by GitHub

Merge pull request #28 from SergeyDegtyar/master

Fix failed tests for dffe cell
parents cd025088 f9f4d7b7
......@@ -11,10 +11,10 @@ module testbench;
#5 clk = 0;
end
$display("OKAY");
$display("OKAY");
end
reg [2:0] dinA = 0;
wire doutB,doutB1,doutB2,doutB3,doutB4;
reg dff,ndff,adff,adffn,dffe = 0;
......@@ -30,12 +30,12 @@ module testbench;
.b3 (doutB3 ),
.b4 (doutB4 )
);
always @(posedge clk) begin
#3;
dinA <= dinA + 1;
end
always @( posedge clk, posedge dinA[1], posedge dinA[2] )
if ( dinA[2] )
dff <= 1'b0;
......@@ -43,7 +43,7 @@ module testbench;
dff <= 1'b1;
else
dff <= dinA[0];
always @( negedge clk, negedge dinA[1], negedge dinA[2] )
if ( !dinA[2] )
ndff <= 1'b0;
......@@ -51,27 +51,27 @@ module testbench;
ndff <= 1'b1;
else
ndff <= dinA[0];
always @( posedge clk, posedge dinA[2] )
if ( dinA[2] )
adff <= 1'b0;
else
adff <= dinA[0];
always @( posedge clk, negedge dinA[2] )
if ( !dinA[2] )
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk)
if ( dinA[2] )
dffe <= dinA[0];
assert_dff dff_test(.clk(clk), .test(doutB), .pat(dff));
assert_dff ndff_test(.clk(clk), .test(doutB1), .pat(ndff));
assert_dff adff_test(.clk(clk), .test(doutB2), .pat(adff));
assert_dff adff_test(.clk(clk), .test(doutB2), .pat(adff));
assert_dff adffn_test(.clk(clk), .test(doutB3), .pat(adffn));
assert_dff dffe_test(.clk(clk), .test(doutB4), .pat(dffe));
endmodule
......@@ -5,9 +5,9 @@ module adff
end
always @( posedge clk, posedge clr )
if ( clr )
`ifndef BUG
`ifndef BUG
q <= 1'b0;
`else
`else
q <= d;
`endif
else
......@@ -21,9 +21,9 @@ module adffn
end
always @( posedge clk, negedge clr )
if ( !clr )
`ifndef BUG
`ifndef BUG
q <= 1'b0;
`else
`else
q <= d;
`endif
else
......@@ -35,11 +35,11 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk)
if ( en )
`ifndef BUG
`ifndef BUG
q <= d;
`else
`else
q <= 1'b0;
`endif
endmodule
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk)
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk)
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk)
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -64,7 +64,7 @@ module testbench;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -64,7 +64,7 @@ module testbench;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk)
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -47,7 +47,7 @@ module dffe
initial begin
q = Z;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -47,7 +47,7 @@ module dffe
initial begin
q = Z;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 0;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
......@@ -63,8 +63,8 @@ module testbench;
adffn <= 1'b0;
else
adffn <= dinA[0];
always @( posedge clk, posedge dinA[2] )
always @( posedge clk )
if ( dinA[2] )
dffe <= dinA[0];
......
......@@ -35,7 +35,7 @@ module dffe
initial begin
q = 1'bZ;
end
always @( posedge clk, posedge en )
always @( posedge clk )
if ( en )
`ifndef BUG
q <= d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment