data/full_repos/permissive/123304708/src/datapath/im.v
1: b'%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/im.v:27: Bit extraction of array[128:0] requires 8 bit index, not 10 bits.\n                                                                         : ... In instance im\n    dout <= InstrMem[addr];  \n                    ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module im( 
  input [11:2] addr,
  output reg[31:0] dout
  );
   
  `timescale 1ns/1ns
  
  reg[31:0] InstrMem[128:0];
  reg[31:0] instr_temp;
  integer fd, cnt, pointer;
      

  initial
  begin
    fd = $fopen("./test.txt","r"); 
    for(pointer = 0; pointer < 128; pointer = pointer+1)
    begin
      cnt = $fscanf(fd, "%x", instr_temp);
      InstrMem[pointer] = instr_temp;
      $display("IM read instruction %d: 0x%x", pointer, instr_temp);
    end
    $fclose(fd);
  end
    

  always@(*)
    dout <= InstrMem[addr];  
  
endmodule
module im( 
  input [11:2] addr,
  output reg[31:0] dout
  );

   
  `timescale 1ns/1ns
  
  reg[31:0] InstrMem[128:0];
  reg[31:0] instr_temp;
  integer fd, cnt, pointer;
      

  initial
  begin
    fd = $fopen("./test.txt","r"); 
    for(pointer = 0; pointer < 128; pointer = pointer+1)
    begin
      cnt = $fscanf(fd, "%x", instr_temp);
      InstrMem[pointer] = instr_temp;
      $display("IM read instruction %d: 0x%x", pointer, instr_temp);
    end
    $fclose(fd);
  end
    

  always@(*)
    dout <= InstrMem[addr];  
  
endmodule