ISE Design Suite 11.2 XST  – “错误:HDLCompiler:410  – ”。vhd“行xx:表达式有x个元件;预期为y”-Altera-Intel社区-FPGA CPLD-ChipDebug

ISE Design Suite 11.2 XST – “错误:HDLCompiler:410 – ”。vhd“行xx:表达式有x个元件;预期为y”

问题描述

我针对Virtex-6 / Spartan-6器件时收到以下错误,但是在针对旧器件时,相同的代码会发出警告。

我该如何解决这个问题?

示例代码:

库;

使用ieee.std_logic_1164.all;

使用ieee.numeric_std.all;

实体ex_0006是

port(a,b:in unsigned(7 downto 0);

res:out unsigned(8 downto 0));

结束ex_0006;

ex_0006的架构是

开始

res <= a + b; – 注意:此处有错误点

结束

解决/修复方法

以上代码不符合VHDL LRM。

要解决该错误,请使用numeric_std包中的resize函数来对齐赋值的左侧和右侧。

库;

使用ieee.std_logic_1164.all;

使用ieee.numeric_std.all;

实体ex_0006是

port(a,b:in unsigned(7 downto 0);

res:out unsigned(8 downto 0));

结束ex_0006;

ex_0006的架构是

开始

res <= resize(a,9)+ resize(b,9); – 注意:此处有错误点

结束

ISE Design Suite 11.2 XST为Virtex-6和Spartan-6系列引入了新的VHDL / Verilog解析器。

有关此更改的更多信息,请参阅(Xilinx答复32927)

请登录后发表评论

    没有回复内容