Line 1... |
Line 1... |
-- VHDL Entity R6502_TC.fsm_nmi.symbol
|
-- VHDL Entity R6502_TC.FSM_NMI.symbol
|
--
|
--
|
-- Created:
|
-- Created:
|
-- by - eda.UNKNOWN (ENTWICKL4-XP-PR)
|
-- by - eda.UNKNOWN (TEST)
|
-- at - 19:07:10 08.04.2008
|
-- at - 21:30:26 04.01.2009
|
--
|
--
|
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
|
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
|
--
|
--
|
LIBRARY ieee;
|
LIBRARY ieee;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_arith.all;
|
USE ieee.std_logic_arith.all;
|
|
|
entity fsm_nmi is
|
ENTITY FSM_NMI IS
|
port(
|
PORT(
|
clk_clk_i : in std_logic;
|
clk_clk_i : IN std_logic;
|
nmi_n_i : in std_logic;
|
fetch_i : IN std_logic;
|
rst_rst_n_i : in std_logic;
|
nmi_n_i : IN std_logic;
|
nmi_o : out std_logic
|
rst_rst_n_i : IN std_logic;
|
|
nmi_o : OUT std_logic
|
);
|
);
|
|
|
-- Declarations
|
-- Declarations
|
|
|
end fsm_nmi ;
|
END FSM_NMI ;
|
|
|
-- Jens-D. Gutschmidt Project: R6502_TC
|
-- Jens-D. Gutschmidt Project: R6502_TC
|
|
|
-- scantara2003@yahoo.de
|
-- scantara2003@yahoo.de
|
|
|
Line 50... |
Line 51... |
|
|
--
|
--
|
|
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
|
--
|
-- <<-- more -->>
|
|
|
-- Title: FSM for NMI
|
-- Title: FSM for NMI
|
|
|
-- Path: R6502_TC/fsm_nmi/fsm
|
-- Path: R6502_TC/FSM_NMI/fsm
|
|
|
-- Edited: by eda on 08 Apr 2008
|
-- Edited: by eda on 03 Jan 2009
|
|
|
--
|
--
|
-- VHDL Architecture R6502_TC.fsm_nmi.fsm
|
-- VHDL Architecture R6502_TC.FSM_NMI.fsm
|
--
|
--
|
-- Created:
|
-- Created:
|
-- by - eda.UNKNOWN (ENTWICKL4-XP-PR)
|
-- by - eda.UNKNOWN (TEST)
|
-- at - 19:07:11 08.04.2008
|
-- at - 21:30:26 04.01.2009
|
--
|
--
|
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
|
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
|
--
|
--
|
LIBRARY ieee;
|
LIBRARY ieee;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_arith.all;
|
USE ieee.std_logic_arith.all;
|
|
|
architecture fsm of fsm_nmi is
|
ARCHITECTURE fsm OF FSM_NMI IS
|
|
|
type state_type is (
|
TYPE STATE_TYPE IS (
|
idle,
|
idle,
|
idle1,
|
idle1,
|
idle2,
|
idle2,
|
IMP
|
IMP
|
);
|
);
|
|
|
-- State vector declaration
|
-- State vector declaration
|
attribute state_vector : string;
|
ATTRIBUTE state_vector : string;
|
attribute state_vector of fsm : architecture is "current_state";
|
ATTRIBUTE state_vector OF fsm : ARCHITECTURE IS "current_state";
|
|
|
-- Declare current and next state signals
|
-- Declare current and next state signals
|
signal current_state : state_type;
|
SIGNAL current_state : STATE_TYPE;
|
signal next_state : state_type;
|
SIGNAL next_state : STATE_TYPE;
|
|
|
-- Declare any pre-registered internal signals
|
-- Declare any pre-registered internal signals
|
signal nmi_o_cld : std_logic ;
|
SIGNAL nmi_o_cld : std_logic ;
|
|
|
begin
|
BEGIN
|
|
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
clocked_proc : process (
|
clocked_proc : PROCESS (
|
clk_clk_i,
|
clk_clk_i,
|
rst_rst_n_i
|
rst_rst_n_i
|
)
|
)
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
begin
|
BEGIN
|
if (rst_rst_n_i = '0') then
|
IF (rst_rst_n_i = '0') THEN
|
current_state <= idle;
|
current_state <= idle;
|
-- Default Reset Values
|
-- Default Reset Values
|
nmi_o_cld <= '0';
|
nmi_o_cld <= '0';
|
elsif (clk_clk_i'event and clk_clk_i = '1') then
|
ELSIF (clk_clk_i'EVENT AND clk_clk_i = '1') THEN
|
current_state <= next_state;
|
current_state <= next_state;
|
-- Default Assignment To Internals
|
-- Default Assignment To Internals
|
nmi_o_cld <= '0';
|
nmi_o_cld <= '0';
|
|
|
-- Combined Actions
|
-- Combined Actions
|
case current_state is
|
CASE current_state IS
|
when IMP =>
|
WHEN IMP =>
|
nmi_o_cld <= '1';
|
nmi_o_cld <= '1';
|
when others =>
|
WHEN OTHERS =>
|
null;
|
NULL;
|
end case;
|
END CASE;
|
end if;
|
END IF;
|
end process clocked_proc;
|
END PROCESS clocked_proc;
|
|
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
nextstate_proc : process (
|
nextstate_proc : PROCESS (
|
current_state,
|
current_state,
|
|
fetch_i,
|
nmi_n_i
|
nmi_n_i
|
)
|
)
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
begin
|
BEGIN
|
case current_state is
|
CASE current_state IS
|
when idle =>
|
WHEN idle =>
|
if (nmi_n_i = '1') then
|
IF (nmi_n_i = '1') THEN
|
next_state <= idle1;
|
next_state <= idle1;
|
else
|
ELSE
|
next_state <= idle;
|
next_state <= idle;
|
end if;
|
END IF;
|
when idle1 =>
|
WHEN idle1 =>
|
if (nmi_n_i = '0') then
|
IF (nmi_n_i = '0') THEN
|
next_state <= idle2;
|
next_state <= idle2;
|
else
|
ELSE
|
next_state <= idle1;
|
next_state <= idle1;
|
end if;
|
END IF;
|
when idle2 =>
|
WHEN idle2 =>
|
if (nmi_n_i = '0') then
|
IF (nmi_n_i = '0') THEN
|
next_state <= IMP;
|
next_state <= IMP;
|
else
|
ELSE
|
next_state <= idle;
|
next_state <= idle;
|
end if;
|
END IF;
|
when IMP =>
|
WHEN IMP =>
|
|
IF (fetch_i = '1') THEN
|
next_state <= idle;
|
next_state <= idle;
|
when others =>
|
ELSE
|
|
next_state <= IMP;
|
|
END IF;
|
|
WHEN OTHERS =>
|
next_state <= idle;
|
next_state <= idle;
|
end case;
|
END CASE;
|
end process nextstate_proc;
|
END PROCESS nextstate_proc;
|
|
|
-- Concurrent Statements
|
-- Concurrent Statements
|
-- Clocked output assignments
|
-- Clocked output assignments
|
nmi_o <= nmi_o_cld;
|
nmi_o <= nmi_o_cld;
|
end fsm;
|
END fsm;
|
|
|
No newline at end of file
|
No newline at end of file
|