FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-04-2006, 03:53 AM
Ganesh
Guest
 
Posts: n/a
Default Reading Large Files Using $readmemh

Hi,

Is there any way to know at run-time whether a file read using
$readmemh has been successful or not? Does it have a return value?

Also, is there a limit to the size of the file which can be read by
$readmemh in NCSim?

I have a huge memory array (256 MB) to be initialized and an
appropriate sized file for reading through $readmemh. NCSim appears to
execute the $readmemh and continues the simulation, but the memory is
not initialized. The statement executes correctly if I fill 2-3 MB of
the memory array initially, and use the rest of the memory array
locations during run time for other purposes. For one of the runs, I
need to initialize all the 256 MB, but $readmemh is turning out to be a
stumbling block.

Any help would be greatly appreciated.

Thanks & Regards
Ganesh

Reply With Quote
  #2 (permalink)  
Old 04-04-2006, 07:48 PM
Ajeetha
Guest
 
Posts: n/a
Default Re: Reading Large Files Using $readmemh

Interesting simultaneous posts on $readmemh on huge mem + NCSIM. Davy
also had some questions on that in other thread.

In your case, how about:

1. Split your 256 MB file to say 128 files of 2 MB each (sure too many,
but what ever loads cleanly)
2. Use $readmemh with start_addr, end_addr (Google search might help or
LRM)
3. Create your file names in a loop using $sformat
4. Load 128 files

Tell us how it goes - if you care to!

Regards
Ajeetha, CVC
www.noveldv.com

Reply With Quote
  #3 (permalink)  
Old 04-04-2006, 08:51 PM
[email protected]
Guest
 
Posts: n/a
Default Re: Reading Large Files Using $readmemh

$readmemh does not have a return value. However, it should print out
warnings if it failed for some reason, such as not finding the file, or
the file ending before the full memory was filled.

There should not be a limit to the size of the file that can be read by
$readmemh in NCSim. If the file is larger than 4G (or maybe 2G), your
file system needs to be set up to support large files. If you can look
at the file and it is all there, then presumably that is fine.

I just tested versions 5.5 and 5.6 using $readmem to read 256MB (both
as 8bitx256M and 32bitx64M). I did tests on both Sun and Linux
systems. It appeared to work fine.

You should file a bug report, or at least provide me with more detail
about what you were doing (version, platform, testcase).

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading files in multiple instances of a ROM model [email protected] Verilog 5 06-13-2005 09:04 AM
Modeling large memories in Verilog TMU Verilog 4 06-10-2005 02:02 AM
Trouble with $readmemh in ModelSim Chris Carlen Verilog 9 07-02-2004 02:25 AM
How to make assign with large delay? Patrick Phung Verilog 2 11-05-2003 10:05 PM
What's the format of multidimensional data file for $readmemh? Peng Yu Verilog 3 07-31-2003 12:13 AM


All times are GMT +1. The time now is 02:13 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved