L
linuxczar
Guest
hi everybody
i have some doubts in design of memory.i am learner .let me put
it clearly
aim is to design a ROM(already some data is stored) and access data
from that to another memory.
ROM function:
module rom(data,address);
output [7:0] data;
input [5:0] address;
reg [7:0] data;
always @(address)
begin
case (address)
5'd0 : data = 8'd0 ;
5'd1 : data = 8'd1 ;
5'd2 : data = 8'd2 ;
5'd3 : data = 8'd3 ;
5'd4 : data = 8'd4 ;
5'd5 : data = 8'd5 ;
5'd6 : data = 8'd6 ;
5'd7 : data = 8'd7 ;
5'd8 : data = 8'd8 ;
5'd9 : data = 8'd9 ;
5'd10 : data = 8'd10 ;
5'd11 : data = 8'd11 ;
5'd12 : data = 8'd12 ;
5'd13 : data = 8'd13 ;
5'd14 : data = 8'd14 ;
5'd15 : data = 8'd15 ;
5'd16 : data = 8'd16 ;
5'd17 : data = 8'd17 ;
5'd18 : data = 8'd18 ;
5'd19 : data = 8'd19 ;
5'd20 : data = 8'd20 ;
5'd21 : data = 8'd21 ;
5'd22 : data = 8'd22 ;
5'd23 : data = 8'd23 ;
5'd24 : data = 8'd24 ;
5'd25 : data = 8'd25 ;
5'd26 : data = 8'd26 ;
5'd27 : data = 8'd27 ;
5'd28 : data = 8'd28 ;
5'd29 : data = 8'd29 ;
5'd30 : data = 8'd30 ;
5'd31 : data = 8'd31 ;
endcase
end
endmodule
this is working fine
now another memory which access this ROM is
module axesrom(dataout,clk);
output [7:0] dataout;
input clk;
parameter x=5'd1;
integer i,j;
reg [4:0] addr;
always@(posedge clk)
for (i=0;i<=3;i=i+1)
begin
addr=x;
for (j=0;j<=3;j=j+1)
begin
rom r1(.data(dataout),.address(addr));
addr=addr+5'd8;
end
x=x+1;
end
endmodule
OUTPUT ----------identifir "rom" not defined
can anybody tell me why i am getting this?
i am using xilinx and modelsim
thanx and regards
gkreddybh
i have some doubts in design of memory.i am learner .let me put
it clearly
aim is to design a ROM(already some data is stored) and access data
from that to another memory.
ROM function:
module rom(data,address);
output [7:0] data;
input [5:0] address;
reg [7:0] data;
always @(address)
begin
case (address)
5'd0 : data = 8'd0 ;
5'd1 : data = 8'd1 ;
5'd2 : data = 8'd2 ;
5'd3 : data = 8'd3 ;
5'd4 : data = 8'd4 ;
5'd5 : data = 8'd5 ;
5'd6 : data = 8'd6 ;
5'd7 : data = 8'd7 ;
5'd8 : data = 8'd8 ;
5'd9 : data = 8'd9 ;
5'd10 : data = 8'd10 ;
5'd11 : data = 8'd11 ;
5'd12 : data = 8'd12 ;
5'd13 : data = 8'd13 ;
5'd14 : data = 8'd14 ;
5'd15 : data = 8'd15 ;
5'd16 : data = 8'd16 ;
5'd17 : data = 8'd17 ;
5'd18 : data = 8'd18 ;
5'd19 : data = 8'd19 ;
5'd20 : data = 8'd20 ;
5'd21 : data = 8'd21 ;
5'd22 : data = 8'd22 ;
5'd23 : data = 8'd23 ;
5'd24 : data = 8'd24 ;
5'd25 : data = 8'd25 ;
5'd26 : data = 8'd26 ;
5'd27 : data = 8'd27 ;
5'd28 : data = 8'd28 ;
5'd29 : data = 8'd29 ;
5'd30 : data = 8'd30 ;
5'd31 : data = 8'd31 ;
endcase
end
endmodule
this is working fine
now another memory which access this ROM is
module axesrom(dataout,clk);
output [7:0] dataout;
input clk;
parameter x=5'd1;
integer i,j;
reg [4:0] addr;
always@(posedge clk)
for (i=0;i<=3;i=i+1)
begin
addr=x;
for (j=0;j<=3;j=j+1)
begin
rom r1(.data(dataout),.address(addr));
addr=addr+5'd8;
end
x=x+1;
end
endmodule
OUTPUT ----------identifir "rom" not defined
can anybody tell me why i am getting this?
i am using xilinx and modelsim
thanx and regards
gkreddybh