OpenCores
URL https://opencores.org/ocsvn/cpu6502_true_cycle/cpu6502_true_cycle/trunk

Subversion Repositories cpu6502_true_cycle

[/] [cpu6502_true_cycle/] [branches/] [avendor/] [rtl/] [vhdl/] [fsm_nmi.vhd] - Blame information for rev 6

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 fpga_is_fu
-- VHDL Entity R6502_TC.FSM_NMI.symbol
2 2 fpga_is_fu
--
3
-- Created:
4 6 fpga_is_fu
--          by - eda.UNKNOWN (TEST)
5
--          at - 21:30:26 04.01.2009
6 2 fpga_is_fu
--
7
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
8
--
9
LIBRARY ieee;
10
USE ieee.std_logic_1164.all;
11
USE ieee.std_logic_arith.all;
12
 
13 6 fpga_is_fu
ENTITY FSM_NMI IS
14
   PORT(
15
      clk_clk_i   : IN     std_logic;
16
      fetch_i     : IN     std_logic;
17
      nmi_n_i     : IN     std_logic;
18
      rst_rst_n_i : IN     std_logic;
19
      nmi_o       : OUT    std_logic
20 2 fpga_is_fu
   );
21
 
22
-- Declarations
23
 
24 6 fpga_is_fu
END FSM_NMI ;
25 2 fpga_is_fu
 
26
-- Jens-D. Gutschmidt     Project:  R6502_TC  
27
 
28
-- scantara2003@yahoo.de                      
29
 
30
-- COPYRIGHT (C) 2008 by Jens Gutschmidt and OPENCORES.ORG                                                                                     
31
 
32
--                                                                                                                                             
33
 
34
-- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by   
35
 
36
-- the Free Software Foundation, either version 3 of the License, or any later version.                                                        
37
 
38
--                                                                                                                                             
39
 
40
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of              
41
 
42
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.                                  
43
 
44
--                                                                                                                                             
45
 
46
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.     
47
 
48
--                                                                                                                                             
49
 
50
-- CVS Revisins History                                                                                                                        
51
 
52
--                                                                                                                                             
53
 
54 6 fpga_is_fu
-- $Log: not supported by cvs2svn $                                                                                                                            
55 2 fpga_is_fu
 
56 6 fpga_is_fu
--   <<-- more -->>                                                                                                                            
57 2 fpga_is_fu
 
58
-- Title:  FSM for NMI  
59
 
60 6 fpga_is_fu
-- Path:  R6502_TC/FSM_NMI/fsm  
61 2 fpga_is_fu
 
62 6 fpga_is_fu
-- Edited:  by eda on 03 Jan 2009  
63 2 fpga_is_fu
 
64
--
65 6 fpga_is_fu
-- VHDL Architecture R6502_TC.FSM_NMI.fsm
66 2 fpga_is_fu
--
67
-- Created:
68 6 fpga_is_fu
--          by - eda.UNKNOWN (TEST)
69
--          at - 21:30:26 04.01.2009
70 2 fpga_is_fu
--
71
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
72
--
73
LIBRARY ieee;
74
USE ieee.std_logic_1164.all;
75
USE ieee.std_logic_arith.all;
76
 
77 6 fpga_is_fu
ARCHITECTURE fsm OF FSM_NMI IS
78 2 fpga_is_fu
 
79 6 fpga_is_fu
   TYPE STATE_TYPE IS (
80 2 fpga_is_fu
      idle,
81
      idle1,
82
      idle2,
83
      IMP
84
   );
85
 
86
   -- State vector declaration
87 6 fpga_is_fu
   ATTRIBUTE state_vector : string;
88
   ATTRIBUTE state_vector OF fsm : ARCHITECTURE IS "current_state";
89 2 fpga_is_fu
 
90
   -- Declare current and next state signals
91 6 fpga_is_fu
   SIGNAL current_state : STATE_TYPE;
92
   SIGNAL next_state : STATE_TYPE;
93 2 fpga_is_fu
 
94
   -- Declare any pre-registered internal signals
95 6 fpga_is_fu
   SIGNAL nmi_o_cld : std_logic ;
96 2 fpga_is_fu
 
97 6 fpga_is_fu
BEGIN
98 2 fpga_is_fu
 
99
   -----------------------------------------------------------------
100 6 fpga_is_fu
   clocked_proc : PROCESS (
101 2 fpga_is_fu
      clk_clk_i,
102
      rst_rst_n_i
103
   )
104
   -----------------------------------------------------------------
105 6 fpga_is_fu
   BEGIN
106
      IF (rst_rst_n_i = '0') THEN
107 2 fpga_is_fu
         current_state <= idle;
108
         -- Default Reset Values
109
         nmi_o_cld <= '0';
110 6 fpga_is_fu
      ELSIF (clk_clk_i'EVENT AND clk_clk_i = '1') THEN
111 2 fpga_is_fu
         current_state <= next_state;
112
         -- Default Assignment To Internals
113
         nmi_o_cld <= '0';
114
 
115
         -- Combined Actions
116 6 fpga_is_fu
         CASE current_state IS
117
            WHEN IMP =>
118 2 fpga_is_fu
               nmi_o_cld <= '1';
119 6 fpga_is_fu
            WHEN OTHERS =>
120
               NULL;
121
         END CASE;
122
      END IF;
123
   END PROCESS clocked_proc;
124 2 fpga_is_fu
 
125
   -----------------------------------------------------------------
126 6 fpga_is_fu
   nextstate_proc : PROCESS (
127 2 fpga_is_fu
      current_state,
128 6 fpga_is_fu
      fetch_i,
129 2 fpga_is_fu
      nmi_n_i
130
   )
131
   -----------------------------------------------------------------
132 6 fpga_is_fu
   BEGIN
133
      CASE current_state IS
134
         WHEN idle =>
135
            IF (nmi_n_i = '1') THEN
136 2 fpga_is_fu
               next_state <= idle1;
137 6 fpga_is_fu
            ELSE
138 2 fpga_is_fu
               next_state <= idle;
139 6 fpga_is_fu
            END IF;
140
         WHEN idle1 =>
141
            IF (nmi_n_i = '0') THEN
142 2 fpga_is_fu
               next_state <= idle2;
143 6 fpga_is_fu
            ELSE
144 2 fpga_is_fu
               next_state <= idle1;
145 6 fpga_is_fu
            END IF;
146
         WHEN idle2 =>
147
            IF (nmi_n_i = '0') THEN
148 2 fpga_is_fu
               next_state <= IMP;
149 6 fpga_is_fu
            ELSE
150 2 fpga_is_fu
               next_state <= idle;
151 6 fpga_is_fu
            END IF;
152
         WHEN IMP =>
153
            IF (fetch_i = '1') THEN
154
               next_state <= idle;
155
            ELSE
156
               next_state <= IMP;
157
            END IF;
158
         WHEN OTHERS =>
159 2 fpga_is_fu
            next_state <= idle;
160 6 fpga_is_fu
      END CASE;
161
   END PROCESS nextstate_proc;
162 2 fpga_is_fu
 
163
   -- Concurrent Statements
164
   -- Clocked output assignments
165
   nmi_o <= nmi_o_cld;
166 6 fpga_is_fu
END fsm;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.