作者e12518166339 (耐纶)
看板PLT
标题[问题]VHDL state machine 程式错误
时间Mon Jun 18 17:39:56 2007
※ [本文转录自 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
1F:推 godfat:不是写了 No such file or directory. ? 06/18 21:03
2F:推 e12518166339:不懂?我是错在哪了吗? 06/23 18:40
3F:→ godfat:找不到档案,所以不要用那个档案,或是找出那个档案 06/25 00:09
4F:→ xlk:需要new一个project? 06/30 00:47