完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我注意到访问 ESP 的 I/O 寄存器时有一种奇怪的行为 - 尤其是 SPI FIFO 注册器SPI_W0。15.
I need to fill the FIFO as fast as possible so I ended up using "pure" asm to squeeze the max out of it. I'm using a "plain" RAM to FIFO copy, and the CCOUNT register to count the cycles needed to complete the action. Here is the "main" code snippet (tmr hold the cycles count at the end): uint32 spiFIFO[16]; asm volatile ( "l32i.n %0, %2, 0 rn" // this is here to preload the registers with correct address so to count only cycles needed to actually transfer data from RAM to FIFO "l32i.n %0, %3, 0 rn" "rsr.ccount %1 rn" "l32i.n %0, %2, 0 rn" // this line and "s32i.n %0, %3, 0 rn" // this one are a "move pair", moving one DWORD from RAM to FIFO "l32i.n %0, %2, 4 rn" "s32i.n %0, %3, 4 rn" "l32i.n %0, %2, 8 rn" "s32i.n %0, %3, 8 rn" "l32i.n %0, %2, 12 rn" "s32i.n %0, %3, 12 rn" ... // "pairs" are repeated for various tests "rsr.ccount %0 rn" "sub %1, %0, %1 rn" : "=&r"(data),"=&r"(tmr):"r"(spiFIFO),"r"(SPI_W0(ESP_SPI_HSPI))); 所以,这是一件奇怪的事情: 5 对 = 11 个周期 (10 L32I/S32i RSR),看起来很棒 8 对 = 17 个周期再次很棒 10 对 = 28 个周期减速 - 1.4 cy/inst 12 对 = 51 个周期 16 对 = 64 个周期- 慢了2倍?! 为什么??或者更好 - 如何避免这种情况? It seems like some sort of "cache overrun" but the statement "ESP has no caches" is everywhere in the forum(s)... 读数 the FIFO register (or GPIO) is "constantly slow" - 12 cycles for a single l32i read instruction 有什么提示吗? |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
540浏览 6评论
453浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
434浏览 5评论
436浏览 4评论
409浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-17 19:24 , Processed in 0.815553 second(s), Total 75, Slave 58 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号