VHDL:如何在输入输出端口上设置值?
我正在尝试测试 VHDL 组件,但我似乎无法获取这个输入端口给我任何行为。我尝试将端口设置为从“1”到“-”的所有值,但在模拟中它仍然显示为“U”。有什么建议可能有什么问题吗?
I am trying to test a VHDL component, but I can't seem to get this one inout port to give me any behaviour. I've tried setting the port to everything from '1' to '-', but it still comes up as 'U' in simulation. Any sugestions what might be wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当使用 inout 端口时,当 VHDL 语句显然太复杂而无法综合推断 IOBUF 时,我被实例化 OBUF 而不是 IOBUF 的综合工具所困扰。以下是令我困扰的情况的简化示例(假设所有信号均为 std_logic):
在我的失败案例中,综合为 data_inout 生成了一个 OBUF。我本来期望 IOBUF 能够处理 choice_a='0' 和 float_b='1' 的情况,因为应该将 'Z' 分配给 data_inout,但这不是我得到的。
When using an inout port, I've been bitten by a synthesis tool instantiating an OBUF instead of an IOBUF when the VHDL statements were apparently too complicated for synthesis to infer the IOBUF. The following is a simplified example (assume all signals are std_logic) of the situation that bit me:
In my failure case, synthesis generated an OBUF for data_inout. I would have expected an IOBUF to handle the case of choose_a='0' and float_b='1' because that should have assigned 'Z' to data_inout, but that's not what I got.
对于 Inout 端口(例如在 RAM 中):
您可以使用条件为 inout 分配数据读取和写入。读取数据时,由另一个模块驱动。当它写入时,由内部驱动。
For Inout port (for example in RAM):
You assign data read and write for inout with a condition. When data is read, it is driven by another module. When it writes, it is driven by internal.
您需要一个明确的驱动程序来“Z”。
You need an explicit driver to 'Z'.
除了分配/读取输入输出端口的良好答案之外,上面引用的文本可能与分配到两个不同位置的端口相关,因此它被解析为“U”。
As an aside to the good answer on assigning/reading inout ports, the above quoted text could be related to the port being assigned to in two separate places, so it's resolved as 'U'.