完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
我试图在Spartan 3e启动板上实现一个简单的双向引脚模块。
行为模拟(ISim)工作正常但后期翻译没有。输入而不是跟随双向引脚,在后转换模拟中变为常数1'bx。 合成期间我没有收到任何警告。 码: `timescale 1ns / 1ps 模块bidir_pin(IN1,PIN,OUT1,OE); 输出线IN1; //从模块向FPGA发出信号 输入密码; //由PIN表示的双向端口 输入OUT1; //从FPGA发送信号到BusPin模块 输入OE; //控制信号确定BusPin方向 分配PIN = OE? OUT1:1'bZ; 分配IN1 = PIN; // buf i_buf(IN,PIN); // bufif1 o_buf(PIN,OUT,OE); endmodule (我已经尝试过这里显示的两种实现;两者都给我同样的问题) 行为(顶部)和翻译后(底部)模拟在这里: 关于翻译后模拟的注意事项,当它应该跟随PIN时,IN1是一个常数1'bx。我已经查看了RTL原理图,据我所知,它看起来是正确的: 我也尝试锁定PIN,然后将其发送到IN1,我也遇到了同样的问题: 任何人都可以弄明白发生了什么? 如果有帮助,这是我的未锁定版本的测试平台。 `timescale 1ns / 1ps bidir_pin_test模块; //输入 reg OUT1 = 1; reg OE; reg SEL = 1; reg INPUT = 0; //输出 电线IN1; //比迪 线PIN; //实例化被测单元(UUT) bidir_pin uut( .IN1(IN1), .PIN(PIN), .OUT1(OUT1), .OE(OE) ); 分配PIN = SEL? 输入:1'bz; 最初开始 //初始化输入 OE = 0; //等待100 ns以完成全局重置 #100; #100 SEL = 0; #100 OE = 1; //在这里添加刺激 结束 endmodule 谢谢。 `timescale 1ns / 1psmodule bidir_pin(IN1,PIN,OUT1,OE); 输出线IN1; //从模块向FPGA内输出信号; //由PIN输入OUT1表示的双向端口; //从FPGA发信号到BusPin模块输入OE; //控制信号确定BusPin方向分配PIN = OE? OUT1:1'bZ; 分配IN1 = PIN; // buf i_buf(IN,PIN); // bufif1 o_buf(PIN,OUT,OE); endmodule 以上来自于谷歌翻译 以下为原文 I am trying to implement a simple bidirectional pin module on the Spartan 3e starter board. The behavioural simulation (ISim) works fine but the post translate doesn't.The input, instead of following the bidirectional pin, becomes a constant 1'bx in the post translate simulation. I don't get any warnings during synthesis. Code: `timescale 1ns / 1psmodule bidir_pin( IN1, PIN, OUT1, OE); output wire IN1; // signal from module into FPGA inout PIN; // bi-directional port represented by PIN input OUT1; // signal from FPGA into BusPin module input OE; // control signal determining BusPin directionassign PIN = OE ? OUT1 : 1'bZ;assign IN1 = PIN ;//buf i_buf ( IN, PIN); //bufif1 o_buf ( PIN, OUT, OE ); endmodule (I've tried both implementations shown here; both give me the same problem) The behavioural (top) and post translate (bottom) simulation are here: notice for the post-translate simulation, IN1 is a constant 1'bx when it should be following PIN.I've looked at the RTL schematic and as far as I know it looks correct: I also tried to latch PIN, and then send it to IN1, and I get the same problem: Can anyone figure out what's going on? Here is my testbench for the un-latched version if that helps. `timescale 1ns / 1psmodule bidir_pin_test;// Inputsreg OUT1=1;reg OE;reg SEL = 1;reg INPUT = 0;// Outputswire IN1;// Bidirswire PIN;// Instantiate the Unit Under Test (UUT)bidir_pin uut (.IN1(IN1), .PIN(PIN), .OUT1(OUT1), .OE(OE));assign PIN = SEL ? INPUT : 1'bz;initial begin// Initialize InputsOE = 0;// Wait 100 ns for global reset to finish#100; #100 SEL = 0;#100 OE = 1;// Add stimulus hereend endmodule Thanks. `timescale 1ns / 1ps module bidir_pin( IN1, PIN, OUT1, OE); output wire IN1; // signal from module into FPGA inout PIN; // bi-directional port represented by PIN input OUT1; // signal from FPGA into BusPin module input OE; // control signal determining BusPin direction assign PIN = OE ? OUT1 : 1'bZ; assign IN1 = PIN ; //buf i_buf ( IN, PIN); //bufif1 o_buf ( PIN, OUT, OE ); endmodule |
|
相关推荐
14个回答
|
|
我发现了问题:在Design Properties-> Preferred Language下,我不小心把它作为默认值(VHDL)。
当我将其更改为Verilog时,双向引脚按预期工作。 无论是.BF文件中的“B4”还是B4都没有什么区别。 感谢Bob和mcgett的回复。 在原帖中查看解决方案 以上来自于谷歌翻译 以下为原文 I found the problem: Under Design Properties->Preferred Language, I had accidentally left it as the default (VHDL). When I change it to Verilog the bidirectional pin works as expected. Whether it is "B4" or B4 in the .UCF file did not make a difference. Thanks Bob and mcgett for the replies. View solution in original post |
|
|
|
您的测试平台正在驱动PIN(SEL = 0),其值为INPUT(始终为0),并且您的模块也在使用OUT1(始终为1)的值驱动PIN,从而产生争用并导致模拟中的X状态。
------您是否尝试在Google中输入问题? 如果没有,你应该在发布之前。太多结果? 尝试添加网站:www.xilinx.com 以上来自于谷歌翻译 以下为原文 Your testbench is driving PIN (SEL=0) with the value of INPUT (always 0) and your module is also driving PIN with the value of OUT1 (always 1) generating contention and resulting in a X state in simulation. ------Have you tried typing your question into Google? If not you should before posting. Too many results? Try adding site:www.xilinx.com |
|
|
|
嗨mcgett,
谢谢你的回复,但我认为你错了。 在我的模块中,我将IN1定义为模块的输出,将OUT1定义为输入。 因此,当SEL = 1时,我正在使用我的测试平台驱动PIN,当OE = 1时,我正在使用模块驱动PIN。 SEL和OE同时从不高,所以我没有看到任何问题。 以上来自于谷歌翻译 以下为原文 Hi mcgett, Thanks for your reply, but I think you're mistaken. In my module I've defined IN1 as the output of my module and OUT1 as the input. So when SEL = 1 I'm driving PIN it with my testbench, and when OE = 1 I'm driving PIN with the module. SEL and OE are never high at the same time, so I don't see any problem there. |
|
|
|
你在查看条件赋值语句时犯了错误。
好的,再次阅读原始帖子后,当您使用行为代码进行模拟时,似乎一切都很顺利,并且问题仅出现在翻译后模拟中。 这是合成后的吗? 还是地图? 或者布局和路线? 查看您的转换波形,PIN标签现在是PIN [0:0]为什么会发生这种情况? 您是否查看了综合工具中的警告消息? 想到的一件事是,由于顶级或合成选项中的某些内容,您以某种方式定义的双向引脚未转换为IOBUF单元。 ------您是否尝试在Google中输入问题? 如果没有,你应该在发布之前。太多结果? 尝试添加网站:www.xilinx.com 以上来自于谷歌翻译 以下为原文 You're right my made a mistake when looking at the conditional assignment statements. Ok, after reading your original post again it appears that all is well when you are simulating with the behavioral code, and that the problem is only present in the post translate simulation. Is this after synthesis? or map? or place and route? Looking at your translate waveforms the PIN label is now PIN[0:0] why is this happening? Have you reviewed the WARNING messages from the synthesis tool? The one thing that comes to mind is that the bi-directional pin that you defining somehow wasn't translated to an IOBUF cell due to something in your top level or a synthesis option. ------Have you tried typing your question into Google? If not you should before posting. Too many results? Try adding site:www.xilinx.com |
|
|
|
后期翻译是在合成之后。
当我进行后映射和后置放置和路由模拟时,结果与我发布的后置转换模拟波形相同。 无论如何,我认为只能按顺序进行综合,翻译,地图,布局和布线? 我不知道为什么PIN会变成PIN [0:0]。 在我的测试平台中,我初始化了INPUT = 0等,我改为INPUT = 1'b0等 - 相同的结果。 你认为这表明了什么吗? 我没有收到任何警告。 bidir_pin模块是此项目中唯一的模块。 我的所有选项都设置为默认值。 哪种选择与此案有关? 我想知道它是否与用户约束文件有关? 我只对PIN有限制,我尝试了以下两种方法: NET“PIN”LOC =“B4”| IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 6; 和 NET“PIN”LOC =“B4”| IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 8; (根据Spartan 3e入门板用户指南,B4是“真正的双向IO引脚”) 以上来自于谷歌翻译 以下为原文 The post-translate was right after synthesis. When I do post-map and post-Place and Route simulations the result is the same as the post-translate simulation waveform that I posted. Anyway, I thought it was only possible to do Synthesis, Translate, Map, Place and Route, in that order? I don't know why PIN turns into PIN[0:0]. In my testbench I had initialized INPUT = 0, etc, which I changed to INPUT = 1'b0, etc --- same result. Do you think this indicates something? I don't get any warnings. The bidir_pin module is the only module in this project. All of my options are set to the default. Which options are relevant for this case? I wonder if it has something to do with the user constraints file? I only have a constraint for PIN, and I've tried both of the following: NET "PIN" LOC = "B4" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 6 ; and NET "PIN" LOC = "B4" | IOSTANDARD = LVCMOS33 | SLEW = FAST |DRIVE = 8 ; (According to the Spartan 3e starter board user guide, B4 is a "true, bidirectional IO pin") |
|
|
|
建议您将“PIN”重命名为其他名称,例如“TESTPIN”。
如果存在对“PIN”的无意重复引用,则更改设计中的引脚名称应该“清除”这样的重复引用。 仅更改.UCF文件和顶级源代码文件。 这可能无法找到问题,但这是一个非常快速和简单的实验尝试。 - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 Suggest you rename "PIN" to something else, for example "TESTPIN". If there is an inadvertent duplicate reference to "PIN", changing the pin name in your design should 'flush out' such a duplicate reference. Change only the .UCF file and the top-level source code file. This may not locate the problem, but it is a very quick and easy experiment to try. -- 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. |
|
|
|
我得到了与之前完全相同的结果(包括在翻译后模拟中将TESTPIN更改为TESTPIN [0:0])。
以上来自于谷歌翻译 以下为原文 I get exactly the same result as before (including TESTPIN being changed to TESTPIN[0:0] on the post-translate simulation). |
|
|
|
下一个请求:请发布您当前的(未修改的).UCF文件。
- 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 next request: please post your current (unmodified) .UCF file. -- 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. |
|
|
|
NET“TESTPIN”LOC =“B4”|
IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 8; // NET“PIN”LOC =“B4”| IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 6; 这就是整个.ucf。 我尝试了同样的结果。 以上来自于谷歌翻译 以下为原文 NET "TESTPIN" LOC = "B4" | IOSTANDARD = LVCMOS33 | SLEW = FAST |DRIVE = 8 ;//NET "PIN" LOC = "B4" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 6 ; That's the entire .ucf. I tried both with the same reults. |
|
|
|
尝试使用“#”作为注释行而不是“//”
“//”应该可以正常工作,但我迫切需要解释。 - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 Try using "#" for comment lines instead of "//" "//" should work OK, but I'm desperate for an explanation. -- 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. |
|
|
|
除了注释外,我还尝试删除未使用的行,并得到相同的结果。
以上来自于谷歌翻译 以下为原文 In addition to commenting out, I also tried deleting the line that was not being used, and got the same result. |
|
|
|
在我的.UCF中,我的引号中没有引脚位置。
NET“TESTPIN”LOC = B4 | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 8; - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 In my .UCFs, I don't have pin location in quotation marks. NET "TESTPIN" LOC = B4 | IOSTANDARD = LVCMOS33 | SLEW = FAST |DRIVE = 8 ; -- 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. |
|
|
|
我发现了问题:在Design Properties-> Preferred Language下,我不小心把它作为默认值(VHDL)。
当我将其更改为Verilog时,双向引脚按预期工作。 无论是.BF文件中的“B4”还是B4都没有什么区别。 感谢Bob和mcgett的回复。 以上来自于谷歌翻译 以下为原文 I found the problem: Under Design Properties->Preferred Language, I had accidentally left it as the default (VHDL). When I change it to Verilog the bidirectional pin works as expected. Whether it is "B4" or B4 in the .UCF file did not make a difference. Thanks Bob and mcgett for the replies. |
|
|
|
VHDL / Verilog更改修复问题似乎有点奇怪。
我并不感到惊讶的是,UCF没有任何效果,因为它不应该与模拟方面有任何关系。 ------您是否尝试在Google中输入问题? 如果没有,你应该在发布之前。太多结果? 尝试添加网站:www.xilinx.com 以上来自于谷歌翻译 以下为原文 Seems a bit weird that the VHDL/Verilog change fixed the problem. I'm not surprised that the UCF had no effect as it shouldn't for anything related to the simulation aspects. ------Have you tried typing your question into Google? If not you should before posting. Too many results? Try adding site:www.xilinx.com |
|
|
|
只有小组成员才能发言,加入小组>>
2384 浏览 7 评论
2800 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2264 浏览 9 评论
3336 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2431 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
757浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
547浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
369浏览 1评论
1965浏览 0评论
684浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 15:11 , Processed in 1.511509 second(s), Total 105, Slave 88 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号