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

Subversion Repositories cpu6502_true_cycle

[/] [cpu6502_true_cycle/] [trunk/] [rtl/] [vhdl/] [reg_sp.vhd] - Blame information for rev 5

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

Line No. Rev Author Line
1 2 fpga_is_fu
-- VHDL Entity R6502_TC.Reg_SP.symbol
2
--
3
-- Created:
4
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
5 5 fpga_is_fu
--          at - 19:48:44 17.04.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 Reg_SP is
14
   port(
15
      adr_i        : in     std_logic_vector (15 downto 0);
16
      clk_clk_i    : in     std_logic;
17
      ld_i         : in     std_logic_vector (1 downto 0);
18
      ld_sp_i      : in     std_logic;
19
      rst_rst_i    : in     std_logic;
20
      sel_sp_as_i  : in     std_logic;
21
      sel_sp_in_i  : in     std_logic;
22
      sel_sp_val_i : in     std_logic;
23
      adr_nxt_sp_o : out    std_logic_vector (15 downto 0);
24
      adr_sp_o     : out    std_logic_vector (15 downto 0)
25
   );
26
 
27
-- Declarations
28
 
29
end Reg_SP ;
30
 
31
-- Jens-D. Gutschmidt     Project:  R6502_TC  
32
-- scantara2003@yahoo.de                      
33
-- COPYRIGHT (C) 2008 by Jens Gutschmidt and OPENCORES.ORG                                                                                     
34
--                                                                                                                                             
35
-- 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   
36
-- the Free Software Foundation, either version 3 of the License, or any later version.                                                        
37
--                                                                                                                                             
38
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of              
39
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.                                  
40
--                                                                                                                                             
41
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.     
42
--                                                                                                                                             
43
-- CVS Revisins History                                                                                                                        
44
--                                                                                                                                             
45 5 fpga_is_fu
-- $Log: not supported by cvs2svn $                                                                                                                                      
46 2 fpga_is_fu
-- Title:  Stack Pointer Logic  
47
-- Path:  R6502_TC/Reg_SP/struct  
48 5 fpga_is_fu
-- Edited:  by eda on 17 Apr 2008  
49 2 fpga_is_fu
--
50
-- VHDL Architecture R6502_TC.Reg_SP.struct
51
--
52
-- Created:
53
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
54 5 fpga_is_fu
--          at - 19:48:45 17.04.2008
55 2 fpga_is_fu
--
56
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
57
--
58
LIBRARY ieee;
59
USE ieee.std_logic_1164.all;
60
USE ieee.std_logic_arith.all;
61
 
62
 
63
architecture struct of Reg_SP is
64
 
65
   -- Architecture declarations
66
 
67
   -- Internal signal declarations
68
   signal d        : std_logic_vector(7 downto 0);
69
   signal dout1    : std_logic_vector(7 downto 0);
70
   signal dout2    : std_logic_vector(7 downto 0);
71
   signal dout3    : std_logic;
72
   signal load     : std_logic;
73
   signal load3    : std_logic;
74
   signal val_one  : std_logic_vector(7 downto 0);
75
   signal val_two  : std_logic_vector(7 downto 0);
76
   signal val_zero : std_logic_vector(7 downto 0);
77
 
78
   -- Implicit buffer signal declarations
79
   signal adr_sp_o_internal : std_logic_vector (15 downto 0);
80
 
81
 
82
   -- ModuleWare signal declarations(v1.9) for instance 'U_0' of 'adff'
83
   signal mw_U_0reg_cval : std_logic_vector(7 downto 0);
84
 
85
   -- ModuleWare signal declarations(v1.9) for instance 'U_4' of 'adff'
86
   signal mw_U_4reg_cval : std_logic_vector(7 downto 0);
87
 
88
 
89
begin
90
   -- Architecture concurrent statements
91
   -- HDL Embedded Text Block 2 eb2
92
   -- eb1 1
93
   val_zero (7 downto 0) <= X"00";
94
   val_one (7 downto 0) <= X"01";
95
   val_two (7 downto 0) <= X"02";
96
   adr_nxt_sp_o (15 downto 8) <= X"01";
97
 
98
   -- HDL Embedded Text Block 3 eb3
99
   -- eb1 1
100
   adr_nxt_sp_o (7 DOWNTO 0) <= d;
101
 
102
 
103
   -- ModuleWare code(v1.9) for instance 'U_11' of 'addsub'
104
   u_11combo_proc: process (adr_sp_o_internal(7 DOWNTO 0), dout1, dout3, val_zero(0))
105
   variable temp_din0 : std_logic_vector(8 downto 0);
106
   variable temp_din1 : std_logic_vector(8 downto 0);
107
   variable temp_sum : unsigned(8 downto 0);
108
   variable temp_carry : std_logic;
109
   begin
110
      temp_din0 := '0' & adr_sp_o_internal(7 DOWNTO 0);
111
      temp_din1 := '0' & dout1;
112
      temp_carry := val_zero(0);
113
      if (dout3 = '1') then
114
         temp_sum := unsigned(temp_din0) + unsigned(temp_din1) + temp_carry;
115
      else
116
         temp_sum := unsigned(temp_din0) - unsigned(temp_din1) - temp_carry;
117
      end if;
118
      dout2 <= conv_std_logic_vector(temp_sum(7 downto 0),8);
119
   end process u_11combo_proc;
120
 
121
   -- ModuleWare code(v1.9) for instance 'U_0' of 'adff'
122
   adr_sp_o_internal(7 DOWNTO 0) <= mw_U_0reg_cval;
123
   u_0seq_proc: process (clk_clk_i, rst_rst_i)
124
   begin
125
      if (rst_rst_i = '1') then
126
         mw_U_0reg_cval <= "00000000";
127
      elsif (clk_clk_i'event and clk_clk_i='1') then
128
         if (load = '1') then
129
            mw_U_0reg_cval <= d;
130
         end if;
131
      end if;
132
   end process u_0seq_proc;
133
 
134
   -- ModuleWare code(v1.9) for instance 'U_4' of 'adff'
135
   adr_sp_o_internal(15 DOWNTO 8) <= mw_U_4reg_cval;
136
   u_4seq_proc: process (clk_clk_i, rst_rst_i)
137
   begin
138
      if (rst_rst_i = '1') then
139
         mw_U_4reg_cval <= "00000000";
140
      elsif (clk_clk_i'event and clk_clk_i='1') then
141
         if (load3 = '1') then
142
            mw_U_4reg_cval <= val_one;
143
         end if;
144
      end if;
145
   end process u_4seq_proc;
146
 
147
   -- ModuleWare code(v1.9) for instance 'U_6' of 'and'
148
   load <= ld_sp_i and ld_i(0);
149
 
150
   -- ModuleWare code(v1.9) for instance 'U_7' of 'and'
151
   load3 <= ld_sp_i and ld_i(1);
152
 
153
   -- ModuleWare code(v1.9) for instance 'U_2' of 'inv'
154
   dout3 <= not(sel_sp_as_i);
155
 
156
   -- ModuleWare code(v1.9) for instance 'U_5' of 'mux'
157
   u_5combo_proc: process(val_one, val_two, sel_sp_val_i)
158
   begin
159
      case sel_sp_val_i is
160
      when '0' => dout1 <= val_one;
161
      when '1' => dout1 <= val_two;
162
      when others => dout1 <= (others => 'X');
163
      end case;
164
   end process u_5combo_proc;
165
 
166
   -- ModuleWare code(v1.9) for instance 'U_8' of 'mux'
167
   u_8combo_proc: process(dout2, adr_i(7 DOWNTO 0), sel_sp_in_i)
168
   begin
169
      case sel_sp_in_i is
170
      when '0' => d <= dout2;
171
      when '1' => d <= adr_i(7 DOWNTO 0);
172
      when others => d <= (others => 'X');
173
      end case;
174
   end process u_8combo_proc;
175
 
176
   -- Instance port mappings.
177
 
178
   -- Implicit buffered output assignments
179
   adr_sp_o <= adr_sp_o_internal;
180
 
181
end struct;

powered by: WebSVN 2.1.0

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