[問題]VHDL state machine 程式錯誤
※ [本文轉錄自 Electronics 看板]
作者: e12518166339 (耐綸) 看板: Electronics
標題: [問題]VHDL state machine 程式錯誤
時間: Mon Jun 18 17:26:22 2007
不知道是我步驟錯誤還是怎樣
我按照上課抄的程式打上→開新檔案夾→把ieee複製進去→然後再儲存我打的程式xx.hdl
接下來compile我剛打的那個程式
出現訊息如下
# ** Error: (vcom-19) Failed to access library 'work' at "work".
# No such file or directory. (errno = ENOENT)
不知道是我抄錯還是老師寫錯,請各位大大幫忙指正,謝謝..
還有...若是要模擬動作,請問該如何模擬
Library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity PinCheck is
port(InD : In std_logic_vector(3 downto 0);
InPinN : In std_logic;
InData : In std_logic;
nMatch : Out std_logic;
DEnter : In std_logic;
Reset : In std_logic;
Clk : In std_logic);
end PinCheck;
type MState is (idle,LoadPin,InPin,CheckPin);
type PinArray is array(0 to 3) of : : std_logic_vector(InD'range);
signal PinDight : PinArray;
signal InputDight : PinArray;
signal PresentState : MState;
signal PinCnt : integer range 0 to 4;
signal Inputcnt : integer range 0 to 4;
signal nMatchi : std_logic;
process(Reset,Clk)
begin
if Reset = '0' then
PresentState<= idle;
elsif Clk = '1' and Clk'event then
case PresentState is
when idle =>
if InPinN = '0' then
presentState<= LoadPin;
elsif InData = '0' then
presentState <= InPin;
end if;
when LoadPin =>
if DEnter = '0' then
presentState <= idle;
end if;
when InPin =>
if InputCnt = 3 then
presentState <= checkPin;
end if;
when CheckPin =>
if DEnter = '0' then
presentState <= idle;
end if;
when others =>
presentState <= idle;
end case;
end if;
end process;
process(Reset,PresentState,Clk)
begin
if Reset = '0' or presentState = idle then
PinCnt <= 0;
InputCnt <=0;
elsif Clk = '1' and Clk'event then
if (presentState = LoadPin and PinCnt < 4)then
PinCnt <= PinCnt +1;
PinDigit(CONV_INTEGER(Inputcnt)) <= Ind;
end if;
if (presentState = InPin and InputCnt < 4)then
PinCnt <= InputCnt +1;
PinDigit(CONV_INTEGER(Inputcnt)) <= Ind;
end if;
end if;
end process;
Process(Reset,PresentState)
begin
if Reset = '0' or presentState = idle then
nMatchi <= '1';
elsif (PresentState = CHECKPin) then
for i in 0 to 3 loop
if InputDight(i) then
nMatch <= '0';
else
nMatch <= '1';
exit;
end if;
end loop;
end if;
end process;
nMatch <= '0' when nMatchi = '0' and DEnter ='0' else '1';
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.143.36.251
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.143.36.251
推
06/18 21:03, , 1F
06/18 21:03, 1F
推
06/23 18:40, , 2F
06/23 18:40, 2F
→
06/25 00:09, , 3F
06/25 00:09, 3F
→
06/30 00:47, , 4F
06/30 00:47, 4F
PLT 近期熱門文章
PTT數位生活區 即時熱門文章