【问题标题】:VHDL (Error (10500): VHDL syntax error at Router.vhd(39) near text "port"; expecting "(", or "'", or ".")VHDL(错误(10500):Router.vhd(39)靠近文本“端口”的VHDL语法错误;期望“(”,或“'”或“。”)
【发布时间】:2018-11-27 12:30:15
【问题描述】:

所以基本上我在 Altera 上做 Mousetrap Latch 控制器,并且语法错误不断出现(错误(10500):Router.vhd(39)的 VHDL 语法错误靠近文本“端口”;期待“(”或“ '" 或 ".")。

    Library ieee; 
    use ieee.std_logic_1164.all; 
    use ieee.std_logic_arith.all; 
    use ieee.std_logic_signed.all; 

    entity Router is
    port(Ri, Ao, vld_i, rst: in std_logic; Data_i: in std_logic_vector(33 
    downto 0); Ro, Ai, vld_o: out std_logic; 
    Data_o: out std_logic_vector(33 downto 0));
    end entity Router;

    architecture behavioral of Router is
    signal reqI, ackO, VLDi: std_logic;
    signal reqO, VLDo: std_logic;
    signal Di, Do : std_logic_vector (33 downto 0);
    component latch1
    port(D, en: in std_logic; Q: out std_logic);
    end component;

    component latch_34
    port(D: in std_logic_vector(33 downto 0); en: in std_logic; Q: out 
    std_logic_vetor(33 downto 0));
    end component;
    begin

    process (rst)
    begin
    reqI<= Ri;
    ackO<= Ao;
    VLDi<=vld_i;
    Di<= Data_i;
    if (rst ='1') then
    reqI <= "0";
    ackO<='0';
    VLDi<='0';
    Di<= '0';
    Do<= '0';
    reqO<= '0';
    VLDo<= '0';
    else
    **u1: latch1 port map(reqI<=reqI, en<=reqO XNOR ackO, reqO<=reqO);**
    **u2: latch1 port map(VLDi, reqO XNOR ackO, VLDo);**
    **u3: latch_34 port map(Di, Not(reqO XNOR ackO) NAND VLDo, Do);**
    end if;
    end process;
    Ro<=reqO;
    Ai<=reqO;
    vld_o<= VLDo;
    Do<=Data_o;
    end behavioral;

【问题讨论】:

  • 命名关联元素的格式为 formal_port => actual_signal_or_expression。请注意,您没有指定这是 -2008 还是符合 VHDL 标准的早期版本。非全局静态表达式 (req0 XNOR ack0) 仅在 -2008 年受支持,综合工具供应商并未广泛支持(IEEE Std 1076-2008 6.5.6.3 端口条款,6.5.7 关联列表)。
  • 您也不能在进程(可能只包含顺序语句)中实例化组件(并发语句)。你没有条件硬件。组件代表外部块,不会被调用。
  • 对于 OP 的读者,请参阅 Montek Singh 和 Steven M. Nowick 在 CiteseerX 上的 MOUSETRAP: High-Speed Transition-Signaling Asynchronous Pipelines
  • 我不明白你的第二条评论,谢谢你的其余 cmets!

标签: syntax-error vhdl


【解决方案1】:

你在 std_logic_vector 中忘记了一个“c”:

component latch_34
port(D: in std_logic_vector(33 downto 0); en: in std_logic; Q: out 
std_logic_vetor(33 downto 0));
end component;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多