data/full_repos/permissive/477502690/openmsp430/msp_memory/keyrom.v
1: b'%Warning-SELRANGE: data/full_repos/permissive/477502690/openmsp430/msp_memory/keyrom.v:80: Selection index out of range: 16 outside 9:0\n                                                                                         : ... In instance keyrom\n     $display("key: %h %h %h %h", mem[0], mem[8], mem[16], mem[24]);\n                                                     ^\n                   ... Use "/* verilator lint_off SELRANGE */" and lint_on around source to disable this message.\n%Warning-SELRANGE: data/full_repos/permissive/477502690/openmsp430/msp_memory/keyrom.v:80: Selection index out of range: 24 outside 9:0\n                                                                                         : ... In instance keyrom\n     $display("key: %h %h %h %h", mem[0], mem[8], mem[16], mem[24]);\n                                                              ^\n%Warning-WIDTH: data/full_repos/permissive/477502690/openmsp430/msp_memory/keyrom.v:87: Bit extraction of array[9:0] requires 4 bit index, not 5 bits.\n                                                                                      : ... In instance keyrom\nassign rom_dout = mem[rom_addr_reg];\n                     ^\n%Error: Exiting due to 3 warning(s)\n'
module keyrom (

    rom_dout,


    rom_addr,
    rom_cen,
    rom_clk
);



parameter ADDR_MSB   =  4;
parameter MEM_SIZE   =  20;



output      [15:0] rom_dout;



input [ADDR_MSB:0] rom_addr;
input              rom_cen;
input              rom_clk;





(* rom_style = "block" *) reg         [15:0] mem [0:(MEM_SIZE/2)-1];
reg   [ADDR_MSB:0] rom_addr_reg;
integer i;

initial
  begin

     for(i=0; i<MEM_SIZE/2; i=i+1) begin
	   mem[i] = 16'h0000;
     end
     mem[0] = 16'h0123;
     mem[1] = 16'h4567;
     mem[2] = 16'h89ab;
     mem[3] = 16'hcdef; 


     $display("key: %h %h %h %h", mem[0], mem[8], mem[16], mem[24]);
  end

always @(posedge rom_clk)
  if (~rom_cen & rom_addr<(MEM_SIZE/2))
      rom_addr_reg <= rom_addr;

assign rom_dout = mem[rom_addr_reg];
endmodule
module keyrom (

    rom_dout,


    rom_addr,
    rom_cen,
    rom_clk
);




parameter ADDR_MSB   =  4;
parameter MEM_SIZE   =  20;



output      [15:0] rom_dout;



input [ADDR_MSB:0] rom_addr;
input              rom_cen;
input              rom_clk;





(* rom_style = "block" *) reg         [15:0] mem [0:(MEM_SIZE/2)-1];
reg   [ADDR_MSB:0] rom_addr_reg;
integer i;

initial
  begin

     for(i=0; i<MEM_SIZE/2; i=i+1) begin
	   mem[i] = 16'h0000;
     end
     mem[0] = 16'h0123;
     mem[1] = 16'h4567;
     mem[2] = 16'h89ab;
     mem[3] = 16'hcdef; 


     $display("key: %h %h %h %h", mem[0], mem[8], mem[16], mem[24]);
  end

always @(posedge rom_clk)
  if (~rom_cen & rom_addr<(MEM_SIZE/2))
      rom_addr_reg <= rom_addr;

assign rom_dout = mem[rom_addr_reg];
endmodule