test21b.v 641 Bytes
Newer Older
1
(* top *)
Eddie Hung committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
module test21b #(parameter width=130, depth=4) (input clk, input [width-1:0] i, input e, output q);
    reg [depth-1:0] int;

    genvar d;
    for (d = 0; d < depth; d=d+1)
        initial int[d] <= ~(d % 2);

    if (depth == 1) begin
        always @(negedge clk) if (e) int <= ~^i[width-1:0];
        assign q = int;
    end
    else begin
        always @(negedge clk) if (e) int <= { int[depth-2:0], ~^i[width-1:0] };
        assign q = int[depth-1];
    end
endmodule
18 19 20 21 22 23

`ifndef _AUTOTB
module __test ;
    wire [4095:0] assert_area = "cd test21b; select t:SRL* -assert-count 0; select t:FD* -assert-min 20";
endmodule
`endif