【问题标题】:Errors in VHDL Xilinx ISE Project NavigatorVHDL Xilinx ISE Project Navigator 中的错误
【发布时间】:2015-10-31 16:55:25
【问题描述】:
 library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity DruigZadatak is
 Port ( iSW : in  STD_LOGIC_VECTOR (7 downto 0);
       iSEL : in  STD_LOGIC;
       oLED : out  STD_LOGIC_VECTOR (7 downto 0));
 end DruigZadatak;

 architecture Behavioral of DruigZadatak is

begin
    oLED <= "11111111" when iSEL ='0' else
            oLED(3 downto 0) <= (iSW(5 downto 3) + iSW(2 downto 0)),
            oLED(6 downto 4) <= "111" when iSW(7)='1' else
            "110" when iSW(6)='1' else
            "101" when iSW(5)='1' else
            "100" when iSW(4)='1' else
            "011" when iSW(3)='1' else
            "010" when iSW(2)='1' else
            "001" when iSW(1)='1' else  
            "000" when iSW(0)='1';  
    oLed(7) <= '0' when iSW ="00000000" else
        iSEL;
 end Behavioral;

我得到以下错误

ERROR:HDLCompiler:288 -Line 45: Cannot read from 'out' object oled ; use 'buffer' or 'inout'
ERROR:HDLCompiler:1731 -Line 45: found '0' definitions of operator "<=", cannot determine exact overloaded matching  definition for "<="
ERROR:HDLCompiler:288 -Line 47: Cannot read from 'out' object oled ; use 'buffer' or 'inout'
ERROR:HDLCompiler:1731 -Line 47: found '0'   definitions of operator "<=", cannot determine exact overloaded matching definition for "<="
ERROR:HDLCompiler:854 -Line 39: Unit <behavioral> ignored due to previous errors.

如果有人可以向我解释我应该怎么做以及为什么这些错误不断出现,那就太好了,谢谢。我希望你明白我的项目的意义何在..

【问题讨论】:

    标签: vhdl xilinx-ise


    【解决方案1】:

    您的条件信号赋值语句不能嵌入另一个条件信号赋值语句。

    将作业分成三部分而不是两部分:

     architecture foo of DruigZadatak is
    
     begin
         oLED (6 downto 4) <= "111" when iSEL = '0' or iSW(7) = '1' else 
                              "110" when iSW(6)='1' else
                              "101" when iSW(5)='1' else
                              "100" when iSW(4)='1' else
                              "011" when iSW(3)='1' else
                              "010" when iSW(2)='1' else
                              "001" when iSW(1)='1' else  
                              "000" when iSW(0)='1';                       
    
         oLED ( 3 downto 0) <= "1111"                    when iSEL = '0' else
                               '0' & (iSW(5 downto 3) + iSW(2 downto 0)) ;
         oLed(7) <= '0'   when iSW ="00000000" else    
                    iSEL;                      
     end architecture;
    

    还要注意“0”与加法结果的连接,以使右侧的表达式长度与赋值的左侧匹配。

    这三个赋值用 if 语句详细说明为等效的过程。您可以将 if 语句组合到一个进程中,它们都将具有相同的敏感度列表。

    使用 VHDL -2008 兼容工具,您可以在单个进程中使用顺序条件信号分配语句。

    上述具有三个并发信号分配语句的架构分析、阐述和模拟(告诉我们没有长度不匹配并且一切都连接起来)。

    【讨论】:

    • 这是我在 xilinx vhdl 中的第一个项目,所以一切对我来说都是新的,所以你能用“'0' & ....”解释我最后一部分的含义吗?最后 iSEL=1 怎么样?这是否适用于架构行为?
    • Xilinx 不是 VHDL 的代名词。在这种情况下,“&”是一个连接运算符,通过在结果前面加上“0”来创建长度大于“+”结果的 1 的 std_logic_vector。 '最后 iSEL=1 怎么样?在英语中不能很好地解析(综合只处理二进制等效值,如果它不是'0',它就是'1')。您可以为架构命名任何您想要的名称。 VHDL 支持多种架构。您的赛灵思工具可能允许您指定您使用的架构,否则默认绑定指示将指示最后分析的架构。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-24
    相关资源
    最近更新 更多