2014-11-05 91 views
0

我遇到麻煩的代碼會將控制字分成幾個部分,以便它們可以被各自的電路使用。針對別名聲明的錯誤10500

當我嘗試編譯這段代碼,我得到每個別名線兩條10500錯誤: 「近文本‘別名’;需要‘結束’,或‘(’或標識,或併發聲明」 「近文字「是」期待「;」或「通用」

我嘗試添加一個。「結束;」和別名聲明之後「結束的別名」,但它仍然返回相同的錯誤

。我還試圖在聲明的各個部分添加「信號」,但這也會導致相同的錯誤。

Orig我在sts塊之前將std_logic_vector轉換爲了bit_vector,並且別名輸出是位類型而不是std_logic,但我將其更改爲std_logic,認爲類型轉換是問題。

--Splits control word into specific sections. 
    Architecture split of t11214 is 
      Begin 
       Alias enable_input: std_logic is instruction(1); 
       Alias enable_output: std_logic is instruction(2); 
       Alias select_accumulator: std_logic is instruction(3); 
       Alias select_operand: std_logic_vector(1 to 2) is instruction(4 to 5); 
       Alias select_prcmp: std_logic_vector(1 to 2) is instruction(6 to 7); 
       Alias select_prenot: std_logic_vector(1 to 2) is instruction(8 to 9); 
       Alias select_function: std_logic_vector(1 to 2) is instruction(10 to 11); 
       Alias select_rng: std_logic is instruction(12); 
       Alias shift: std_logic_vector(1 to 4) is instruction(13 to 16); 
    End architecture split; 

回答

1

Alias是聲明的部分,所以它必須是Begin之前,從而像:

Architecture split of t11214 is 
    ... 
    Alias enable_input: std_logic is instruction(1); 
    ... 
Begin 
    ... 
End architecture split; 
+1

感謝。這幾個小時我一直在搞這個代碼,不敢相信這個錯誤太簡單了。 – 2014-11-05 12:23:01