完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我们有一个应用程序,我们使用32位GPIF总线从FPGA流数据。这很好,但是对于一些读取,我们想读取许多不是4倍数的字节。我们实验的一个是使用手动提交模式,如果我们想要的数据量不是4的倍数,那么修改缓冲区计数要少,以便截断不需要的额外字节。这当然比自动提交模式慢得多,而且不理想。有没有人能解决这个问题,还是每个人都只是以4字节的倍数读取数据?如果我想读510而不是512字节怎么办?
以上来自于百度翻译 以下为原文 We have an application where we're using the 32 bit gpif bus to stream data from an fpga. That works fine but for some reads, we'd like to read a number of bytes that are not a multiple of 4. One we we experimented with this is to use manual commit mode and if the amount of data we wanted is not a multiple of 4 then to modify the buffer count to be less in order to truncate the unneeded extra bytes. This of course is much slower than auto commit mode and not ideal. Does anyone have a solution to this problem or is everyone always simply reading data in multiples of 4 bytes? What if I wanted to read 510 instead of 512 bytes for instance? |
|
相关推荐
6个回答
|
|
你好,
您可以使用PKKED信号来实现这一点。如果写入FX3的字节数不是DMA缓冲区大小的倍数,则需要从FPGA声明此信号。在GPIFII设计器中的SLaveFIFO示例中查看此实现。只要pkEnter被声明,提交操作就完成。 实际上,这也会照顾到你的非4字节多个问题。 当做 沙肖克 以上来自于百度翻译 以下为原文 Hi, You could use the PKEND signal to accomplish this. You would need to assert this signal from the FPGA if the number of bytes written into FX3 is not a multiple of DMA buffer size. Take a look at this implementation in the slavefifo example in GPIFII designer. The COMMIT action is done whenever PKEND is asserted. This would, in effect, take care of your non 4-byte multiple issue as well. Regards Shashank |
|
|
|
我们将我们的GPIF设计从SLIFO示例开始,所以我们已经有了一个短包状态,当PKKADE被声明时,它有一个提交动作。我们使用它来发送更短的数据包,并且工作正常。我不知道这能如何处理4字节的问题。当数据总线被驱动时,我可以说它总是以4字节的倍数递增,因为在32位数据总线上有4个字节。我们如何告诉它只提交这些字节中的一个、两个或三个?在手动提交模式下,固件可以在传输结束时动态地改变计数,以将最后一个包截断到所需长度,但我仍然没有看到这样做的方法。也许我错过了GPIF状态机的一个重要特征?谢谢你的输入。
以上来自于百度翻译 以下为原文 We based our gpif design off the slfifo example to begin with so we already have a short packet state that has a COMMIT action when pktend is asserted. We use that to send shorter packets already and it works fine. I don't see how this can take care of the 4 byte problem though. When the data bus is driven as far as I can tell it always increments in multiples of 4 bytes since there are 4 bytes on the 32 bit data bus. How do we tell it to commit only one, two, or three of those bytes for instance? In MANUAL commit mode the firmware can change the count dynamically at the end of the transfer to truncate the last packet to the desired length but I still don't see a way to do this automatically. Perhaps I'm missing an important feature of the gpif state machine?? Thanks for your input. |
|
|
|
你好,
从CyPress那里检查GPIF II设计器,您可以更改总线长度并重新构建具有不同总线长度的GPIF配置描述符(8 / 16和32位是可能的)。 然后重新加载GPIF DISCRITPOR,当您喜欢使用其他加长。或者找出生成的GPIF描述符文件之间的差异,然后尝试是否可以切换寄存器值。 当做, 隆皮 以上来自于百度翻译 以下为原文 Hi, check GPIF II designer from cypress there you can change bus lenght and re-built your GPIF configuration descriptors with different bus length (8-/16- and 32-bit are possible). Then reload GPIF descritpor when you like to use other lengthen. Or find out the differences between the generated GPIF descriptor files and try if you can switch just the register values. regards, lumpi |
|
|
|
我知道如何切换巴士的大小。但如果我开关总线尺寸小于32位,然后我会限制我的数据传输速度。你是在暗示一种仍然使用32位的4字节的非多读或者你想加载不同的状态机?(对我来说听起来像后者)。
我想要做的是找到一种方法,不牺牲数据传输的速度,但还是要做一个非4字节的传输能力。我们已经有了这样的解决bulk_out转移因为FPGA是足够聪明,知道丢弃额外字节(我们说的传递长度)。这只不过是Bulkin的转会而已。偶然会setxfer功能这方面的帮助,如果我设定的交易长度的长度我们正在发送相反如果无限? 以上来自于百度翻译 以下为原文 I know how to switch the bus size. But if I switch the bus size less than 32 bits I'll then limit my data transfer speed. Are you suggesting a way to still use 32 bits for non multiple of 4 byte reads or are you suggesting loading a different state machine? (Sounds like the latter to me). What I want to do is find a way to not sacrifise data transfer speed but still have the ability to do a non multiple of 4 byte transfer. We already have this solved for BULK_OUT transfers because the fpga is smart enough to know to discard the extra bytes (we tell the length of the transfer). It's only for BULK_IN transfers. By chance would the SetXfer function help with this if I set the length of the the transaction to the length we were looking to transmit instead if infinite? |
|
|
|
你好,
我不太清楚最好的方法是什么。但是,如果您切换状态机,您可能需要处理DMA重置,…我在论坛上读到了一些关于这个问题的文章。我也认为,在这种情况下,您可能会非常动态地切换。 也许,最好的方法是使用32位模式,而只需使用主机侧需要的字节。就像你在FPGA上描述的那样。 当做, 隆皮 以上来自于百度翻译 以下为原文 Hi, I am not really sure what the best way is. But if you switch the state machines you may have to handle dma reset,... deeper and I read in the forum sometimes about some issues in this case. I also think you may like to switch very dynamically in this case. Perhaps, the best way is to use the 32-bit mode and you just use the bytes you need on host side. Alike you described it on the OUT transfer in the FPGA. regards, Lumpi |
|
|
|
谢谢你的回复。
我真正想要的是在不必使用不同的GPIF状态机的情况下这样做。就像拆掉DMA通道一样,在手动模式下再次创建它,当它处于手动模式时,我只截断该数据包。 在主机端做它是不理想的。我试图保持与旧版(FX2)的兼容性。主机软件在缓冲区中传递存储,并且在缓冲区的末尾没有额外的空间。我必须分配一个新的缓冲区,并在每次传输时复制数据。主机端有允许交互的用户空间库,所以我不能自己修改软件并用这种方式处理。 不管怎样,如果不能做到的话,我就按照我们的方式去做。SeHehank的帖子暗示你可以,但也许他没有正确地理解这个问题,或者我错过了一些重要的信息。 以上来自于百度翻译 以下为原文 Thanks for responding. What I'd really like is for a way to do this without having to use a different gpif state machine. As is tear down the dma channel and create it again in manual mode and when it's in manual mode I just truncate the packet. It's not ideal to do it on the host side. I'm attempting to maintain compatibility with an older board (fx2). The host software passes in the buffer to store the transfer and it doesn't have extra space at the end of the buffer. I'd have to allocate a new buffer and copy the data every transfer. The host side has user space libraries that allow interaction so I can't just modify the software myself and deal with it that way. Anyway, if it can't be done then I'll just deal with it the way we are. Sheshank's post above suggests you can but perhaps he didn't understand correctly the problem or I'm missing some important bit of information. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2075 浏览 1 评论
1829 浏览 1 评论
3645 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1766 浏览 6 评论
1517 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
522浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
376浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
414浏览 2评论
361浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
871浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 20:18 , Processed in 1.015047 second(s), Total 87, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号