为什么这个 VHDL 代码会导致边界检查失败?我的结果信号比要添加的最宽数字宽 1 位......因此它不应该溢出......我错过了什么吗?
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity testbench is
end entity;
architecture sim of testbench is
constant dw :natural := 8;
signal arg1 :unsigned(dw-1 downto 0) := to_unsigned(4, dw);
signal result :unsigned(dw+0 downto 0);
begin
result <= arg1 + '1';
end architecture;
C:> ghdl -a --std=08 --ieee=synopsys --work=work testbench.vhd
C:> ghdl --elab-run --std=08 --ieee=synopsys 测试台 --ieee-asserts=disable
ghdl.exe:错误:testbench.vhd:13 的绑定检查失败来自:testbench.vhd:13 处的 process work.testbench(sim).P0
ghdl.exe:错误:模拟失败