reading a file in verilog

V

veeru

Guest
Hello,
I am writing code for text compression in verilog.
I am struck at initial phase.
How can i read a long text file in verilog , other than using the
{readmemh} statement.
because it has the limitation of perticular memory size.but I want to
read a text file of 156kB.

I used the c=$fgetc( fp) statement but it is showing error that

Name 'fgetc' could not be resolved
Illegal right hand side of blocking assignment

Please give some suggestion

Thanks
Sagar
 
On Thu, 17 Apr 2008 23:27:48 -0700 (PDT), veeru <sagarnitr@gmail.com>
wrote:

Hello,
I am writing code for text compression in verilog.
I am struck at initial phase.
How can i read a long text file in verilog , other than using the
{readmemh} statement.
because it has the limitation of perticular memory size.but I want to
read a text file of 156kB.
Try $fopen and $fscanf.
 
On Apr 18, 2:27 am, veeru <sagarn...@gmail.com> wrote:
I used the c=$fgetc( fp) statement but it is showing error that

Name 'fgetc' could not be resolved
Illegal right hand side of blocking assignment
Verilog-2001 added general purpose file I/O. However, if $fgetc is
not being resolved, that implies that your simulator does not support
it. It is possible that a command line switch is required to turn on
the 2001 features. You should check your simulator documentation.

If your simulator does not support file I/O, you can try doing a web
search for Chris Spears' PLI implementation of file I/O system tasks.
 

Welcome to EDABoard.com

Sponsor

Back
Top