如何修复VHDL中的“中缀运算符”错误?

时间:2019-02-01 17:51:18

标签: vhdl modelsim

尝试添加std_logic_vector和整数时,我收到一个中缀运算符错误。

** Error: C:/git_wa/riscv/hdl/prgcounter.vhd(20): (vcom-1581) No feasible entries for infix operator '+'.
** Error: C:/git_wa/riscv/hdl/prgcounter.vhd(20): Type error resolving infix expression "+" as type ieee.std_logic_1164.STD_LOGIC_VECTOR.
** Error: C:/git_wa/riscv/hdl/prgcounter.vhd(25): VHDL Compiler exiting

这是针对vhdl复习项目的,我感觉自己在做的事情忘记了基本的vhdl原理。我引用了其他计数器设计,所有这些似乎都可以做到这一点。

我尝试添加软件包,但是我不认为我甚至不需要在此设计中使用IEEE.std_logic_arith.all。

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
--------------------------------------------------------------------------------
entity prgcounter is
    port (
        clkIn       : in    std_logic;
        rstIn       : in    std_logic;
        addressOut  :   out std_logic_vector(63 downto 0)
    );
end prgcounter;
--------------------------------------------------------------------------------
architecture behav of prgcounter is
    signal address : std_logic_vector(63 downto 0);
begin
    process(clkIn, rstIn)
    begin
        if rstIn = '1' then
            address <= (others => '0');
        elsif rising_edge(clkIn) then
            address <= (address + 1);
        end if;
    end process;

    addressOut <= address;
end behav;

0 个答案:

没有答案