reading and writing a text file in verilog

Status
Not open for further replies.

praveenvanaparthy

Newbie level 6
Joined
Jun 19, 2011
Messages
14
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Activity points
1,376
hi ..
i have a problem of read&write text/doc files in verilog.

i want to read in.txt file and write the data into out.txt .

am using $readmemb("in.txt",w);
and $fopenr("in.txt");
and for writing i open a file=$fopen("out.txt");

the program shows errors.
am write one separate prog for reading, its working.
but i didn't get how to write the same data into other file.

could you give some suggestions and examples.
 

If you are just looking to read in a memory and then write it out, use

$readmemb("in.txt",w);
$writememb("out.txt",w);

If you are getting errors, you need to tell people exactly what those errors are for people to help you.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…