single cycle processor mips 32 bit (data memory)

Status
Not open for further replies.

funjoke

Member level 3
Joined
Feb 19, 2009
Messages
58
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,772
i am working with the single mips cycle processor data memory part ,and i am facing problem with the verilog of data memory ...here is my code ...


// Data memory
// It doesn't have a memory read output
module DM(dataread,clock,memwrite,addr,datawrite);

input [31:0] addr,datawrite;
input clock, memwrite;
output [31:0] dataread;

reg [31:0] memcell [0:3]; // 4GBmemory cells


assign dataread = memcell[addr[6:0]];

always @(posedge clock)
begin
if (memwrite == 1) memcell[addr[6:0]]=datawrite;
end

endmodule
 

"memcell[addr[6:0]]"...

i think you should specify the full address range as index.i mean use 31:0 instead of 6:0.
 

i think this code got error on it .can anybody help on
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…