L
lzh08
Guest
LIBRARY ieee;
ieee.std_logic_1164.all utilização;
ENTIDADE MCU é
PORT
(
nDataStrobe: in std_logic;
nAddrStrobe: in std_logic;
NWRI: in std_logic;
nReset: in std_logic;
Data: inout std_logic_vector (7 DOWNTO 0);
nWait: out std_logic;
nAck: out std_logic;
);
END MCU;
ARQUITETURA Ação da MCU é
Estado TIPO IS (ST0, ST1, ST2, ST3, ST4, ST5);
SINAL Cur_State, Next_State: Estado: = ST0;
SINAL RegDataTemp: std_logic_vector (7 downto 0);
SINAL RegAddrTemp: std_logic_vector (7 downto 0);
BEGIN
DataWrite: PROCESS (Cur_State, nDataStrobe, NWRI)
BEGIN
CASO Cur_State IS
QUANDO ST0 = nWait> <= '0 ';
if (NWRI = '1 ') then
Next_State <= ST0;
diferente
Next_State <= st1;
END IF;
QUANDO st1 => RegDataTemp <= dados;
if (nDataStrobe = '1 ') then
Next_State <= st1;
diferente
Next_State <= St2;
END IF;
QUANDO St2 = nWait> <= '1 ';
Next_State <= St3;
QUANDO St3 => if (nDataStrobe = '0 ') then
Next_State <= St3;
diferente
Next_State <= St4;
END IF;
QUANDO St4 => if (NWRI = '0 ')
Next_State <= St4;
diferente
Next_State <= ST5;
END IF;
QUANDO ST5 = nWait> <= 1;
Next_State <= ST0;
WHEN OTHERS => Next_State <= ST0;
end case;
END PROCESS;PROCESSO (SysClk)
BEGIN
IF rising_edge (SysClk) THEN
Cur_State <= Next_State;
END IF;
END PROCESS;
END Acção;
ieee.std_logic_1164.all utilização;
ENTIDADE MCU é
PORT
(
nDataStrobe: in std_logic;
nAddrStrobe: in std_logic;
NWRI: in std_logic;
nReset: in std_logic;
Data: inout std_logic_vector (7 DOWNTO 0);
nWait: out std_logic;
nAck: out std_logic;
);
END MCU;
ARQUITETURA Ação da MCU é
Estado TIPO IS (ST0, ST1, ST2, ST3, ST4, ST5);
SINAL Cur_State, Next_State: Estado: = ST0;
SINAL RegDataTemp: std_logic_vector (7 downto 0);
SINAL RegAddrTemp: std_logic_vector (7 downto 0);
BEGIN
DataWrite: PROCESS (Cur_State, nDataStrobe, NWRI)
BEGIN
CASO Cur_State IS
QUANDO ST0 = nWait> <= '0 ';
if (NWRI = '1 ') then
Next_State <= ST0;
diferente
Next_State <= st1;
END IF;
QUANDO st1 => RegDataTemp <= dados;
if (nDataStrobe = '1 ') then
Next_State <= st1;
diferente
Next_State <= St2;
END IF;
QUANDO St2 = nWait> <= '1 ';
Next_State <= St3;
QUANDO St3 => if (nDataStrobe = '0 ') then
Next_State <= St3;
diferente
Next_State <= St4;
END IF;
QUANDO St4 => if (NWRI = '0 ')
Next_State <= St4;
diferente
Next_State <= ST5;
END IF;
QUANDO ST5 = nWait> <= 1;
Next_State <= ST0;
WHEN OTHERS => Next_State <= ST0;
end case;
END PROCESS;PROCESSO (SysClk)
BEGIN
IF rising_edge (SysClk) THEN
Cur_State <= Next_State;
END IF;
END PROCESS;
END Acção;