top.v 466 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
module dffcp
    ( input d, clk, pre, clr, output reg q );
	always @( posedge clk, posedge pre, posedge clr )
		if ( pre )
			q <= 1'b1;
		else if ( clr )
			q <= 1'b0;
		else
            q <= d;
endmodule

module top (
input clk,
input a,
output b
);

dffcp u_dffcp (
        .clk (clk ),
20
`ifndef BUG        
21 22
        .clr (1'b0),
        .pre (1'b1),
23 24 25 26
`else        
        .clr (1'b1),
        .pre (1'b0),
`endif
27 28 29 30 31
        .d (a ),
        .q (b )
    );

endmodule