完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我是FPGA和VDHL的新手。 我跟他们打了几个月,我觉得我有基本的概念。 但是这个让我很困惑。 我有这两个过程: LED2Updating:进程(WCMDFlag,PushButton,ClearColCount) 开始 如果ClearColCount ='1'那么 ColCount'0'); 其他 如果PushButton ='0'那么 LED2'0'); 其他 如果rising_edge(WCMDFlag)那么 如果AddressBus(9 downto 0)= VarACol(9 downto 0)那么 ColCount 此过程监视总线,如果信号匹配,则LED2和更新CMDColAddrMatched信号应为1。 实际上,LED2实际上是开启的。 但对于这个过程: MatchCounterUpdate:process(UpdateCMDRowAddrMatched,UpdateCMDColAddrMatched,PushButton) 开始 如果PushButton ='0'那么 MatchCounter 只要UpdateCMDColAddrMatched信号打开,LED1就应该打开。 但事实并非如此。 LED1永远不会打开。 我认为逻辑非常简单。 如果LED2亮起,则更新CMDColAddrMatched应为1。 如果theUpdateCMDColAddrMatched为1,则LED1亮起。 但实际上,LED2已打开,但LED1不亮。 我不知道为什么它不像我预期的那样工作.. 请给我一些提示。 非常感谢你, 阿什利 以上来自于谷歌翻译 以下为原文 Hi all, I am new to FPGA and VDHL. I tackled with them for a couple months and I think I have the basic concept. But this one really confuse me. I have these two processes: LED2Updating : process (WCMDFlag, PushButton, ClearColCount)beginif ClearColCount = '1' thenColCount <= (others => '0');elseif PushButton = '0' thenLED2 <= '0';UpdateCMDColAddrMatched <= '0';ColCount <= (others => '0');else if rising_edge (WCMDFlag) thenif AddressBus(9 downto 0) = VarACol(9 downto 0) thenColCount <= ColCount + 1;else if AddressBus(9 downto 0) = CMDCol (9 downto 0) thenUpdateCMDColAddrMatched <= '1';LED2 <= '1';-- LED2else UpdateCMDColAddrMatched <= '0';end if;end if;end if;end if;end if;end process; This process monitor the bus and if the signal matches, the LED2 and the UpdateCMDColAddrMatched signal should be 1. And in reality, the LED2 is actually ON. But for this peice of process: MatchCounterUpdate : process (UpdateCMDRowAddrMatched, UpdateCMDColAddrMatched, PushButton)beginif PushButton = '0' thenMatchCounter <= InitMatchCounter;LED1 <= '0';-- LED1else if UpdateCMDColAddrMatched = '1' then LED1 <= '1';-- LED1if UpdateCMDRowAddrMatched = '1' thenMatchCounter <= conv_integer('0'&DataBus);LED <= DataBus(4 downto 0);else-- LED1 <= '0';end if;else-- LED1 <= '0';end if;end if;end process; The LED1 should be on as long as the UpdateCMDColAddrMatched signal is on. But it doesn't. The LED1 is never on. I think the logic is pretty simple. If the LED2 is on, then UpdateCMDColAddrMatched should be 1. And if the UpdateCMDColAddrMatched is 1, the LED1 is on. But in reality, the LED2 is on but the LED1 is not. I have no idea why it doesn't work as I expected.. Please give me some hint on it. Thank you very much, Ashley |
|
相关推荐
6个回答
|
|
您是否尝试过模拟代码?
在图形窗口中查看信号可以让您更好地了解发生了什么(或不发生),而不是茫然地看着代码行。 如果你还没有模拟你的代码,你可能会得到VHDL的基本概念,但你没有得到基本的工程概念,特别是测试和验证。 问候, 霍华德 ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 Have you tried simulating your code? Seeing the signals in a graphical window can give you a much better idea of what is going on (or not) than staring blankly at lines of code. If you have not simulated your code, you may be getting the basic concept of VHDL but you are not getting the basic concept of engineering, particularly test and verification. Regards, Howard ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
感谢您和hgleamon1的回复!
根据你的建议,我已经更新了我的代码并在ISim上进行了模拟。 现在两个进程的敏感性列表都是: MatchCounterUpdate:process(SDRAM_CLK,PushButton) ... LED2Updating:process(SDRAM_CLK,PushButton) ... 模拟与我的预期完全一样。 我强制WCMDFlag和AddressBus的值匹配我想要的。 然后我得到UpdateCMDColAddrMatched信号上的LED2为1.当SRDAM_CLK处于上升沿时,LED1变为1。 但是当我在我的真实设备上运行代码时,它的作用是相同的,这意味着LED2打开但不是LED1。 有什么想法吗? 以上来自于谷歌翻译 以下为原文 Thanks for your and hgleamon1's reply! According to your suggestion, I have updated my code and simulate it on ISim. Now both of the two processes' sensitivity list are: MatchCounterUpdate : process (SDRAM_CLK, PushButton)...LED2Updating : process (SDRAM_CLK, PushButton)...The simulation works exactly the same as I expected. I force the WCMDFlag and the AddressBus's value match what I want. Then I get the LED2 on UpdateCMDColAddrMatched signal is 1. And when the SRDAM_CLK is on raising edge, the LED1 becomes 1. But when I run the code on my real device, it acts the same, meaning the LED2 is on but not the LED1. Any thoughts? |
|
|
|
FPGA在另一台设备上安装,在我将程序下载到FPGA和另一台设备后,我不会触摸thePushButton而且我已经运行了很多次,所以它不会是一个去抖动的问题。
LED实现映射LED3,4,5,6。与LED1无关。 我不明白你对“达到地址总线匹配条件的速度有多快”的意思。 根据我的理解,只要地址总线条件匹配,那么LED2和UpdateCMDColAddrMatched信号应该同时打开。 但正如我所说,LED2已经开启而没有更新CMDColAddrMatched仍为0。 以上来自于谷歌翻译 以下为原文 The FPGA is mounter on another device and after I download my program to FPGA and another device, I won't touch the PushButton and I have run it many many times so it won't be a debouncing problem. The LED actuall maps the LED3, 4, 5, 6. No relationship with the LED1. I don't understand what you mean for the "how quickly the address bus match condition is reached". From my understanding, as long as the address bus condition is matched, then the LED2 and the UpdateCMDColAddrMatched signal should be on at the same time. But as I said, the LED2 is on without the UpdateCMDColAddrMatched is still 0. |
|
|
|
LED2打开时没有更新CMDColAddrMatched仍为0。
就像我说的,没有按钮,你就无法关闭LED2。 没有设置LED2的非复位条件 我真的不明白为什么,如果你想让LED2打开并且更新CMDColAddrMatched为'1'然后再亮LED1 ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 LED2 is on without the UpdateCMDColAddrMatched is still 0. Like I said, without the pushbutton, you have no way to turn LED2 off. There is no non-reset condition that sets LED2 <= '0'; I don't really understand why, if you want LED2 to be on and UpdateCMDColAddrMatched is '1' and then LED1 <= '1', the two LEDs aren't asserted in the same process .. ? ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
如果这是Xilinx板,则按下按钮时,按钮状态应为逻辑0。
这将导致您的代码不断强制LED1为0。 ------您是否尝试在Google中输入问题? 如果没有,你应该在发布之前。太多结果? 尝试添加网站:www.xilinx.com 以上来自于谷歌翻译 以下为原文 If this is a Xilinx board the push button state should be a logic 0 when then the button is not pushed. This would cause your code to continually force the LED1 to 0. ------Have you tried typing your question into Google? If not you should before posting. Too many results? Try adding site:www.xilinx.com |
|
|
|
这将导致您的代码不断强制LED1为0。
但这也应该导致LED2也为0,而OP说并非如此。 我不能以任何其他方式说出来,所以我再说一遍。 您引用的代码的结构方式是,一旦LED2为“1”,除了按钮之外没有任何方法可以将其关闭。 如果您说在操作过程中没有按下按钮,那么只要地址匹配,LED2就会永久亮起。 您之前提到过,您已将进程重写为与异步重置同步。 你能为他们发布完整的代码吗? 一般来说,如果模拟和现实之间存在不匹配,那么在综合过程中会出现意外情况,或者物理硬件(FPGA外部)与您的理解不符。 我会检查该模块的综合报告,看看所有信号都以您期望的方式处理。 问候, 霍华德 ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 This would cause your code to continually force the LED1 to 0. But this should also cause LED2 to be 0, too, which the OP says is not the case. I can't say it any other way, so I'll just say it again. The way the code you have quoted is structured, once LED2 is '1', there is no means, other than the push button, to turn it off. If you say you don't push the button during operation then as soon as the addresses match, LED2 comes on permanently. You mentioned previously that you had rewritten the processes to be synchronous with an asynchronous reset. Can you post the whole code for them? In general, if you have a mismatch between simulation and reality then either something unexpected has happened during synthesis or the physical hardware (outside the FPGA) does not match your understanding. I would check the synthesis report for this module to see that all signals are handled in the way that you expect. Regards, Howard ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
只有小组成员才能发言,加入小组>>
2429 浏览 7 评论
2831 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2298 浏览 9 评论
3378 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2468 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
1315浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
595浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
456浏览 1评论
2011浏览 0评论
737浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 22:08 , Processed in 3.886058 second(s), Total 85, Slave 69 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号