Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to write different data to memory in different time?

Status
Not open for further replies.

now2

Newbie level 3
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

when will you instantate the UU module?
 

Re: HELP

Instead of $readmemh use $fopen your purpose will solved automatically.
BTW which compiler u are using ,
 

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

As i told earlier use $fopen .
please read the syntax of $fopen in Verilog 01 features , it will solve all your doubts.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top