- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to develop an IP that read a file which will be stored in the SDRAM and then send the data read. I've seen that we can read from the SDRAM with the IORD function but I prefer not to do it with the soft. What I am actually trying to do is to use a DMA to read the data. Is that possible ? How can I proceed ? Thanks !Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or maybe by using the flash memory (CFI) instead of the SDRAM ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do it many different ways. A couple of options:
1. Add an Avalon-MM Master port to your IP block. Your module would, for example, have a base address control register with the pointer to the file buffer you want to read. 2. Add an Avalon-MM Slave port to your IP block, and use an Altera DMA controller to execute the copy from the memory to your IP block. Here is one example from Altera which may be a useful illustration of a similar task: http://www.altera.com/support/examples/nios2/exm-checksum-acc.html- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your answer :)
--- Quote Start --- 2. Add an Avalon-MM Slave port to your IP block, and use an Altera DMA controller to execute the copy from the memory to your IP block. --- Quote End --- That's the option I've thought of. But as it will be in a file and not in a buffer, what is the address we need to give ? The one of the first word in the file ?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You would have to look at the specification for how the file is stored in SDRAM. However the file is getting placed into SDRAM, you need to understand that buffer layout and if it is broken up into multiple sections (pages) then you would need to DMA each of them separately.
If you're simply doing fopen() and fread() the entire contents of a file, then yes you simply supply the address of the first word in your buffer.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page