data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/bootrom/dromajo_bootrom.sv
1: b'%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/bootrom/dromajo_bootrom.sv:42: Bit extraction of array[4095:0] requires 12 bit index, not 64 bits.\n                                                                                                                               : ... In instance dromajo_bootrom\n          mem[address] = value;\n             ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/509468557/generators/cva6/src/main/resources/vsrc/cva6/bootrom/dromajo_bootrom.sv:61: Operator LT expects 32 bits on the LHS, but LHS\'s VARREF \'addr_q\' generates 12 bits.\n                                                                                                                               : ... In instance dromajo_bootrom\n    assign rdata_o = (addr_q < RomSize) ? mem[addr_q] : \'0;\n                             ^\n%Error: Exiting due to 2 warning(s)\n'
module dromajo_bootrom (
   input  logic         clk_i,
   input  logic         req_i,
   input  logic [63:0]  addr_i,
   output logic [63:0]  rdata_o
);
    localparam int RomSize = 4096;
    logic [63:0] mem[RomSize-1:0];

    initial begin
      integer hex_file, num_bytes;
      longint address, value;
      string f_name;

      for (int k=0; k<RomSize; k++) begin
        mem[k] = 0;
      end


      if ($value$plusargs("checkpoint=%s", f_name)) begin
        hex_file = $fopen({f_name,".bootram.hex"}, "r");
        while (!$feof(hex_file)) begin
          num_bytes = $fscanf(hex_file, "%d %h\n", address, value);

          mem[address] = value;
        end
        $display("Done syncing boot ROM with dromajo...\n");
      end else begin
        $display("Failed syncing boot ROM: provide path to a checkpoint.\n");
      end

    end

    logic [$clog2(RomSize)-1:0] addr_q;

    always_ff @(posedge clk_i) begin
        if (req_i) begin
            addr_q <= addr_i[$clog2(RomSize)-1+3:3];
        end
    end



    assign rdata_o = (addr_q < RomSize) ? mem[addr_q] : '0;
endmodule
module dromajo_bootrom (
   input  logic         clk_i,
   input  logic         req_i,
   input  logic [63:0]  addr_i,
   output logic [63:0]  rdata_o
);

    localparam int RomSize = 4096;
    logic [63:0] mem[RomSize-1:0];

    initial begin
      integer hex_file, num_bytes;
      longint address, value;
      string f_name;

      for (int k=0; k<RomSize; k++) begin
        mem[k] = 0;
      end


      if ($value$plusargs("checkpoint=%s", f_name)) begin
        hex_file = $fopen({f_name,".bootram.hex"}, "r");
        while (!$feof(hex_file)) begin
          num_bytes = $fscanf(hex_file, "%d %h\n", address, value);

          mem[address] = value;
        end
        $display("Done syncing boot ROM with dromajo...\n");
      end else begin
        $display("Failed syncing boot ROM: provide path to a checkpoint.\n");
      end

    end

    logic [$clog2(RomSize)-1:0] addr_q;

    always_ff @(posedge clk_i) begin
        if (req_i) begin
            addr_q <= addr_i[$clog2(RomSize)-1+3:3];
        end
    end



    assign rdata_o = (addr_q < RomSize) ? mem[addr_q] : '0;
endmodule