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

Subversion Repositories cpu65c02_true_cycle

[/] [cpu65c02_true_cycle/] [branches/] [avendor/] [rtl/] [vhdl/] [fsm_nmi.vhd] - Blame information for rev 15

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 fpga_is_fu
-- VHDL Entity R65C02_TC.fsm_nmi.symbol
2
--
3
-- Created:
4
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
5 4 fpga_is_fu
--          at - 20:01:57 12.08.2008
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
entity fsm_nmi is
14
   port(
15 4 fpga_is_fu
      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
end fsm_nmi ;
25
 
26
-- Jens-D. Gutschmidt     Project:  R65C02_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
-- $Log: not supported by cvs2svn $                                                                                                                                       
55
 
56
-- Title:  FSM for NMI  
57
 
58
-- Path:  R65C02_TC/fsm_nmi/fsm  
59
 
60 4 fpga_is_fu
-- Edited:  by eda on 17 Apr 2008  
61 2 fpga_is_fu
 
62
--
63
-- VHDL Architecture R65C02_TC.fsm_nmi.fsm
64
--
65
-- Created:
66
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
67 4 fpga_is_fu
--          at - 20:01:57 12.08.2008
68 2 fpga_is_fu
--
69
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
70
--
71
LIBRARY ieee;
72
USE ieee.std_logic_1164.all;
73
USE ieee.std_logic_arith.all;
74
 
75
architecture fsm of fsm_nmi is
76
 
77
   type state_type is (
78
      idle,
79
      idle1,
80
      idle2,
81
      IMP
82
   );
83
 
84
   -- State vector declaration
85
   attribute state_vector : string;
86
   attribute state_vector of fsm : architecture is "current_state";
87
 
88
   -- Declare current and next state signals
89
   signal current_state : state_type;
90
   signal next_state : state_type;
91
 
92
   -- Declare any pre-registered internal signals
93 4 fpga_is_fu
   signal nmi_o_cld : std_logic ;
94 2 fpga_is_fu
 
95
begin
96
 
97
   -----------------------------------------------------------------
98
   clocked_proc : process (
99 4 fpga_is_fu
      clk_clk_i,
100
      rst_rst_n_i
101 2 fpga_is_fu
   )
102
   -----------------------------------------------------------------
103
   begin
104 4 fpga_is_fu
      if (rst_rst_n_i = '0') then
105 2 fpga_is_fu
         current_state <= idle;
106
         -- Default Reset Values
107 4 fpga_is_fu
         nmi_o_cld <= '0';
108
      elsif (clk_clk_i'event and clk_clk_i = '1') then
109 2 fpga_is_fu
         current_state <= next_state;
110
         -- Default Assignment To Internals
111 4 fpga_is_fu
         nmi_o_cld <= '0';
112 2 fpga_is_fu
 
113
         -- Combined Actions
114
         case current_state is
115
            when IMP =>
116 4 fpga_is_fu
               nmi_o_cld <= '1';
117 2 fpga_is_fu
            when others =>
118
               null;
119
         end case;
120
      end if;
121
   end process clocked_proc;
122
 
123
   -----------------------------------------------------------------
124
   nextstate_proc : process (
125 4 fpga_is_fu
      current_state,
126
      fetch_i,
127
      nmi_n_i
128 2 fpga_is_fu
   )
129
   -----------------------------------------------------------------
130
   begin
131
      case current_state is
132
         when idle =>
133 4 fpga_is_fu
            if (nmi_n_i = '1') then
134 2 fpga_is_fu
               next_state <= idle1;
135
            else
136
               next_state <= idle;
137
            end if;
138
         when idle1 =>
139 4 fpga_is_fu
            if (nmi_n_i = '0') then
140 2 fpga_is_fu
               next_state <= idle2;
141
            else
142
               next_state <= idle1;
143
            end if;
144
         when idle2 =>
145 4 fpga_is_fu
            if (nmi_n_i = '0') then
146 2 fpga_is_fu
               next_state <= IMP;
147
            else
148
               next_state <= idle;
149
            end if;
150
         when IMP =>
151 4 fpga_is_fu
            if (fetch_i = '1') then
152
               next_state <= idle;
153
            end if;
154 2 fpga_is_fu
         when others =>
155
            next_state <= idle;
156
      end case;
157
   end process nextstate_proc;
158
 
159
   -- Concurrent Statements
160
   -- Clocked output assignments
161 4 fpga_is_fu
   nmi_o <= nmi_o_cld;
162 2 fpga_is_fu
end fsm;

powered by: WebSVN 2.1.0

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