Fixed a memory corruption bug
This commit is contained in:
parent
7e612bb701
commit
e4ef199b83
@ -38,10 +38,12 @@ assign data[7:0] = !address[0:0] & !rd & !cs ? memory[address[16:1]][15:8] : 8'
|
|||||||
assign data[15:8] = !BHE & !rd & !cs ? memory[address[16:1]][7:0] : 8'hz;
|
assign data[15:8] = !BHE & !rd & !cs ? memory[address[16:1]][7:0] : 8'hz;
|
||||||
|
|
||||||
always @(negedge wr) begin
|
always @(negedge wr) begin
|
||||||
|
if( cs == 0 ) begin
|
||||||
if(BHE==0)
|
if(BHE==0)
|
||||||
memory[address[16:1]][7:0]<=data[15:8];
|
memory[address[16:1]][7:0]<=data[15:8];
|
||||||
if(address[0]==0)
|
if(address[0]==0)
|
||||||
memory[address[16:1]][15:8]<=data[7:0];
|
memory[address[16:1]][15:8]<=data[7:0];
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
Loading…
Reference in New Issue
Block a user