VHDL:无法读取输出状态

时间:2014-03-01 20:53:02

标签: compiler-errors vhdl modelsim

我正在尝试在ModelSim 10.0中编译,我收到一个编译错误,说明: '无法读取输出状态'。

这是代码的片段。如果有人能告诉我我做错了什么,那就太棒了。

entity controller_entity is
generic( entryCount : positive := 2;
         ....);
port(
    clk         : in  std_logic;
    ....
    entry_car_entered : out std_logic_vector(0 to entryCount-1)
);
end entity controller_entity;

architecture controller_v1 of controller_entity is
signal cars_entered : std_logic_vector(0 to entryCount-1);

component entry is
    port(
        clk       : in  std_logic;
        ....
        car_passed: out std_logic  --Output to higher level
    );
end component;

begin   
    CREATE_ENTRANCES: for i in 0 to entryCount-1 generate
                entryi : entry port map(clk => clk,
                        ....
                car_passed => entry_car_entered(i) -- This line causes the problem.                                             

                        end generate CREATE_ENTRANCES;

    .....

);
end architecture controller_v1;

我想我可以解决这个问题,如果我转而使用VHDL 2008进行编译,但我正试图坚持使用1993年。对此问题的任何建议都将深表赞赏。

2 个答案:

答案 0 :(得分:1)

VHDL-2008允许内部使用以out模式读取端口,但以前的VHDL版本不允许,因此基于错误消息“无法读取输出状态”,以及您对通过以下方式解决问题的评论使用VHDL-2008,听起来这就是问题所在。

但是,错误消息实际上可能是“无法读取输出”状态“',其中”status“是对未公开代码中其他地方名为”status“的输出的引用。您可能希望在所有代码中搜索“status”,以查看是否引用了具有模式out的“状态”端口进行读取。

如果是这样,如果内部信号由组件驱动,则可以在VHDL-2002中修复该问题,然后内部信号驱动out端口。然后可以在内部读取该内部信号。

答案 1 :(得分:0)

组件entry的虚拟实体/体系结构并注释掉“...”内容,添加上下文子句,并将关闭);的端口映射移动到正确的位置(在生成内部)语句):

library ieee;
use ieee.std_logic_1164.all;
entity entry is               -- dummy entry
    port(
        clk       : in  std_logic;
        -- ....
        car_passed: out std_logic  --Output to higher level
    );
end entity;

architecture foo of entry is

begin
    car_passed <= clk; 
end architecture;

library ieee;
use ieee.std_logic_1164.all;

entity controller_entity is
generic( entryCount : positive := 2 --;
         ); --....);
port(
    clk         : in  std_logic;
    -- ....
    entry_car_entered : out std_logic_vector(0 to entryCount-1)
);
end entity controller_entity;

architecture controller_v1 of controller_entity is

    signal cars_entered : std_logic_vector(0 to entryCount-1);

component entry is
    port(
        clk       : in  std_logic;
        -- ....
        car_passed: out std_logic  --Output to higher level
    );
end component;

begin   
CREATE_ENTRANCES: 
    for i in 0 to entryCount-1 generate
entryi: entry 
        port map (
            clk => clk,
                -- ....
            car_passed => entry_car_entered(i) -- This line causes the problem. 
        );
    end generate CREATE_ENTRANCES;

   -- .....

end architecture controller_v1;

此设计规范使用与IEEE Std 1076-1993“兼容”的不同VHDL工具分析,详细说明和模拟。您声称的错误声明与尝试从Google搜索读取模式out的端口信号或接口列表信号相关联。它未列在Modelsim错误列表中,并且报告的格式为“无法读取输出”signal_name“',注意您不会显示status的信号名称。

有几种可能性。您使用的Modelsim版本存在缺陷,导致错误消息错误(并且随后被删除)或您的代码段无法准确反映您的设计规范或错误实际位置。可能错误消息来自其他内容或我的错误列表不准确。

在任何情况下,您都可以使用在架构controller_v1中声明的信号连接到生成的实例化条目组件端口car_passed,并将其分配给输出端口信号entry_car_entered。您可以在生成语句中按entry_car_entered元素执行该元素。

如果您有与Modelsim错误相关联的错误编号,则可以通过错误获得错误的扩展描述。扩展描述通常提供足够的信息来纠正问题。

相关问题