完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你没有说出你对event2做了什么不同,但我唯一看到的是,只要event1保持断言,overvoltage_ack只会高。
它基本上只是事件1延迟了一个时钟周期。 由于没有条件将overvoltage_ack保存到data_in中,因此您可以使用相同的功能。 即data_in将其LSB设置为与event1完全相同的时间量,仅延迟2个时钟周期。 您是否试图锁定事件条件并持有它直到某些软件有机会读取它? - Gabor 以上来自于谷歌翻译 以下为原文 You didn't say what you did differently with event2, but the only thing I see is that as posted, overvoltage_ack will only be high as long as event1 stays asserted. It is essentially just event1 delayed by one clock cycle. Since there's no condition for saving overvoltage_ack into data_in, you have the same thing there. i.e. data_in will have its LSB set for exactly the same amount of time as event1, just delayed by 2 clock cycles. Were you trying to latch the event condition and hold it until some software has a chance to read it? -- Gabor |
|
|
|
|
|
对不起,也许我太简化了。
FPGA从外部F-ram读取数据。 当读取完成时,更新脉冲发生1个时钟周期(在我的情况下为40 ns)Overvoltage_ack设置为“1”。 像这样的代码: if(rising_edge(clk_25MHz))然后 if(read_update ='1')然后 overvoltage_ack DATA_IN DATA_IN if(overvoltage_ack ='1')然后 overvoltage_ack:='0'; 万一; data_in 以下为原文 Sorry maybe I simplified it too much. FPGA reads data out of an external F-ram. When the read is complete an update pulse happens for 1 clock cycle(40 ns in my case) Overvoltage_ack is set to '1'. Code like this: if(rising_edge(clk_25MHz)) then if(read_update ='1') then overvoltage_ack <= '1'; end if; if(read_update2 = '1') then powerlevel_ack <= '1'; end if; case(STATE) is when powerlevel_state => data_in <= X"00" & powerlevel_ack ; if(powerlevel_ack ='1') then powerlevel_ack ='0'; end if; STATE <= WAIT_FOR_1SECOND; when overvoltage_state => data_in <= X"00" & overvoltage_ack ; if(overvoltage_ack ='1') then overvoltage_ack ='0'; end if; STATE <= WAIT_FOR_1SECOND; end case; end if; Alright so I have a block ram and i Write to different addresses. DATA_IN when I am writing the Powerlevel state will write a '1' in LSB if ACK is set high. I am guessing that the Powerlevel_ack Flip flop is closer to the input of the Block ram? When Overvoltage_ack is set to '1' and is in the overvoltage_state DATA_IN stays zero. It as if overvoltage_ack is a variable and then sent to the DATA_IN. Like this code: when overvoltage_state => if(overvoltage_ack ='1') then overvoltage_ack :='0'; end if; data_in <= X"00" & overvoltage_ack ; STATE <= WAIT_FOR_1SECOND; I would expect this behavior: Overvoltage_ack is '1' When rising edge happens: Data_in becomes X"00" & '1'; Overvoltage_ack changes from '1' to '0'; Then when I come into this state again: Overvoltage_ack is '0' when rising edge happens: Data_in becomes X"00" & '0'; Overvoltage_ack does not change. I hope this explains it better. Sorry if it is too simplified. My code is very complex. (This is what happens when you try to develop a product to SIL 4 safety level and designing all the filters and signal processing algorithms by hand :(. We have no DSP slices and are not using Simulink/system generator. We can't use a processor because than the project becomes twice the cost and harder to become SIL4. This is just to share some safety fun! ) |
|
|
|
|
|
基本上:
过压状态在我的代码中每66.56 uSeconds发生一次。 发生更新事件并将overvoltage_ack设置为“1”; 然后 Data_in 以下为原文 Basically : the overvoltage state Happens every 66.56 uSeconds in my code. Update event happens and sets overvoltage_ack to '1'; Then Data_in <= X"00" & overvoltage_ack ; if(overvoltage_ack ='1') then overvotlage_ack <= '0'; end if; Then it should write X"00" & '1' to the block ram and reset overvoltage_ack so that in 66.56 uSec it will write X"00" & '0' to the block ram. Powerlevel state happens every 4.16 uSec. That is only difference in code. |
|
|
|
|
|
一些随机评论:
if(read_update ='1')然后 overvoltage_ack 万一; 信号“read_update”是与时钟同步还是异步? 如果是异步,则需要同步。 if(powerlevel_ack ='1')然后 powerlevel_ack ='0'; 万一; 这可以简化为: powerlevel_ack ='0'; - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 Some random comments: if(read_update ='1') then overvoltage_ack <= '1'; end if; Is the signal "read_update" synchronous to the clock, or async? If async, it needs to be synchronised. if(powerlevel_ack ='1') then powerlevel_ack ='0'; end if; This can be simplified as: powerlevel_ack ='0'; -- Bob Elkind SIGNATURE: README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369 Summary: 1. Read the manual or user guide. Have you read the manual? Can you find the manual? 2. Search the forums (and search the web) for similar topics. 3. Do not post the same question on multiple forums. 4. Do not post a new topic or question on someone else's thread, start a new thread! 5. Students: Copying code is not the same as learning to design. 6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please). 7. You are not charged extra fees for comments in your code. 8. I am not paid for forum posts. If I write a good post, then I have been good for nothing. |
|
|
|
|
|
你有没有模拟这段代码?
我猜你还没有发布你的问题所涉及的一切。 例如,如何使用data_in编写BRAM? 鉴于看起来data_in只会在其LSB中设置标志1个时钟周期,如果你太快或太晚写RAM,它将不会看到1。 - Gabor 以上来自于谷歌翻译 以下为原文 Have you simulated this code? I'm guessing that you still haven't posted everything that is involved in your problem. For example how do you write the BRAM with data_in? Given that it looks like data_in will only have the flag set in it's LSB for 1 clock cycle, if you write the RAM too soon or too late it won't see that 1. -- Gabor |
|
|
|
|
|
是的,两个更新都与时钟同步。
是的,你实际上对简化是正确的。 以上来自于谷歌翻译 以下为原文 Yes both updates are syncronized to the clock. Yes you are actually right about the simplification. |
|
|
|
|
|
我没有模拟代码,因为它涉及从外部框架读取和写入以及通过我用另一个FPGA设计的uart进行通信。
我在6个月前模拟了通信,效果很好。 我有一个用户界面(旧学校3位7段显示),用于更改功率设置和过压容差。 更改设置时,会将值写入Fram。 这一切都很好,花花公子,直到我第二次尝试写。 对于功率设置,它工作正常,对于过压设置,它不接受第二个值。 这是因为Ack信号没有通过我的界面传输。 我的问题是: 如果您的块ram正在关闭CLK_A。 如果您的进程正在运行CLK_A。 如果你有这个if语句: if(ACK ='1')然后 DATA_IN 以下为原文 I have not simulated the code because it involves reading and writing from an external fram and communication over a uart i designed with another FPGA. I simulated the Communications about 6 months ago and it works well. I have a user interface (Old school 3 digit 7 segment display) that is used to change power setting and and Overvoltage tolerance. When a setting is changed it writes the value to the Fram. It all works fine and dandy until I try write a second time. For the power setting it works fine, for the over voltage setting it doesn't accept a second value. It is because the Ack signal is not being transmitted across my interface. My question is this: if your block ram is running off CLK_A. if your process is running off CLK_A. if you have this if statement: if(ACK= '1') then DATA_IN <= ACK; ACK <= '0'; end if; In what way can DATA_IN remain zero? I.e. somehow ACK is set zero before DATA_IN is set. How can DATA_IN be '0'? How is that possible? Correct me if I am wrong, DATA_IN should be a snapshot of ACK? So if I waited to turn on WE 3 clock cycles later it shouldn't matter? DATA_IN is a register (flip flop in this example) and I dont' change the register for a long period of time. |
|
|
|
|
|
csholikowski写道:
我还没有模拟代码,因为...... 我的问题是: 如果您的块ram正在关闭CLK_A。 如果您的进程正在运行CLK_A。 如果你有这个if语句: if(ACK ='1')然后 DATA_IN 1)没有理由不模拟代码。 如果您的系统很大,您可以模拟单个模块。 2)当前问题中的代码应设置DATA_IN并保持高位。 但是,此代码与您之前发布的代码不匹配。 在早期版本的代码中,对DATA_IN的赋值不在if语句中。 - Gabor 以上来自于谷歌翻译 以下为原文 csholikowski wrote:1) There's no excuse for not simulating the code. If your system is large, you can simulate individual modules. 2) The code in your current question should set DATA_IN and it should stay high. However this code does not match the code you posted earlier. In the earlier version of the code, the assignment to DATA_IN was not inside the if statement. -- Gabor |
|
|
|
|
|
csholikowski写道:
我没有模拟代码,因为它涉及从外部框架读取和写入以及通过我用另一个FPGA设计的uart进行通信。 您可以编写FRAM的总线功能模型。 那应该不会太难。 也许有人已经写了一个? 您也可以为通信链接建模,而不会有太多复杂的问题。 总之,总线功能,不一定是可综合的逻辑。 ----------------------------是的,我这样做是为了谋生。 以上来自于谷歌翻译 以下为原文 csholikowski wrote:You can write a bus-functional model of the FRAM. That shouldn't be too hard. Perhaps someone's already written one? You can model the communications link, too, without too much complication. Again, bus functional, doesn't have to be synthesizable logic. ----------------------------Yes, I do this for a living. |
|
|
|
|
只有小组成员才能发言,加入小组>>
3142 浏览 7 评论
3436 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2897 浏览 9 评论
4097 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
3082 浏览 15 评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
1359浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
1196浏览 1评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 12:54 , Processed in 0.851011 second(s), Total 91, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1488
