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 18

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 8 fpga_is_fu
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
5
--          at - 22:42:53 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 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 8 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 8 fpga_is_fu
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
53
--          at - 22:42:53 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 8 fpga_is_fu
architecture struct of Reg_SP is
63 2 fpga_is_fu
 
64
   -- Architecture declarations
65
 
66
   -- Internal signal declarations
67 8 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 8 fpga_is_fu
   signal adr_sp_o_internal : std_logic_vector (15 downto 0);
76 2 fpga_is_fu
 
77
 
78 8 fpga_is_fu
   -- ModuleWare signal declarations(v1.9) for instance 'U_11' of 'addsub'
79
   signal mw_U_11temp_din0 : std_logic_vector(8 downto 0);
80
   signal mw_U_11temp_din1 : std_logic_vector(8 downto 0);
81
   signal mw_U_11sum : unsigned(8 downto 0);
82
 
83 2 fpga_is_fu
   -- ModuleWare signal declarations(v1.9) for instance 'U_0' of 'adff'
84 8 fpga_is_fu
   signal mw_U_0reg_cval : std_logic_vector(7 downto 0);
85 2 fpga_is_fu
 
86
 
87 8 fpga_is_fu
begin
88 2 fpga_is_fu
 
89
   -- ModuleWare code(v1.9) for instance 'U_11' of 'addsub'
90 8 fpga_is_fu
   mw_U_11temp_din0 <= '0' & adr_sp_low_o_i;
91
   mw_U_11temp_din1 <= '0' & val_one;
92
   u_11combo_proc: process (mw_U_11temp_din0, mw_U_11temp_din1, sp_as_n_o_i)
93
   variable temp_carry : std_logic;
94
   begin
95 6 fpga_is_fu
      temp_carry := '0';
96 8 fpga_is_fu
      if (sp_as_n_o_i = '1') then
97
         mw_U_11sum <= unsigned(mw_U_11temp_din0) + unsigned(mw_U_11temp_din1) + temp_carry;
98
      else
99
         mw_U_11sum <= unsigned(mw_U_11temp_din0) - unsigned(mw_U_11temp_din1) - temp_carry;
100
      end if;
101
   end process u_11combo_proc;
102
   result_low_o_i <= conv_std_logic_vector(mw_U_11sum(7 downto 0),8);
103 2 fpga_is_fu
 
104
   -- ModuleWare code(v1.9) for instance 'U_0' of 'adff'
105
   adr_sp_o_internal(7 DOWNTO 0) <= mw_U_0reg_cval;
106 8 fpga_is_fu
   u_0seq_proc: process (clk_clk_i, rst_rst_n_i)
107
   begin
108
      if (rst_rst_n_i = '0') then
109 2 fpga_is_fu
         mw_U_0reg_cval <= "00000000";
110 8 fpga_is_fu
      elsif (clk_clk_i'event and clk_clk_i='1') then
111
         if (load_o_i = '1') then
112 6 fpga_is_fu
            mw_U_0reg_cval <= result_low1_o_i;
113 8 fpga_is_fu
         end if;
114
      end if;
115
   end process u_0seq_proc;
116 2 fpga_is_fu
 
117
   -- ModuleWare code(v1.9) for instance 'U_6' of 'and'
118 8 fpga_is_fu
   load_o_i <= ld_sp_i and ld_low_i;
119 2 fpga_is_fu
 
120 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_3' of 'buff'
121
   adr_sp_o_internal(15 DOWNTO 8) <= val_one;
122 2 fpga_is_fu
 
123 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_4' of 'constval'
124
   val_one <= "00000001";
125
 
126 2 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_2' of 'inv'
127 8 fpga_is_fu
   sp_as_n_o_i <= not(sel_sp_as_i);
128 2 fpga_is_fu
 
129
   -- ModuleWare code(v1.9) for instance 'U_8' of 'mux'
130 8 fpga_is_fu
   u_8combo_proc: process(result_low_o_i, adr_low_i, sel_sp_in_i)
131
   begin
132
      case sel_sp_in_i is
133
      when '0' => result_low1_o_i <= result_low_o_i;
134
      when '1' => result_low1_o_i <= adr_low_i;
135
      when others => result_low1_o_i <= (others => 'X');
136
      end case;
137
   end process u_8combo_proc;
138 2 fpga_is_fu
 
139 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_10' of 'tap'
140 8 fpga_is_fu
   adr_sp_low_o_i <= adr_sp_o_internal(7 downto 0);
141 6 fpga_is_fu
 
142 2 fpga_is_fu
   -- Instance port mappings.
143
 
144
   -- Implicit buffered output assignments
145
   adr_sp_o <= adr_sp_o_internal;
146
 
147 8 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.