MyFPGA Forum

 找回密码
 注册
搜索
查看: 11013|回复: 8
打印 上一主题 下一主题

SGDMA問題

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-4 09:53:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近要使用ethernet的project 看到裡面使用了SGDMA去控制將資料存到RAM
去找了SGDMA controller core來看 還是不太董
如何在NIOS去下 IOWR IORD
上面列到的 Register MAP
32-bits word offset 有 base+0,   base+4,  base+8
                                  status       control   next_descriptor_pointer
假設status = 32''d7;
是下 IOWR (SGDMA_BASE, 0, status) 就控制現在狀態嗎?
而  IOWR (SGDMA_BASE, 4, control)就是下control?

後面又提到 DMA Descriptor Structure
Byte offset  |      field Name
base                  source
base+4             Reserved
..
只的是對裡面DMA的控制嗎? 又要怎樣去控制呢?
NIOS要如何下指令去控制 進來的DATA存到DRAM 請各位大大解答一下 謝謝~
2#
发表于 2010-1-4 11:57:32 | 只看该作者
本帖最后由 huguangheng 于 2010-1-4 12:16 编辑

1# ymwu

写指令描述符,规划描述符和数据收发区域,设定响应动作。。然后和DMA好像没什么特别的了。。
一下记不起来了。。。
在altera上搜索,很有几个sg_dma的范例
我当时看得那些。。。

sg-dma.zip 863k,这个官网的范例,里面的主函数里面有非常非常详细的解释
3#
发表于 2010-1-4 13:02:49 | 只看该作者
1# ymwu

写指令描述符,规划描述符和数据收发区域,设定响应动作。。然后和DMA好像没什么特别的了。。
一下记不起来了。。。
在altera上搜索,很有几个sg_dma的范例
我当时看得那些。。。

sg-dma.zip 863k,这个 ...
huguangheng 发表于 2010-1-4 11:57


sg-dma.zip 有下載點嗎??
4#
发表于 2010-1-4 13:34:55 | 只看该作者
3# Steady_Chou

WIKI上面直接搜索也有一个
我之前用的无线网,上传不了

sg-dma.zip

862.46 KB, 下载次数: 208

5#
 楼主| 发表于 2010-1-5 16:23:41 | 只看该作者
1# ymwu

写指令描述符,规划描述符和数据收发区域,设定响应动作。。然后和DMA好像没什么特别的了。。
一下记不起来了。。。
在altera上搜索,很有几个sg_dma的范例
我当时看得那些。。。

sg-dma.zip 863k,这个 ...
huguangheng 发表于 2010-1-4 11:57

sg-dma 裡面是StratixII,CycloneII感覺只是介紹此模組的功用
沒看到如何在 NISO下 command去控制說 還是有地方我沒看到呢?
感謝喔~
6#
发表于 2010-1-5 18:03:59 | 只看该作者
關於SGDMA 的使用, 可參考MyFPGA 裡的範例

http://www.myfpga.org/discuz/viewthread.php?tid=73&extra=page%3D1
7#
 楼主| 发表于 2010-1-20 15:50:55 | 只看该作者
範例是有用 SGDMA 可是對於還算新手的我  還是不太懂如何從 NIOS下command控制
如何construct SGDMA descriptors
是否要先DMA descriptors 在下control去控制 stream to memory
下了幾個控制 將Buf 的值搬到 Memory 一值有錯 應該是control & descriptors 位置有誤吧
可是卻不知如何著手 有沒有更簡單的範例呢? 單純的使用SGDMA (stream to memory)功能的
8#
 楼主| 发表于 2010-1-22 09:20:54 | 只看该作者
跟據所提供的example 下的command
receive_descriptors = (alt_sgdma_descriptor *) (DESCRIPTOR_MEMORY_S_BASE+96);
alt_avalon_sgdma_construct_stream_to_mem_desc(&receive_descriptors[0],  // descriptor
                                               &receive_descriptors[1], // next descriptor
                                               Buf_y,  // write buffer location
                                               1000,  // length of the buffer
                                               0); // writes are not to a fixed location
receive_DMA = alt_avalon_sgdma_open(SGDMA_RX_NAME);

/* Now start the SGDMA */
alt_avalon_sgdma_do_async_transfer(receive_DMA, &receive_descriptors[0]);
可是上一步卻沒start the SGDMA  是發生什麼問題呢 ?
有哪位大大能回答 謝謝
9#
发表于 2011-3-21 15:58:14 | 只看该作者
楼上的同学,问题解决了吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|MyFPGA

GMT+8, 2024-5-6 20:52 , Processed in 0.048477 second(s), 17 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表