M
m2star
Guest
i use this code for memory of my project its working for modelsim but
not working for ise-9.1i
is there any other technique for this purpose.....................
"module blockram(clk, RW, address, Din, Dout);
input clk,RW;
input [11:00] address;
input [15:00] Din;
output [15:00] Dout;
reg [15:00] Dout;
reg [15:0] mem[0:15]; //declare memory
initial
begin
mem[0] = 16'h100a; mem[1] = 16'h200d; mem[2] = 16'h300c;
mem[3] = 16'h9005; mem[4] = 16'h300b; mem[5] = 16'h400d;
mem[6] = 16'h8800; mem[7] = 16'h7000; mem[8] = 16'h300a;
mem[9] = 16'h7000; mem[10] = 16'h5e93; mem[11] = 16'h372a;
mem[12] = 16'h56d3; mem[13] = 16'h7000; mem[14] = 16'h7000;
mem[15] = 16'h7000;// mem[15] = 16'h7000;
end
always @(posedge clk)
begin
if (!RW)
mem[address] <= Din; //(RW=0)write into memory
Dout <= mem[address]; //(RW=1)read from memory
end
endmodule"
not working for ise-9.1i
is there any other technique for this purpose.....................
"module blockram(clk, RW, address, Din, Dout);
input clk,RW;
input [11:00] address;
input [15:00] Din;
output [15:00] Dout;
reg [15:00] Dout;
reg [15:0] mem[0:15]; //declare memory
initial
begin
mem[0] = 16'h100a; mem[1] = 16'h200d; mem[2] = 16'h300c;
mem[3] = 16'h9005; mem[4] = 16'h300b; mem[5] = 16'h400d;
mem[6] = 16'h8800; mem[7] = 16'h7000; mem[8] = 16'h300a;
mem[9] = 16'h7000; mem[10] = 16'h5e93; mem[11] = 16'h372a;
mem[12] = 16'h56d3; mem[13] = 16'h7000; mem[14] = 16'h7000;
mem[15] = 16'h7000;// mem[15] = 16'h7000;
end
always @(posedge clk)
begin
if (!RW)
mem[address] <= Din; //(RW=0)write into memory
Dout <= mem[address]; //(RW=1)read from memory
end
endmodule"