data/full_repos/permissive/123218339/findMyBest.v
1: b'%Warning-REALCVT: data/full_repos/permissive/123218339/findMyBest.v:45: Implicit conversion of real to integer\n                            k = $ceil((11-1) * MY_BATTERY_STAT);  \n                                ^~~~~\n                  ... Use "/* verilator lint_off REALCVT */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module findMyBest(clock, nrst, start, address, data_in, MY_BATTERY_STAT, mybest, done);
    input clock, nrst, start;
    input [`WORD_WIDTH-1:0] data_in, MY_BATTERY_STAT;
    output done;
    output [`WORD_WIDTH-1:0] address;
    output [`WORD_WIDTH-1:0] mybest;


    reg done_buf;
    reg [`WORD_WIDTH-1:0] address_count, k;
    reg [`WORD_WIDTH-1:0] mybest_buf;
    reg state;

    always @ (posedge clock) begin
        if (!nrst) begin
            done_buf <= 0;
            address_count <= 16'h1C8;
            mybest_buf <= 16'hFFFE;
            state <= 0;
            k <= 0;
        end
        else begin
            if (start && !done_buf) begin
                case (state)
                    0: begin
                        if (data_in < mybest_buf) begin
                            mybest_buf = data_in;
                        end

                        if (address_count == 16'h246) begin
                            state = 1;
                            k = $ceil((`HCM_LENGTH-1) * MY_BATTERY_STAT);
                            if (k >= `HCM_LENGTH)
                                k = `HCM_LENGTH - 1;
                            address_count = 16'h648 + 2*k;
                        end
                        else
                            address_count = address_count + 2;
                    end

                    1: begin

                        mybest_buf = mybest_buf * data_in;
                        done_buf = 1;
                    end
                endcase
            end
        end
    end

    assign done = done_buf;
    assign address = address_count;
    assign mybest = mybest_buf;
endmodule
module findMyBest(clock, nrst, start, address, data_in, MY_BATTERY_STAT, mybest, done);

    input clock, nrst, start;
    input [`WORD_WIDTH-1:0] data_in, MY_BATTERY_STAT;
    output done;
    output [`WORD_WIDTH-1:0] address;
    output [`WORD_WIDTH-1:0] mybest;


    reg done_buf;
    reg [`WORD_WIDTH-1:0] address_count, k;
    reg [`WORD_WIDTH-1:0] mybest_buf;
    reg state;

    always @ (posedge clock) begin
        if (!nrst) begin
            done_buf <= 0;
            address_count <= 16'h1C8;
            mybest_buf <= 16'hFFFE;
            state <= 0;
            k <= 0;
        end
        else begin
            if (start && !done_buf) begin
                case (state)
                    0: begin
                        if (data_in < mybest_buf) begin
                            mybest_buf = data_in;
                        end

                        if (address_count == 16'h246) begin
                            state = 1;
                            k = $ceil((`HCM_LENGTH-1) * MY_BATTERY_STAT);
                            if (k >= `HCM_LENGTH)
                                k = `HCM_LENGTH - 1;
                            address_count = 16'h648 + 2*k;
                        end
                        else
                            address_count = address_count + 2;
                    end

                    1: begin

                        mybest_buf = mybest_buf * data_in;
                        done_buf = 1;
                    end
                endcase
            end
        end
    end

    assign done = done_buf;
    assign address = address_count;
    assign mybest = mybest_buf;
endmodule