data/full_repos/permissive/123304708/src/datapath/dm.v
1: b'%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:17: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n        4\'b1111: mem[addr] = din;\n                    ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:18: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n        4\'b0011: mem[addr][15:0] = din[15:0];\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:19: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n        4\'b1100: mem[addr][31:16] = din[15:0];\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:20: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n        4\'b0001: mem[addr][7:0] = din[7:0];\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:21: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n        4\'b0010: mem[addr][15:8] = din[7:0];\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:22: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n        4\'b0100: mem[addr][23:16] = din[7:0];\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:23: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n        4\'b1000: mem[addr][31:24] = din[7:0];\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/123304708/src/datapath/dm.v:29: Bit extraction of array[31:0] requires 5 bit index, not 10 bits.\n                                                                         : ... In instance dm\n  assign dout = mem[addr];\n                   ^\n%Error: Exiting due to 8 warning(s)\n'
module dm(
  input MemWrite,
  input [11:2] addr,
  input [3:0] be,
  input [31:0] din,
  output [31:0] dout
  );
  
  reg[31:0] mem[31:0];
    

  always@(*)
  begin
    if(MemWrite)
    begin
      case(be)
        4'b1111: mem[addr] = din;
        4'b0011: mem[addr][15:0] = din[15:0];
        4'b1100: mem[addr][31:16] = din[15:0];
        4'b0001: mem[addr][7:0] = din[7:0];
        4'b0010: mem[addr][15:8] = din[7:0];
        4'b0100: mem[addr][23:16] = din[7:0];
        4'b1000: mem[addr][31:24] = din[7:0];
      endcase
    end
  end
  

  assign dout = mem[addr];
    
endmodule
module dm(
  input MemWrite,
  input [11:2] addr,
  input [3:0] be,
  input [31:0] din,
  output [31:0] dout
  );

  
  reg[31:0] mem[31:0];
    

  always@(*)
  begin
    if(MemWrite)
    begin
      case(be)
        4'b1111: mem[addr] = din;
        4'b0011: mem[addr][15:0] = din[15:0];
        4'b1100: mem[addr][31:16] = din[15:0];
        4'b0001: mem[addr][7:0] = din[7:0];
        4'b0010: mem[addr][15:8] = din[7:0];
        4'b0100: mem[addr][23:16] = din[7:0];
        4'b1000: mem[addr][31:24] = din[7:0];
      endcase
    end
  end
  

  assign dout = mem[addr];
    
endmodule