data/full_repos/permissive/467394306/rtl/ctrl_aux.sv
1: b'%Warning-WIDTH: data/full_repos/permissive/467394306/rtl/ctrl_aux.sv:28: Bit extraction of array[10:0] requires 4 bit index, not 5 bits.\n                                                                       : ... In instance INBUF\n    assign dout = empty ? 0 : bufdat[curhead];\n                                    ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/467394306/rtl/ctrl_aux.sv:55: Bit extraction of array[10:0] requires 4 bit index, not 5 bits.\n                                                                       : ... In instance INBUF\n                    bufdat[curtail] <= din;\n                          ^\n%Warning-WIDTH: data/full_repos/permissive/467394306/rtl/ctrl_aux.sv:58: Bit extraction of array[10:0] requires 4 bit index, not 5 bits.\n                                                                       : ... In instance INBUF\n                    bufdat[curtail] <= din;\n                          ^\n%Error: Exiting due to 3 warning(s)\n'
module INBUF
    #(
    parameter WORDLEN = 8,
    parameter BUFSIZE = 10,
    parameter PADDING = 0)
    (
    input clk,
    input rstn,
    input read,
    input write,
    input [WORDLEN-1 : 0] din,
    output empty,
    output [WORDLEN-1 : 0] dout);








    reg [WORDLEN-1 : 0] bufdat [0:BUFSIZE];
    reg [4:0] curhead, curtail;
    integer i;



    assign dout = empty ? 0 : bufdat[curhead];
    assign empty = curhead == curtail;

    always @ (posedge clk) begin
        if(!rstn) begin

            for(i=0; i<BUFSIZE; i=i+1) begin
               bufdat[i] <= 0; 
            end
            curhead <= 0;
            curtail <= PADDING;
        end else begin
            if (read && !empty) begin


                if (curhead == BUFSIZE-1) begin

                    curhead <= 0;
                end else begin
                    curhead <= curhead + 1;
                end
            end
            if (write) begin


                if (curtail == BUFSIZE-1) begin

                    bufdat[curtail] <= din;
                    curtail <= 0;
                end else begin
                    bufdat[curtail] <= din;
                    curtail <= curtail + 1;
                end
            end
        end
    end
endmodule
module INBUF
    #(
    parameter WORDLEN = 8,
    parameter BUFSIZE = 10,
    parameter PADDING = 0)
    (
    input clk,
    input rstn,
    input read,
    input write,
    input [WORDLEN-1 : 0] din,
    output empty,
    output [WORDLEN-1 : 0] dout);









    reg [WORDLEN-1 : 0] bufdat [0:BUFSIZE];
    reg [4:0] curhead, curtail;
    integer i;



    assign dout = empty ? 0 : bufdat[curhead];
    assign empty = curhead == curtail;

    always @ (posedge clk) begin
        if(!rstn) begin

            for(i=0; i<BUFSIZE; i=i+1) begin
               bufdat[i] <= 0; 
            end
            curhead <= 0;
            curtail <= PADDING;
        end else begin
            if (read && !empty) begin


                if (curhead == BUFSIZE-1) begin

                    curhead <= 0;
                end else begin
                    curhead <= curhead + 1;
                end
            end
            if (write) begin


                if (curtail == BUFSIZE-1) begin

                    bufdat[curtail] <= din;
                    curtail <= 0;
                end else begin
                    bufdat[curtail] <= din;
                    curtail <= curtail + 1;
                end
            end
        end
    end
endmodule