Mar 26, 2004 #1 N now2 Newbie level 3 Joined Mar 26, 2004 Messages 4 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 36 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
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
Mar 29, 2004 #2 G gentle_man Junior Member level 3 Joined Jan 6, 2004 Messages 31 Helped 1 Reputation 2 Reaction score 0 Trophy points 1,286 Activity points 196 HELP when will you instantate the UU module?
Mar 29, 2004 #3 S spauls Advanced Member level 2 Joined Dec 17, 2002 Messages 524 Helped 26 Reputation 52 Reaction score 9 Trophy points 1,298 Activity points 3,355 Re: HELP Instead of $readmemh use $fopen your purpose will solved automatically. BTW which compiler u are using ,
Re: HELP Instead of $readmemh use $fopen your purpose will solved automatically. BTW which compiler u are using ,
Mar 30, 2004 #4 N now2 Newbie level 3 Joined Mar 26, 2004 Messages 4 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 36 Re: HELP I use NC-verilog. module test; initial begin #1000; "I want to write AAA.dat to MEM" #1000; "I want to write BBB.dat to MEM" #1000; "I want to write CCC.dat to MEM" end I hope the AAA,BBB,CCC is variable. How should I write ??? Thanks !!
Re: HELP I use NC-verilog. module test; initial begin #1000; "I want to write AAA.dat to MEM" #1000; "I want to write BBB.dat to MEM" #1000; "I want to write CCC.dat to MEM" end I hope the AAA,BBB,CCC is variable. How should I write ??? Thanks !!
Apr 1, 2004 #5 S spauls Advanced Member level 2 Joined Dec 17, 2002 Messages 524 Helped 26 Reputation 52 Reaction score 9 Trophy points 1,298 Activity points 3,355 Re: HELP As i told earlier use $fopen . please read the syntax of $fopen in Verilog 01 features , it will solve all your doubts.
Re: HELP As i told earlier use $fopen . please read the syntax of $fopen in Verilog 01 features , it will solve all your doubts.