now2
Newbie level 3
HELP
I want to write differnet data (AAA.dat, BBB.dat, CCC.dat) to memory in the different time.
In other words, the filename is a variable.
How to do it ???
What is the tpye of filename?
filename can be the module's input ?
module UU;
reg [3:0] MEM [0:9];
$readmemh(filename,MEM);
endmodule
module test;
initial begin
#1000;
filename = "AAA.dat";
#1000;
filename = "BBB.dat";
#1000;
filename = "CCC.dat";
end
endmodule
I want to write differnet data (AAA.dat, BBB.dat, CCC.dat) to memory in the different time.
In other words, the filename is a variable.
How to do it ???
What is the tpye of filename?
filename can be the module's input ?
module UU;
reg [3:0] MEM [0:9];
$readmemh(filename,MEM);
endmodule
module test;
initial begin
#1000;
filename = "AAA.dat";
#1000;
filename = "BBB.dat";
#1000;
filename = "CCC.dat";
end
endmodule