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 8

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 8 fpga_is_fu
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
5
--          at - 22:43:05 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 8 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 8 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 8 fpga_is_fu
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
69
--          at - 22:43:05 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 8 fpga_is_fu
architecture fsm of FSM_NMI is
78 2 fpga_is_fu
 
79 8 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 8 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 8 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 8 fpga_is_fu
   signal nmi_o_cld : std_logic ;
96 2 fpga_is_fu
 
97 8 fpga_is_fu
begin
98 2 fpga_is_fu
 
99
   -----------------------------------------------------------------
100 8 fpga_is_fu
   clocked_proc : process (
101 2 fpga_is_fu
      clk_clk_i,
102
      rst_rst_n_i
103
   )
104
   -----------------------------------------------------------------
105 8 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 8 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 8 fpga_is_fu
         case current_state is
117
            when IMP =>
118 2 fpga_is_fu
               nmi_o_cld <= '1';
119 8 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 8 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 8 fpga_is_fu
   begin
133
      case current_state is
134
         -- <<< REQ1
135
         when idle =>
136
            if (nmi_n_i = '1') then
137 2 fpga_is_fu
               next_state <= idle1;
138 8 fpga_is_fu
            else
139 2 fpga_is_fu
               next_state <= idle;
140 8 fpga_is_fu
            end if;
141
         when idle1 =>
142
            if (nmi_n_i = '0') then
143 2 fpga_is_fu
               next_state <= idle2;
144 8 fpga_is_fu
            else
145 2 fpga_is_fu
               next_state <= idle1;
146 8 fpga_is_fu
            end if;
147
         when idle2 =>
148
            if (nmi_n_i = '0') then
149 2 fpga_is_fu
               next_state <= IMP;
150 8 fpga_is_fu
            else
151 2 fpga_is_fu
               next_state <= idle;
152 8 fpga_is_fu
            end if;
153
         when IMP =>
154
            if (fetch_i = '1') then
155 6 fpga_is_fu
               next_state <= idle;
156 8 fpga_is_fu
            else
157 6 fpga_is_fu
               next_state <= IMP;
158 8 fpga_is_fu
            end if;
159
         when others =>
160 2 fpga_is_fu
            next_state <= idle;
161 8 fpga_is_fu
      end case;
162
   end process nextstate_proc;
163 2 fpga_is_fu
 
164
   -- Concurrent Statements
165
   -- Clocked output assignments
166
   nmi_o <= nmi_o_cld;
167 8 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.