2009-10-25 66 views
1

我正在一個4×4位乘法器,並得到這個錯誤消息,「錯誤(10500):VHDL語法錯誤在lab_6.vhd(33)附近的文本」之後「;期待」 )「或」,「」二十次。問題是我有一個「)」或一個「,」之後的聲明。這裏是代碼:錯誤10500,沒有意義

library ieee; 
use ieee.std_logic_1164.all; 

entity lab_6 is 
port(x, y :in std_logic_vector(0 to 3); 
    f :out std_logic_vector(0 to 7)); 
end lab_6; 

architecture lab_6_arch of lab_6 is 
signal sigand0, sigand1, sigand2, sigand3, sigand4, sigand5, sigand6, sigand7, sigand8, sigand9, sigand10, sigand11, sigand12, sigand13, sigand14, sigand15: std_logic; 
signal sigha0, sigha1, sigha2, sigha3, sigha4, sigha5, sigha6, sigha7: std_logic; 
signal sigfa0, sigfa1, sigfa2, sigfa3, sigfa4, sigfa5, sigfa6, sigfa7, sigfa8, sigfa9, sigfa10, sigfa11, sigfa12, sigfa13, sigfa14, sigfa15: std_logic; 
component fa is 
port(x : in std_logic_vector(0 to 2); 
    f : out std_logic_vector(0 to 1)); 
end component; 

component a_n_d is 
port(x : in std_logic_vector (0 to 1); 
    f : out std_logic); 
end component; 

component ha is 
port(x :in std_logic_vector(0 to 1); 
    f :out std_logic_vector(0 to 1)); 
end component; 

begin 

module1: a_n_d 
port map(x(0) => x(0), 
    y(0) => x(1), 
    f => sigand0 after 3 ns); 
f(0)<= sigand0; 

module2_1: a_n_d 
port map(x(1) => x(0), 
    y(0) => x(1), 
    f => sigand1 after 3 ns); 
module2_2: a_n_d 
port map(x(0) => x(0), 
    y(1) => x(1), 
    f => sigand2 after 3 ns); 
module2_3:ha 
port map(sigand1 => x(0), 
    sigand2 => x(1), 
    f(0)=> sigha0 after 4 ns, 
    f(1)=> sigha1 after 4 ns); 
f(1)<=sigha0; 

module3_1: a_n_d 
port map(x(2) => x(0), 
    y(0) => x(1), 
    f => sigand3 after 3 ns); 
module3_2: a_n_d 
port map(x(1) => x(0), 
    y(1) => x(1), 
    f => sigand4 after 3 ns); 
module3_3: a_n_d 
    port map(x(0) => x(0), 
    y(2) => x(1), 
    f => sigand5 after 3 ns); 
module3_4:fa 
port map(sigand3 => x(0), 
    sigand4=> x(1), 
    sigha1=>x(2), 
    f(0)=> sigfa0 after 8 ns, 
    f(1)=> sigfa1 after 8 ns); 
module3_5:ha 
port map(sigfa0 => x(0), 
    sigand5=> x(1), 
    f(0)=> sigha2 after 4 ns, 
    f(1)=> sigha3 after 4 ns); 
f(2) <= sigha2; 

module4_1: a_n_d 
port map(x(3) => x(0), 
    y(0) => x(1), 
    f => sigand6 after 3 ns); 
module4_2: a_n_d 
port map(x(2) => x(0), 
    y(1) => x(1), 
    f => sigand7 after 3 ns); 
module4_3: a_n_d 
port map(x(1) => x(0), 
    y(2) => x(1), 
    f => sigand8 after 3 ns); 
module4_4: a_n_d 
port map(x(0) => x(0), 
    y(3) => x(1), 
    f => sigand9 after 3 ns); 
module4_5:fa 
port map(sigand6 => x(0), 
    sigand7=> x(1), 
    sigfa1=>x(2), 
    f(0)=> sigfa2 after 8 ns, 
    f(1)=> sigfa3 after 8 ns); 
module4_6:fa 
port map(sigand8 => x(0), 
    sigfa2=> x(1), 
    sigha3=>x(2), 
    f(0)=> sigfa4 after 8 ns, 
    f(1)=> sigfa5 after 8 ns); 
module4_7:ha 
port map(sigfa4 => x(0), 
    sigand5=> x(1), 
    f(0)=> sigha4 after 4 ns, 
    f(1)=> sigha5 after 4 ns); 
f(3)<=sigha4; 

module5_1: a_n_d 
port map(x(3) => x(0), 
    y(1) => x(1), 
    f => sigand10 after 3 ns); 
module5_2: a_n_d 
port map(x(2) => x(0), 
    y(2) => x(1), 
    f => sigand11 after 3 ns); 
module5_3: a_n_d 
port map(x(1) => x(0), 
    y(3) => x(1), 
    f => sigand12 after 3 ns); 

module5_4:ha 
port map(sigfa3 => x(0), 
    sigand10=> x(1), 
    f(0)=> sigha6 after 4 ns, 
    f(1)=> sigha7 after 4 ns); 

module5_5:fa 
port map(sigand11 => x(0), 
    sigha6=> x(1), 
    sigfa5=>x(2), 
    f(0)=> sigfa6 after 8 ns, 
    f(1)=> sigfa7 after 8 ns); 
module5_6:fa 
port map(sigand12 => x(0), 
    sigfa6=> x(1), 
    sigha5=>x(2), 
    f(0)=> sigfa8 after 8 ns, 
    f(1)=> sigfa9 after 8 ns); 
f(4)<=sigfa8; 

module6_1: a_n_d 
port map(x(3) => x(0), 
    y(2) => x(1), 
    f => sigand13 after 3 ns); 
module6_2: a_n_d 
port map(x(2) => x(0), 
    y(3) => x(1), 
    f => sigand14 after 3 ns); 
module6_3:fa 
port map(sigand13 => x(0), 
    sigha7=> x(1), 
    sigfa7=>x(2), 
    f(0)=> sigfa10 after 8 ns, 
    f(1)=> sigfa11 after 8 ns); 
module6_4:fa 
port map(sigand14 => x(0), 
    sigfa9=> x(1), 
    sigfa10=>x(2), 
    f(0)=> sigfa12 after 8 ns, 
    f(1)=> sigfa13 after 8 ns); 
f(5)<=sigfa12; 

module7_1: a_n_d 
    port map(x(3) => x(0), 
    y(3) => x(1), 
    f => sigand15 after 3 ns); 
module7_2:fa 
    port map(sigand15 => x(0), 
    sigfa11=> x(1), 
    sigfa13=>x(2), 
    f(0)=> sigfa14 after 8 ns, 
    f(1)=> sigfa15 after 8 ns); 
f(6)<=sigfa14; 
f(7)<=sigfa15; 
end lab_6_arch; 

我感謝您的幫助和時間。

+0

請問第33行可以嗎? – 2009-10-25 22:11:24

+0

你的箭是否走錯了路? – 2009-10-25 22:13:57

+0

@ Matt:錯誤發生在每一個聲明之後。 @ pst:是的,箭頭是正確的。 – 2009-10-25 22:26:42

回答

0

(注:我不知道VHDL,我只是通過我在Qualis VHDL Quick Reference Card發現會)

33行出現在這裏:

module2_1: a_n_d 
port map(x(1) => x(0), 
    y(0) => x(1), 
    f => sigand1 after 3 ns);  <-- line 33 

看來, after子句只能出現在<=而非=>的語句中。你得到的錯誤基本上意味着編譯器沒有期望看到after在那一點上,而是顯示了它期望的(通常不是非常有用)。

+0

謝謝,但我仍然得到該行的錯誤。當我試圖解決這個問題時,這是第五個無意義的錯誤,這令人沮喪。 – 2009-10-25 22:33:15

+0

你仍然得到錯誤,但是你改變了什麼? – 2009-10-25 22:39:41

+0

我改變了賦值運算符的方向。我通過詢問一位朋友也解決了這個錯誤。謝謝你的時間。 – 2009-10-26 02:30:34

1

你不能使用端口映射內的任何陳述,端口映射僅用於綁定端口信號(或封閉的層次結構的端口):

<component_identifier>: <component_name> 
port map(
    <port_name> => <assigned_signal>, 
    ... 
) 

你能做什麼,而不是被推遲將sigand0轉讓給f(0):

module1: a_n_d 
    port map(x(0) => x(0), 
       y(0) => x(1), 
       f => sigand0); 

f(0) <= sigand0 after 3 ns; 

希望對您有所幫助!