vhdl - 转换函数 "To_bit"必须只有一个形参

标签 vhdl modelsim eda

我在 VHDL 测试用例上运行 modelsim 时遇到上述错误,我无法理解为什么会出现错误。

测试用例:

LIBRARY IEEE;
Use ieee.std_logic_1164.all;

entity a is
port (in11 : in std_logic
);
end a;

架构a是:

component b_1 
 port ( in1 : in bit);
end component;


begin
   inst : b_1 port  map ( in1=> **to_Bit**(in11));
end a;

最佳答案

这是一个 modelsim 错误,实际上它应该报告您不允许在端口映射中实际使用此函数,这有效:

LIBRARY IEEE; Use ieee.std_logic_1164.all;

entity a is port (in11 : in std_logic ); end a;

architecture a of a is
signal inBit    : Bit;
component b_1 port ( in1 : in bit); end component;

begin 
inBit <= to_bit(in11);
inst : b_1 port map ( in1=> inBit); end a;

有一些限制适用于端口映射中的实际值,参见vhdl 引用:

The actual, if a port or signal, must be denoted by a static name (see 6.1). The actual, if an expression, must be a globally static expression (see 7.4).

问题是,这两种情况都应该是全局静态的......

关于vhdl - 转换函数 "To_bit"必须只有一个形参,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12741947/

相关文章:

c# - 用于 C# 和 Java EDA 的 Apache Camel ESB

vhdl - 如何从 Spartan 6 写入 Nexys 3 FPGA 板上的 Micron 外部蜂窝 RAM?

arrays - VHDL 2D 整数数组

optimization - VHDL优化技巧

VHDL整数范围包括在内? FPGA 与仿真的区别

开源 EDA 项目

python - python plot get_loc(self,key,method,tolerance)错误

audio - 使用VHDL更改音频的位深以使用编解码器

vhdl - 在VHDL/ModelSim中使用配置规范

linux - 检查许可证可用性以及当前许可证用户的正确 Linux 命令?