- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to add a new module.Gernerally saied , it is a RAM , 128-bit-wide( that means 1 Word = 128 Bit), 512Word.
I also add a NIOS II Processor, and try to read a Word from th RAM in software. As far as I know , we usually use NIOS to read 32-bit-wide data, or less , for example , IORD( XX_BASE , 0) , for NIOS Processor is 32-bit-wide. Can NIOS read 128-bit-wide data when it accesses the RAM?How can I write the software to do that? Thank you!Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can NIOS read 128-bit-wide in one access to the RAM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No. NIOS has a 32-bit wide data bus. If you perform a 128-bit read, the NIOS will actually perform 4 reads to get the data.
Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- No. NIOS has a 32-bit wide data bus. If you perform a 128-bit read, the NIOS will actually perform 4 reads to get the data. Jake --- Quote End --- So , what if I use a DMA component to read 128-bit-wide data? For example : //////// Code start////////////# define TRANSFER_SIZE 2 int return_code ; alt_dma_rxchan tx, rx ; if( (tx= alt_dma_txchan_open("/dev/dma")) == 0 ) { printf( "create dma failed" ) ; return -1 ; } if( (rx= alt_dma_rxchan_open("/dev/dma")) == 0 ) { printf(" create dma failed" ) ; return -1 ; } //// configure the DMA alt_dma_txchan_ioctl( tx , ALT_DMA_SET_MODE_128 , (void*) (RAM_BASE) ) ; alt_dma_rxchan_ioctl( rx , ALT_DMA_SET_MODE_128 , (void*)(DEST_BASE) ) ; ///// start transfer return_code = alt_dma_txchan_send( tx , RAM_BASE , TRANSFER_SIZE , 0 , 0 ) ; return_code = alt_dma_rxchan_prepare( rx , DEST_BASE , TRANSFER_SIZE , 0 , 0 ) ; //////// Code end Could I make it work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What exactly is your requirement?
If your requirement is that you must read a 128-bit data word in one clock cycle then you are going to have to either use a DMA controller or write your own little hardware component to do it. If you're just trying to be efficient, using a DMA controller may not be the best solution if at the end of the day you've got to read the data using the NIOS anyway. Typically DMA is used when you need to transfer a large amount of data in as short amount of time as possible. Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply.
Nowadays I know using Nios to read directly is efficient rather than DMA. I will try more.
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