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

Subversion Repositories cpu65c02_true_cycle

[/] [cpu65c02_true_cycle/] [trunk/] [released/] [rtl/] [v2_00/] [vhdl/] [reg_sp.vhd] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 fpga_is_fu
LIBRARY ieee;
2
USE ieee.std_logic_1164.all;
3
USE ieee.std_logic_arith.all;
4
 
5
entity reg_sp is
6
   port(
7
      adr_low_i   : in     std_logic_vector (7 downto 0);
8
      clk_clk_i   : in     std_logic;
9
      ld_low_i    : in     std_logic;
10
      ld_sp_i     : in     std_logic;
11
      rst_rst_n_i : in     std_logic;
12
      sel_sp_as_i : in     std_logic;
13
      sel_sp_in_i : in     std_logic;
14
      adr_sp_o    : out    std_logic_vector (15 downto 0)
15
   );
16
 
17
-- Declarations
18
 
19
end reg_sp ;
20
-- (C) 2008 - 2021 Jens Gutschmidt
21
-- (email: opencores@vivare-services.com)
22
-- 
23
-- Versions:
24
-- Revision 1.7  2013/07/21 11:11:00  jens
25
-- - Changing the title block and internal revision history
26
-- 
27
-- Revision 1.6  2009/01/04 10:20:47  eda
28
-- Changes for cosmetic issues only
29
-- 
30
-- Revision 1.5  2009/01/04 09:23:10  eda
31
-- - Delete unused nets and blocks (same as R6502_TC)
32
-- - Rename blocks
33
-- 
34
-- Revision 1.4  2009/01/03 16:53:02  eda
35
-- - Unused nets and blocks deleted
36
-- - Renamed blocks
37
-- 
38
-- Revision 1.3  2009/01/03 16:42:02  eda
39
-- - Unused nets and blocks deleted
40
-- - Renamed blocks
41
-- 
42
-- Revision 1.2  2008/12/31 19:31:24  eda
43
-- Production Release
44
--  
45
-- 
46
--
47
-- r65c02_tc.reg_sp.struct
48
--
49
-- Date:    06.01.2021
50
-- Time:    22:58:19
51
-- By:        VIVARE GmbH, Switzerland
52
--
53
-- COPYRIGHT (C) 2008 - 2021 by Jens Gutschmidt
54
-- 
55
-- 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.
56
-- 
57
-- 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.
58
-- 
59
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
60
-- 
61
-- 
62
LIBRARY ieee;
63
USE ieee.std_logic_1164.all;
64
USE ieee.std_logic_arith.all;
65
 
66
 
67
architecture struct of reg_sp is
68
 
69
   -- Architecture declarations
70
 
71
   -- Internal signal declarations
72
   signal adr_sp_low_o_i  : std_logic_vector(7 downto 0);
73
   signal load_o_i        : std_logic;
74
   signal result_low1_o_i : std_logic_vector(7 downto 0);
75
   signal result_low_o_i  : std_logic_vector(7 downto 0);
76
   signal sp_as_n_o_i     : std_logic;
77
   signal val_one         : std_logic_vector(7 downto 0);
78
 
79
   -- Implicit buffer signal declarations
80
   signal adr_sp_o_internal : std_logic_vector (15 downto 0);
81
 
82
 
83
   -- ModuleWare signal declarations(v1.12) for instance 'U_0' of 'adff'
84
   signal mw_U_0reg_cval : std_logic_vector(7 downto 0);
85
 
86
 
87
begin
88
 
89
   -- ModuleWare code(v1.12) for instance 'U_11' of 'addsub'
90
   u_11combo_proc: process (adr_sp_low_o_i, val_one, sp_as_n_o_i)
91
   variable temp_din0 : std_logic_vector(8 downto 0);
92
   variable temp_din1 : std_logic_vector(8 downto 0);
93
   variable temp_sum : unsigned(8 downto 0);
94
   variable temp_carry : std_logic;
95
   begin
96
      temp_din0 := '0' & adr_sp_low_o_i;
97
      temp_din1 := '0' & val_one;
98
      temp_carry := '0';
99
      if (sp_as_n_o_i = '1') then
100
         temp_sum := unsigned(temp_din0) + unsigned(temp_din1) + temp_carry;
101
      else
102
         temp_sum := unsigned(temp_din0) - unsigned(temp_din1) - temp_carry;
103
      end if;
104
      result_low_o_i <= conv_std_logic_vector(temp_sum(7 downto 0),8);
105
   end process u_11combo_proc;
106
 
107
   -- ModuleWare code(v1.12) for instance 'U_0' of 'adff'
108
   adr_sp_o_internal(7 DOWNTO 0) <= mw_U_0reg_cval;
109
   u_0seq_proc: process (clk_clk_i, rst_rst_n_i)
110
   begin
111
      if (rst_rst_n_i = '0') then
112
         mw_U_0reg_cval <= "00000000";
113
      elsif (clk_clk_i'event and clk_clk_i='1') then
114
         if (load_o_i = '1') then
115
            mw_U_0reg_cval <= result_low1_o_i;
116
         end if;
117
      end if;
118
   end process u_0seq_proc;
119
 
120
   -- ModuleWare code(v1.12) for instance 'U_6' of 'and'
121
   load_o_i <= ld_sp_i and ld_low_i;
122
 
123
   -- ModuleWare code(v1.12) for instance 'U_3' of 'buff'
124
   adr_sp_o_internal(15 DOWNTO 8) <= val_one;
125
 
126
   -- ModuleWare code(v1.12) for instance 'U_4' of 'constval'
127
   val_one <= "00000001";
128
 
129
   -- ModuleWare code(v1.12) for instance 'U_2' of 'inv'
130
   sp_as_n_o_i <= not(sel_sp_as_i);
131
 
132
   -- ModuleWare code(v1.12) for instance 'U_8' of 'mux'
133
   u_8combo_proc: process(result_low_o_i, adr_low_i, sel_sp_in_i)
134
   begin
135
      case sel_sp_in_i is
136
      when '0' => result_low1_o_i <= result_low_o_i;
137
      when '1' => result_low1_o_i <= adr_low_i;
138
      when others => result_low1_o_i <= (others => 'X');
139
      end case;
140
   end process u_8combo_proc;
141
 
142
   -- ModuleWare code(v1.12) for instance 'U_10' of 'tap'
143
   adr_sp_low_o_i <= adr_sp_o_internal(7 downto 0);
144
 
145
   -- Instance port mappings.
146
 
147
   -- Implicit buffered output assignments
148
   adr_sp_o <= adr_sp_o_internal;
149
 
150
end struct;

powered by: WebSVN 2.1.0

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