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

Subversion Repositories cpu6502_true_cycle

[/] [cpu6502_true_cycle/] [trunk/] [rtl/] [vhdl/] [fsm_intnmi.vhd] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 fpga_is_fu
-- VHDL Entity r6502_tc.fsm_intnmi.symbol
2
--
3
-- Created:
4
--          by - remoteghost.UNKNOWN (ENTW-7HPZ200)
5
--          at - 09:22:12 07/24/13
6
--
7
-- Generated by Mentor Graphics' HDL Designer(TM) 2016.2 (Build 5)
8
--
9
LIBRARY ieee;
10
USE ieee.std_logic_1164.all;
11
USE ieee.std_logic_arith.all;
12
 
13
entity fsm_intnmi is
14
   port(
15
      clk_clk_i   : in     std_logic;
16
      nmi_n_i     : in     std_logic;
17
      rst_nmi_i   : in     std_logic;
18
      rst_rst_n_i : in     std_logic;
19
      nmi_o       : out    std_logic
20
   );
21
 
22
-- Declarations
23
 
24
end fsm_intnmi ;
25
 
26
-- (C) 2008 - 2018 Jens Gutschmidt
27
-- (email: opencores@vivare-services.com)
28
-- 
29
-- Versions:
30
-- Revision 1.9  2018/09/11 11:37:00  jens
31
-- - NMI = '0' need at least 1 cycles for correct
32
--   operation now (2 cycles in the past)
33
-- 
34
-- Revision 1.8  2013/07/24 11:11:00  jens
35
-- - Changing the title block and internal revision history
36
-- 
37
-- Revision 1.6  2009/01/04 10:20:47  eda
38
-- Changes for cosmetic issues only
39
-- 
40
-- Revision 1.5  2009/01/04 09:23:10  eda
41
-- - Delete unused nets and blocks
42
-- - Rename blocks
43
-- 
44
-- Revision 1.4  2009/01/03 16:53:02  eda
45
-- - Unused nets and blocks deleted
46
-- - Renamed blocks
47
-- 
48
-- Revision 1.3  2009/01/03 16:42:02  eda
49
-- - Unused nets and blocks deleted
50
-- - Renamed blocks
51
-- 
52
-- Revision 1.2  2008/12/31 19:31:24  eda
53
-- Production Release
54
--  
55
-- 
56
--
57
-- VHDL Architecture r6502_tc.fsm_intnmi.fsm
58
--
59
-- Created:
60
--          by - eda.UNKNOWN (ENTW-7HPZ200)
61
--          at - 11:45:38 11.09.2018
62
--
63
-- Generated by Mentor Graphics' HDL Designer(TM) 2016.2 (Build 5)
64
--
65
-- COPYRIGHT (C) 2008 - 2018 by Jens Gutschmidt
66
-- 
67
-- 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 the Free Software Foundation, either version 3 of the License, or any later version.
68
-- 
69
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
70
-- 
71
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
72
-- 
73
-- 
74
LIBRARY ieee;
75
USE ieee.std_logic_1164.all;
76
USE ieee.std_logic_arith.all;
77
 
78
architecture fsm of fsm_intnmi is
79
 
80
   subtype state_type is
81
      std_logic_vector(1 downto 0);
82
 
83
   -- Hard encoding
84
   constant idle : state_type := "00";
85
   constant idle1 : state_type := "01";
86
   constant IMP : state_type := "11";
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
   signal nmi_o_cld : std_logic ;
94
 
95
begin
96
 
97
   -----------------------------------------------------------------
98
   clocked_proc : process (
99
      clk_clk_i,
100
      rst_rst_n_i
101
   )
102
   -----------------------------------------------------------------
103
   begin
104
      if (rst_rst_n_i = '0') then
105
         current_state <= idle;
106
         -- Default Reset Values
107
         nmi_o_cld <= '0';
108
      elsif (clk_clk_i'event and clk_clk_i = '1') then
109
         current_state <= next_state;
110
         -- Default Assignment To Internals
111
         nmi_o_cld <= '0';
112
 
113
         -- Combined Actions
114
         case current_state is
115
            when idle1 =>
116
               if (nmi_n_i = '0') then
117
                  nmi_o_cld <= '1';
118
               end if;
119
            when IMP =>
120
               nmi_o_cld <= '1';
121
               if (rst_nmi_i = '1') then
122
                  nmi_o_cld <= '0';
123
               end if;
124
            when others =>
125
               null;
126
         end case;
127
      end if;
128
   end process clocked_proc;
129
 
130
   -----------------------------------------------------------------
131
   nextstate_proc : process (
132
      current_state,
133
      nmi_n_i,
134
      rst_nmi_i
135
   )
136
   -----------------------------------------------------------------
137
   begin
138
      case current_state is
139
         when idle =>
140
            if (nmi_n_i = '1') then
141
               next_state <= idle1;
142
            else
143
               next_state <= idle;
144
            end if;
145
         when idle1 =>
146
            if (nmi_n_i = '0') then
147
               next_state <= IMP;
148
            else
149
               next_state <= idle1;
150
            end if;
151
         when IMP =>
152
            if (rst_nmi_i = '1') then
153
               next_state <= idle;
154
            else
155
               next_state <= IMP;
156
            end if;
157
         when others =>
158
            next_state <= idle;
159
      end case;
160
   end process nextstate_proc;
161
 
162
   -- Concurrent Statements
163
   -- Clocked output assignments
164
   nmi_o <= nmi_o_cld;
165
end fsm;

powered by: WebSVN 2.1.0

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