“信號不能在多個並發進程中賦值”這是個代碼的可綜合方面的要求,也就是說一般綜合工具會對此報錯的,但從仿真角度上說是沒有問題的,除非多個賦值造成沖突導致仿真無法繼續,modelsim是純粹的仿真工具,它不會關心代碼是否可綜合;據我所知,采用波形輸入在quartus下進行時序仿真是需要先綜合的,這樣工具就會檢查代碼在可綜合性方面的問題,因此會報你上述錯誤.只要將復位操作分開到每個寄存器描述進程中表達就行了.
1 -- 計數器 2 counter:process (clk, rst) 3 begin 4 if rst = '1' then 5 -- Asynchronous reset code 6 iCntRst <= '1';--復位操作,將iCntRst置位 7 iCount <= 0; 8 state <= INIT; 9 10 elsif (clk' event and clk = '1') then 11 -- synchronous code 12 if(iCntRst = '1') then 13 iCount <= 0; 14 else 15 iCount <= iCount + 1; 16 end if; 17 end if; 18 end process;
1 next_state_decoder : process(state,clk) 2 3 variable next_state : states; 4 variable iBits : integer range 0 to 8; 5 6 begin 7 if(clk'event and clk = '1') then 8 case state is 9 when INIT => 10 iCntRst <= '0';--該處又出現對iCntRst的賦值操作 11 ....................... 12 end process next_state_decoder;
所以,在綜合時出現了標題中的錯誤。解決辦法,將復位操作放置到next_state_decoder中!
2012-12-12 11:28:24