在VHDL中添加不编译?

时间:2011-11-13 02:06:34

标签: vhdl

我知道这是一个相当臭名昭着的话题,但通常的解决方案似乎都没有起作用。

以下是给出错误的行:

ppl_stage_cnt <= ppl_stage_cnt + 1;

这是我得到的错误(来自xst):

Line 89: found '0' definitions of operator "+", cannot determine exact overloaded matching definition for "+"

以下是将更多信息置于上下文中的信息:

signal ppl_stage_cnt : std_logic_vector(log2(ppl)-1 downto 0);


pplstage_cnt: process ( clk )
begin
    if rising_edge( clk ) then      
        if rst = '1' or ei = '1' or li = '1' then
            ppl_stage_cnt <= (others => '0');
        else
            ppl_stage_cnt <= ppl_stage_cnt + 1;
        end if;
    end if;
end process;   

我尝试过的其他事情:

ppl_stage_cnt <= std_logic_vector(to_unsigned(ppl_stage_cnt, log2(ppl)) + 1);

ppl_stage_cnt <= std_logic_vector(unsigned(ppl_stage_cnt) + '1');

1 个答案:

答案 0 :(得分:4)

尝试

ppl_stage_cnt <= UNSIGNED(ppl_stage_cnt) + 1;

来源:http://objectmix.com/vhdl/190708-how-do-perform-std_logic_vector-addition-using-ieee-numeric_std.html,谷歌第二次点击std_logic_vector operator