作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试初始化一个 (VHDL-2008) ufixed。但是下面的代码在 Modelsim 10.5b 中给出了一个错误
entity test_e is
end entity;
library ieee;
architecture test_a of test_e is
use ieee.fixed_pkg.all;
constant value : ufixed(3 downto 0) := "0001";
begin
end architecture;
Error: [file].vhd(8): Character literal '0' of type ieee.std_logic_1164.STD_ULOGIC is not visible at the place of this string literal.
constant value : ufixed(3 downto 0) := to_ufixed(1,3,0);
最佳答案
添加一个额外的 use
声明修复它:
entity test_e is
end entity;
library ieee;
architecture test_a of test_e is
use ieee.std_logic_1164.all; -- HERE !
use ieee.fixed_pkg.all;
constant value : ufixed(3 downto 0) := "0001";
begin
end architecture;
ufixed
声明如下:
type ufixed is array (integer range <>) of std_logic;
use ieee.fixed_pkg.all
并不意味着你得到了
std_logic
的定义免费。好吧,我想只是因为你输入了
use ieee.fixed_pkg.all
意味着你没有得到
std_logic
的定义文字也是免费的。
关于VHDL-2008 初始化 ufixed 在modelsim 中给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43367363/
我正在尝试初始化一个 (VHDL-2008) ufixed。但是下面的代码在 Modelsim 10.5b 中给出了一个错误 entity test_e is end entity; library
我是一名优秀的程序员,十分优秀!