VHDL:无法读取输出状态

Sea*_*ent 2 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;
Run Code Online (Sandbox Code Playgroud)

我想如果我切换到使用 VHDL 2008 进行编译,我可以解决这个问题,但我会尝试坚持使用 1993。关于这个问题的任何建议将不胜感激。

Mor*_*mer 5

VHDL-2008 允许在模式下读取端口out,但以前的 VHDL 版本不允许,因此根据错误消息“无法读取输出状态”,以及您关于通过使用 VHDL-2008 修复问题的评论,听起来是这样问题。

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

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