data/full_repos/permissive/147690299/lab/32_fsm_ultrasonic/rtl/strobe_gen.v
1: b"%Error: data/full_repos/permissive/147690299/lab/32_fsm_ultrasonic/rtl/strobe_gen.v:12: Replication value of 0 is only legal under a concatenation (IEEE 1800-2017 11.4.12.1)\n                                                                                      : ... In instance strobe_gen\n    localparam ZERO  = { WIDTH { 1'b0 } };\n                               ^\n%Error: Exiting due to 1 error(s)\n"
module strobe_gen
#( 
    parameter DELAY = 1
)(
    input  clk,
    input  rst_n,
    input  en,
    output strobe
);
    localparam WIDTH = $clog2(DELAY);
    localparam ZERO  = { WIDTH { 1'b0 } };

    wire [WIDTH-1:0] cntr;
    wire [WIDTH-1:0] cntr_nx;
    prm_register #(WIDTH) cntr_r (clk, rst_n, cntr_nx, cntr);

    wire   cntr_clr = (cntr == DELAY);
    assign cntr_nx  = cntr_clr ? ZERO : cntr + 1;

    assign strobe = en & cntr_clr;

endmodule
module strobe_gen
#( 
    parameter DELAY = 1
)(
    input  clk,
    input  rst_n,
    input  en,
    output strobe
);

    localparam WIDTH = $clog2(DELAY);
    localparam ZERO  = { WIDTH { 1'b0 } };

    wire [WIDTH-1:0] cntr;
    wire [WIDTH-1:0] cntr_nx;
    prm_register #(WIDTH) cntr_r (clk, rst_n, cntr_nx, cntr);

    wire   cntr_clr = (cntr == DELAY);
    assign cntr_nx  = cntr_clr ? ZERO : cntr + 1;

    assign strobe = en & cntr_clr;

endmodule