data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v
1: b'%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:74: Selection index out of range: 32 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[32] <= \'h80;\n                  ^\n                   ... Use "/* verilator lint_off SELRANGE */" and lint_on around source to disable this message.\n%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:75: Selection index out of range: 33 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[33] <= \'h00;\n                  ^\n%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:76: Selection index out of range: 34 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[34] <= \'h00;\n                  ^\n%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:77: Selection index out of range: 35 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[35] <= \'h88;\n                  ^\n%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:79: Selection index out of range: 36 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[36] <= \'h90;\n                  ^\n%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:80: Selection index out of range: 37 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[37] <= \'h00;\n                  ^\n%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:81: Selection index out of range: 38 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[38] <= \'h00;\n                  ^\n%Warning-SELRANGE: data/full_repos/permissive/191638444/project_hxf5071_pbc5080.srcs/sources_1/imports/new/data_mem.v:82: Selection index out of range: 39 outside 31:0\n                                                                                                                        : ... In instance data_mem\n        dataMemory[39] <= \'h99;\n                  ^\n%Error: Exiting due to 8 warning(s)\n'
module data_mem (writeEnabled, address, dataIn, dataOut);
       
    input writeEnabled; 
    input [31:0] address;
    input [31:0]dataIn;   
    output reg [31:0] dataOut; 
    
    reg[7:0] dataMemory[0:31];
    
    initial
    begin
        dataMemory[0] <= 'hA0;
        dataMemory[1] <= 'h00;
        dataMemory[2] <= 'h00;
        dataMemory[3] <= 'hAA;
        
        dataMemory[4] <= 'h10;
        dataMemory[5] <= 'h00;
        dataMemory[6] <= 'h00;
        dataMemory[7] <= 'h11;
        
        dataMemory[8] <= 'h20;
        dataMemory[9] <= 'h00;
        dataMemory[10] <= 'h00;
        dataMemory[11] <= 'h22;
        
        dataMemory[12] <= 'h30;
        dataMemory[13] <= 'h00;
        dataMemory[14] <= 'h00;
        dataMemory[15] <= 'h33;
        
        dataMemory[16] <= 'h40;
        dataMemory[17] <= 'h00;
        dataMemory[18] <= 'h00;
        dataMemory[19] <= 'h44;
        
        dataMemory[20] <= 'h50;
        dataMemory[21] <= 'h00; 
        dataMemory[22] <= 'h00; 
        dataMemory[23] <= 'h55;
        
        dataMemory[24] <= 'h60;
        dataMemory[25] <= 'h00; 
        dataMemory[26] <= 'h00; 
        dataMemory[27] <= 'h66;
        
        dataMemory[28] <= 'h70;
        dataMemory[29] <= 'h00; 
        dataMemory[30] <= 'h00; 
        dataMemory[31] <= 'h77; 
             
        dataMemory[32] <= 'h80;
        dataMemory[33] <= 'h00;
        dataMemory[34] <= 'h00;
        dataMemory[35] <= 'h88;
        
        dataMemory[36] <= 'h90;
        dataMemory[37] <= 'h00;
        dataMemory[38] <= 'h00;
        dataMemory[39] <= 'h99;
    end
    
    always @(address, writeEnabled)
    begin
        if (writeEnabled == 0)
        begin

            dataOut[31:24] <= dataMemory [address];
            dataOut[23:16] <= dataMemory [address+1];
            dataOut[15:8] <= dataMemory [address+2];
            dataOut[7:0] <= dataMemory [address+3];
        end
        else
        begin

            dataMemory [address] <= dataIn[31:24];
            dataMemory [address+1] <= dataIn [23:16];
            dataMemory [address+2] <= dataIn [15:8];
            dataMemory [address+3] <= dataIn [7:0];
        end
    end

endmodule
module data_mem (writeEnabled, address, dataIn, dataOut);

       
    input writeEnabled; 
    input [31:0] address;
    input [31:0]dataIn;   
    output reg [31:0] dataOut; 
    
    reg[7:0] dataMemory[0:31];
    
    initial
    begin
        dataMemory[0] <= 'hA0;
        dataMemory[1] <= 'h00;
        dataMemory[2] <= 'h00;
        dataMemory[3] <= 'hAA;
        
        dataMemory[4] <= 'h10;
        dataMemory[5] <= 'h00;
        dataMemory[6] <= 'h00;
        dataMemory[7] <= 'h11;
        
        dataMemory[8] <= 'h20;
        dataMemory[9] <= 'h00;
        dataMemory[10] <= 'h00;
        dataMemory[11] <= 'h22;
        
        dataMemory[12] <= 'h30;
        dataMemory[13] <= 'h00;
        dataMemory[14] <= 'h00;
        dataMemory[15] <= 'h33;
        
        dataMemory[16] <= 'h40;
        dataMemory[17] <= 'h00;
        dataMemory[18] <= 'h00;
        dataMemory[19] <= 'h44;
        
        dataMemory[20] <= 'h50;
        dataMemory[21] <= 'h00; 
        dataMemory[22] <= 'h00; 
        dataMemory[23] <= 'h55;
        
        dataMemory[24] <= 'h60;
        dataMemory[25] <= 'h00; 
        dataMemory[26] <= 'h00; 
        dataMemory[27] <= 'h66;
        
        dataMemory[28] <= 'h70;
        dataMemory[29] <= 'h00; 
        dataMemory[30] <= 'h00; 
        dataMemory[31] <= 'h77; 
             
        dataMemory[32] <= 'h80;
        dataMemory[33] <= 'h00;
        dataMemory[34] <= 'h00;
        dataMemory[35] <= 'h88;
        
        dataMemory[36] <= 'h90;
        dataMemory[37] <= 'h00;
        dataMemory[38] <= 'h00;
        dataMemory[39] <= 'h99;
    end
    
    always @(address, writeEnabled)
    begin
        if (writeEnabled == 0)
        begin

            dataOut[31:24] <= dataMemory [address];
            dataOut[23:16] <= dataMemory [address+1];
            dataOut[15:8] <= dataMemory [address+2];
            dataOut[7:0] <= dataMemory [address+3];
        end
        else
        begin

            dataMemory [address] <= dataIn[31:24];
            dataMemory [address+1] <= dataIn [23:16];
            dataMemory [address+2] <= dataIn [15:8];
            dataMemory [address+3] <= dataIn [7:0];
        end
    end

endmodule