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/] [reg_sp.vhd] - Blame information for rev 6

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 6 fpga_is_fu
--          by - eda.UNKNOWN (TEST)
5
--          at - 21:30:20 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 Reg_SP IS
14
   PORT(
15
      adr_low_i   : IN     std_logic_vector (7 DOWNTO 0);
16
      clk_clk_i   : IN     std_logic;
17
      ld_low_i    : IN     std_logic;
18
      ld_sp_i     : IN     std_logic;
19
      rst_rst_n_i : IN     std_logic;
20
      sel_sp_as_i : IN     std_logic;
21
      sel_sp_in_i : IN     std_logic;
22
      adr_sp_o    : OUT    std_logic_vector (15 DOWNTO 0)
23 2 fpga_is_fu
   );
24
 
25
-- Declarations
26
 
27 6 fpga_is_fu
END Reg_SP ;
28 2 fpga_is_fu
 
29
-- Jens-D. Gutschmidt     Project:  R6502_TC  
30
-- scantara2003@yahoo.de                      
31
-- COPYRIGHT (C) 2008 by Jens Gutschmidt and OPENCORES.ORG                                                                                     
32
--                                                                                                                                             
33
-- 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   
34
-- the Free Software Foundation, either version 3 of the License, or any later version.                                                        
35
--                                                                                                                                             
36
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of              
37
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.                                  
38
--                                                                                                                                             
39
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.     
40
--                                                                                                                                             
41
-- CVS Revisins History                                                                                                                        
42
--                                                                                                                                             
43 6 fpga_is_fu
-- $Log: not supported by cvs2svn $                                                                                                                         
44
--   <<-- more -->>                                                                                                                            
45 2 fpga_is_fu
-- Title:  Stack Pointer Logic  
46
-- Path:  R6502_TC/Reg_SP/struct  
47 6 fpga_is_fu
-- Edited:  by eda on 01 Jan 2009  
48 2 fpga_is_fu
--
49
-- VHDL Architecture R6502_TC.Reg_SP.struct
50
--
51
-- Created:
52 6 fpga_is_fu
--          by - eda.UNKNOWN (TEST)
53
--          at - 21:30:20 04.01.2009
54 2 fpga_is_fu
--
55
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
56
--
57
LIBRARY ieee;
58
USE ieee.std_logic_1164.all;
59
USE ieee.std_logic_arith.all;
60
 
61
 
62 6 fpga_is_fu
ARCHITECTURE struct OF Reg_SP IS
63 2 fpga_is_fu
 
64
   -- Architecture declarations
65
 
66
   -- Internal signal declarations
67 6 fpga_is_fu
   SIGNAL adr_sp_low_o_i  : std_logic_vector(7 DOWNTO 0);
68
   SIGNAL load_o_i        : std_logic;
69
   SIGNAL result_low1_o_i : std_logic_vector(7 DOWNTO 0);
70
   SIGNAL result_low_o_i  : std_logic_vector(7 DOWNTO 0);
71
   SIGNAL sp_as_n_o_i     : std_logic;
72
   SIGNAL val_one         : std_logic_vector(7 DOWNTO 0);
73 2 fpga_is_fu
 
74
   -- Implicit buffer signal declarations
75 6 fpga_is_fu
   SIGNAL adr_sp_o_internal : std_logic_vector (15 DOWNTO 0);
76 2 fpga_is_fu
 
77
 
78
   -- ModuleWare signal declarations(v1.9) for instance 'U_0' of 'adff'
79 6 fpga_is_fu
   SIGNAL mw_U_0reg_cval : std_logic_vector(7 DOWNTO 0);
80 2 fpga_is_fu
 
81
 
82 6 fpga_is_fu
BEGIN
83 2 fpga_is_fu
 
84
   -- ModuleWare code(v1.9) for instance 'U_11' of 'addsub'
85 6 fpga_is_fu
   u_11combo_proc: PROCESS (adr_sp_low_o_i, val_one, sp_as_n_o_i)
86
   VARIABLE temp_din0 : std_logic_vector(8 DOWNTO 0);
87
   VARIABLE temp_din1 : std_logic_vector(8 DOWNTO 0);
88
   VARIABLE temp_sum : unsigned(8 DOWNTO 0);
89
   VARIABLE temp_carry : std_logic;
90
   BEGIN
91
      temp_din0 := '0' & adr_sp_low_o_i;
92
      temp_din1 := '0' & val_one;
93
      temp_carry := '0';
94
      IF (sp_as_n_o_i = '1' OR sp_as_n_o_i = 'H') THEN
95 2 fpga_is_fu
         temp_sum := unsigned(temp_din0) + unsigned(temp_din1) + temp_carry;
96 6 fpga_is_fu
      ELSE
97 2 fpga_is_fu
         temp_sum := unsigned(temp_din0) - unsigned(temp_din1) - temp_carry;
98 6 fpga_is_fu
      END IF;
99
      result_low_o_i <= conv_std_logic_vector(temp_sum(7 DOWNTO 0),8);
100
   END PROCESS u_11combo_proc;
101 2 fpga_is_fu
 
102
   -- ModuleWare code(v1.9) for instance 'U_0' of 'adff'
103
   adr_sp_o_internal(7 DOWNTO 0) <= mw_U_0reg_cval;
104 6 fpga_is_fu
   u_0seq_proc: PROCESS (clk_clk_i, rst_rst_n_i)
105
   BEGIN
106
      IF (rst_rst_n_i = '0' OR rst_rst_n_i = 'L') THEN
107 2 fpga_is_fu
         mw_U_0reg_cval <= "00000000";
108 6 fpga_is_fu
      ELSIF (clk_clk_i'EVENT AND clk_clk_i='1') THEN
109
         IF (load_o_i = '1' OR load_o_i = 'H') THEN
110
            mw_U_0reg_cval <= result_low1_o_i;
111
         END IF;
112
      END IF;
113
   END PROCESS u_0seq_proc;
114 2 fpga_is_fu
 
115
   -- ModuleWare code(v1.9) for instance 'U_6' of 'and'
116 6 fpga_is_fu
   load_o_i <= ld_sp_i AND ld_low_i;
117 2 fpga_is_fu
 
118 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_3' of 'buff'
119
   adr_sp_o_internal(15 DOWNTO 8) <= val_one;
120 2 fpga_is_fu
 
121 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_4' of 'constval'
122
   val_one <= "00000001";
123
 
124 2 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_2' of 'inv'
125 6 fpga_is_fu
   sp_as_n_o_i <= NOT(sel_sp_as_i);
126 2 fpga_is_fu
 
127
   -- ModuleWare code(v1.9) for instance 'U_8' of 'mux'
128 6 fpga_is_fu
   u_8combo_proc: PROCESS(result_low_o_i, adr_low_i, sel_sp_in_i)
129
   BEGIN
130
      CASE sel_sp_in_i IS
131
      WHEN '0'|'L' => result_low1_o_i <= result_low_o_i;
132
      WHEN '1'|'H' => result_low1_o_i <= adr_low_i;
133
      WHEN OTHERS => result_low1_o_i <= (OTHERS => 'X');
134
      END CASE;
135
   END PROCESS u_8combo_proc;
136 2 fpga_is_fu
 
137 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_10' of 'tap'
138
   adr_sp_low_o_i <= adr_sp_o_internal(7 DOWNTO 0);
139
 
140 2 fpga_is_fu
   -- Instance port mappings.
141
 
142
   -- Implicit buffered output assignments
143
   adr_sp_o <= adr_sp_o_internal;
144
 
145 6 fpga_is_fu
END struct;

powered by: WebSVN 2.1.0

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