【问题标题】:VHDL allow to pass real (floating point) numbers through ports?VHDL允许通过端口传递实数(浮点数)?
【发布时间】:2018-12-15 20:50:39
【问题描述】:

VHDL 允许通过端口传递实数(浮点数)?

对于此代码:

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.math_real.all;

entity FPP_MULT is
  port(A        : in  integer;  --input operands
       B        : in  real
       );
end FPP_MULT;

architecture (...)

输出:

Error (10414): VHDL Unsupported Feature error at real.vhd(8): cannot synthesize non-constant real objects or values Error: Quartus II Create Symbol File was unsuccessful. 1 error, 0 warnings

【问题讨论】:

  • 阅读错误信息。这与港口无关。 Quartus(以及我知道的所有其他综合工具)不能综合实数/浮点数。
  • IEEE Std 1076-2008 5.2.5 Floating-point types “实现应选择符合 IEEE Std 754-1985 或 IEEE Std 854 的除universal_real 之外的所有浮点类型的表示-1987;在任何一种情况下,此选择的表示都需要 64 位的最小表示大小。”类型 real 取决于主机实现。另请参阅附录 D 可能不可移植的构造。相反,请考虑使用符合综合条件的实例化包 float_pkg 类型 float,其中可以可移植地指定 binary 格式。
  • 参见 github 上的VHDL-2008 Support Library。有一个 -1993 兼容版本已成功与 Quartus II 一起使用。

标签: vhdl quartus


【解决方案1】:

您可以在端口声明中使用任何类型,包括real。但是……

VHDL 是一种用于数字电路行为的模拟和文档语言。一些聪明的人发现,可以合成语言的一个子集。 real 类型不在可综合子集中。即使它可以由一种工具合成,它在其他工具中的行为方式也不会相同。这将是一个非便携式物品。

【讨论】:

    猜你喜欢
    • 2016-09-07
    • 1970-01-01
    • 2017-12-25
    • 2016-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多