data/full_repos/permissive/464120924/Basys3_CPU/Basys3_CPU.srcs/sources_1/new/memory.v
1: b'%Warning-WIDTH: data/full_repos/permissive/464120924/Basys3_CPU/Basys3_CPU.srcs/sources_1/new/memory.v:18: Bit extraction of array[255:0] requires 8 bit index, not 16 bits.\n                                                                                                         : ... In instance memory\n    assign memory_io = write ? 16\'hz : mem[address];\n                                          ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/464120924/Basys3_CPU/Basys3_CPU.srcs/sources_1/new/memory.v:22: Bit extraction of array[255:0] requires 8 bit index, not 16 bits.\n                                                                                                         : ... In instance memory\n            mem[address] = memory_io;\n               ^\n%Error: Exiting due to 2 warning(s)\n'
module memory#(parameter word_count=255)(
    input clk,
    input write,
    input[15:0] address,
    
    inout[15:0] memory_io
    );
    
    reg[15:0] mem[word_count:0];
    
    initial $readmemh("init_memory.mem", mem);

    assign memory_io = write ? 16'hz : mem[address];
        
    always@(posedge clk) begin
        if (write) 
            mem[address] = memory_io;
    end
    
    
endmodule
module memory#(parameter word_count=255)(
    input clk,
    input write,
    input[15:0] address,
    
    inout[15:0] memory_io
    );

    
    reg[15:0] mem[word_count:0];
    
    initial $readmemh("init_memory.mem", mem);

    assign memory_io = write ? 16'hz : mem[address];
        
    always@(posedge clk) begin
        if (write) 
            mem[address] = memory_io;
    end
    
    
endmodule