Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Read file by NIOS

Hi guys,

Finally I could program NIOS to read and write a file from the host computer with fread and fwrite instruction (in debug mode). However, it's awfully slow. For instance, reading a 5MB image from the host computer takes more than 20 minutes! Any idea to fasten the process?

Thanks in advance!

Abbas

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    That means about 4KB/s. I don't have any information of host-based filesystem performance, but I guess it could be a reasonable figure, especially if you use fread and fwrite calls with single byte or a few bytes. If this is your case, try the same file transfer by packing long byte streams into a single call.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Probably the only way to get a real performance increase it to utilize a different interface, if you have one available. i.e. PCIe, or Ethernet. You could use Altera's TSE (or opencores, etc) to transfer the file to the local filesystem/memory.