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] - Diff between revs 5 and 11

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 5 Rev 11
Line 1... Line 1...
-- VHDL Entity R6502_TC.Reg_SP.symbol
-- VHDL Entity R6502_TC.Reg_SP.symbol
--
--
-- Created:
-- Created:
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
--          at - 19:48:44 17.04.2008
--          at - 22:53:06 04.01.2009
--
--
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
--
--
LIBRARY ieee;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
USE ieee.std_logic_arith.all;
 
 
entity Reg_SP is
entity Reg_SP is
   port(
   port(
      adr_i        : in     std_logic_vector (15 downto 0);
      adr_low_i   : in     std_logic_vector (7 downto 0);
      clk_clk_i    : in     std_logic;
      clk_clk_i    : in     std_logic;
      ld_i         : in     std_logic_vector (1 downto 0);
      ld_low_i    : in     std_logic;
      ld_sp_i      : in     std_logic;
      ld_sp_i      : in     std_logic;
      rst_rst_i    : in     std_logic;
      rst_rst_n_i : in     std_logic;
      sel_sp_as_i  : in     std_logic;
      sel_sp_as_i  : in     std_logic;
      sel_sp_in_i  : in     std_logic;
      sel_sp_in_i  : in     std_logic;
      sel_sp_val_i : in     std_logic;
 
      adr_nxt_sp_o : out    std_logic_vector (15 downto 0);
 
      adr_sp_o     : out    std_logic_vector (15 downto 0)
      adr_sp_o     : out    std_logic_vector (15 downto 0)
   );
   );
 
 
-- Declarations
-- Declarations
 
 
Line 41... Line 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/>.     
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.     
--                                                                                                                                             
--                                                                                                                                             
-- CVS Revisins History                                                                                                                        
-- CVS Revisins History                                                                                                                        
--                                                                                                                                             
--                                                                                                                                             
-- $Log: not supported by cvs2svn $                                                                                                                                      
-- $Log: not supported by cvs2svn $                                                                                                                                      
 
--   <<-- more -->>                                                                                                                            
-- Title:  Stack Pointer Logic  
-- Title:  Stack Pointer Logic  
-- Path:  R6502_TC/Reg_SP/struct  
-- Path:  R6502_TC/Reg_SP/struct  
-- Edited:  by eda on 17 Apr 2008  
-- Edited:  by eda on 01 Jan 2009  
--
--
-- VHDL Architecture R6502_TC.Reg_SP.struct
-- VHDL Architecture R6502_TC.Reg_SP.struct
--
--
-- Created:
-- Created:
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
--          at - 19:48:45 17.04.2008
--          at - 22:53:06 04.01.2009
--
--
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
--
--
LIBRARY ieee;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_1164.all;
Line 63... Line 62...
architecture struct of Reg_SP is
architecture struct of Reg_SP is
 
 
   -- Architecture declarations
   -- Architecture declarations
 
 
   -- Internal signal declarations
   -- Internal signal declarations
   signal d        : std_logic_vector(7 downto 0);
   signal adr_sp_low_o_i  : std_logic_vector(7 downto 0);
   signal dout1    : std_logic_vector(7 downto 0);
   signal load_o_i        : std_logic;
   signal dout2    : std_logic_vector(7 downto 0);
   signal result_low1_o_i : std_logic_vector(7 downto 0);
   signal dout3    : std_logic;
   signal result_low_o_i  : std_logic_vector(7 downto 0);
   signal load     : std_logic;
   signal sp_as_n_o_i     : std_logic;
   signal load3    : std_logic;
 
   signal val_one  : std_logic_vector(7 downto 0);
   signal val_one  : std_logic_vector(7 downto 0);
   signal val_two  : std_logic_vector(7 downto 0);
 
   signal val_zero : std_logic_vector(7 downto 0);
 
 
 
   -- Implicit buffer signal declarations
   -- Implicit buffer signal declarations
   signal adr_sp_o_internal : std_logic_vector (15 downto 0);
   signal adr_sp_o_internal : std_logic_vector (15 downto 0);
 
 
 
 
 
   -- ModuleWare signal declarations(v1.9) for instance 'U_11' of 'addsub'
 
   signal mw_U_11temp_din0 : std_logic_vector(8 downto 0);
 
   signal mw_U_11temp_din1 : std_logic_vector(8 downto 0);
 
   signal mw_U_11sum : unsigned(8 downto 0);
 
 
   -- ModuleWare signal declarations(v1.9) for instance 'U_0' of 'adff'
   -- ModuleWare signal declarations(v1.9) for instance 'U_0' of 'adff'
   signal mw_U_0reg_cval : std_logic_vector(7 downto 0);
   signal mw_U_0reg_cval : std_logic_vector(7 downto 0);
 
 
   -- ModuleWare signal declarations(v1.9) for instance 'U_4' of 'adff'
 
   signal mw_U_4reg_cval : std_logic_vector(7 downto 0);
 
 
 
 
 
begin
begin
   -- Architecture concurrent statements
 
   -- HDL Embedded Text Block 2 eb2
 
   -- eb1 1
 
   val_zero (7 downto 0) <= X"00";
 
   val_one (7 downto 0) <= X"01";
 
   val_two (7 downto 0) <= X"02";
 
   adr_nxt_sp_o (15 downto 8) <= X"01";
 
 
 
   -- HDL Embedded Text Block 3 eb3
 
   -- eb1 1
 
   adr_nxt_sp_o (7 DOWNTO 0) <= d;
 
 
 
 
 
   -- ModuleWare code(v1.9) for instance 'U_11' of 'addsub'
   -- ModuleWare code(v1.9) for instance 'U_11' of 'addsub'
   u_11combo_proc: process (adr_sp_o_internal(7 DOWNTO 0), dout1, dout3, val_zero(0))
   mw_U_11temp_din0 <= '0' & adr_sp_low_o_i;
   variable temp_din0 : std_logic_vector(8 downto 0);
   mw_U_11temp_din1 <= '0' & val_one;
   variable temp_din1 : std_logic_vector(8 downto 0);
   u_11combo_proc: process (mw_U_11temp_din0, mw_U_11temp_din1, sp_as_n_o_i)
   variable temp_sum : unsigned(8 downto 0);
 
   variable temp_carry : std_logic;
   variable temp_carry : std_logic;
   begin
   begin
      temp_din0 := '0' & adr_sp_o_internal(7 DOWNTO 0);
      temp_carry := '0';
      temp_din1 := '0' & dout1;
      if (sp_as_n_o_i = '1') then
      temp_carry := val_zero(0);
         mw_U_11sum <= unsigned(mw_U_11temp_din0) + unsigned(mw_U_11temp_din1) + temp_carry;
      if (dout3 = '1') then
 
         temp_sum := unsigned(temp_din0) + unsigned(temp_din1) + temp_carry;
 
      else
      else
         temp_sum := unsigned(temp_din0) - unsigned(temp_din1) - temp_carry;
         mw_U_11sum <= unsigned(mw_U_11temp_din0) - unsigned(mw_U_11temp_din1) - temp_carry;
      end if;
      end if;
      dout2 <= conv_std_logic_vector(temp_sum(7 downto 0),8);
 
   end process u_11combo_proc;
   end process u_11combo_proc;
 
   result_low_o_i <= conv_std_logic_vector(mw_U_11sum(7 downto 0),8);
 
 
   -- ModuleWare code(v1.9) for instance 'U_0' of 'adff'
   -- ModuleWare code(v1.9) for instance 'U_0' of 'adff'
   adr_sp_o_internal(7 DOWNTO 0) <= mw_U_0reg_cval;
   adr_sp_o_internal(7 DOWNTO 0) <= mw_U_0reg_cval;
   u_0seq_proc: process (clk_clk_i, rst_rst_i)
   u_0seq_proc: process (clk_clk_i, rst_rst_n_i)
   begin
   begin
      if (rst_rst_i = '1') then
      if (rst_rst_n_i = '0') then
         mw_U_0reg_cval <= "00000000";
         mw_U_0reg_cval <= "00000000";
      elsif (clk_clk_i'event and clk_clk_i='1') then
      elsif (clk_clk_i'event and clk_clk_i='1') then
         if (load = '1') then
         if (load_o_i = '1') then
            mw_U_0reg_cval <= d;
            mw_U_0reg_cval <= result_low1_o_i;
         end if;
         end if;
      end if;
      end if;
   end process u_0seq_proc;
   end process u_0seq_proc;
 
 
   -- ModuleWare code(v1.9) for instance 'U_4' of 'adff'
 
   adr_sp_o_internal(15 DOWNTO 8) <= mw_U_4reg_cval;
 
   u_4seq_proc: process (clk_clk_i, rst_rst_i)
 
   begin
 
      if (rst_rst_i = '1') then
 
         mw_U_4reg_cval <= "00000000";
 
      elsif (clk_clk_i'event and clk_clk_i='1') then
 
         if (load3 = '1') then
 
            mw_U_4reg_cval <= val_one;
 
         end if;
 
      end if;
 
   end process u_4seq_proc;
 
 
 
   -- ModuleWare code(v1.9) for instance 'U_6' of 'and'
   -- ModuleWare code(v1.9) for instance 'U_6' of 'and'
   load <= ld_sp_i and ld_i(0);
   load_o_i <= ld_sp_i and ld_low_i;
 
 
   -- ModuleWare code(v1.9) for instance 'U_7' of 'and'
   -- ModuleWare code(v1.9) for instance 'U_3' of 'buff'
   load3 <= ld_sp_i and ld_i(1);
   adr_sp_o_internal(15 DOWNTO 8) <= val_one;
 
 
   -- ModuleWare code(v1.9) for instance 'U_2' of 'inv'
   -- ModuleWare code(v1.9) for instance 'U_4' of 'constval'
   dout3 <= not(sel_sp_as_i);
   val_one <= "00000001";
 
 
   -- ModuleWare code(v1.9) for instance 'U_5' of 'mux'
   -- ModuleWare code(v1.9) for instance 'U_2' of 'inv'
   u_5combo_proc: process(val_one, val_two, sel_sp_val_i)
   sp_as_n_o_i <= not(sel_sp_as_i);
   begin
 
      case sel_sp_val_i is
 
      when '0' => dout1 <= val_one;
 
      when '1' => dout1 <= val_two;
 
      when others => dout1 <= (others => 'X');
 
      end case;
 
   end process u_5combo_proc;
 
 
 
   -- ModuleWare code(v1.9) for instance 'U_8' of 'mux'
   -- ModuleWare code(v1.9) for instance 'U_8' of 'mux'
   u_8combo_proc: process(dout2, adr_i(7 DOWNTO 0), sel_sp_in_i)
   u_8combo_proc: process(result_low_o_i, adr_low_i, sel_sp_in_i)
   begin
   begin
      case sel_sp_in_i is
      case sel_sp_in_i is
      when '0' => d <= dout2;
      when '0' => result_low1_o_i <= result_low_o_i;
      when '1' => d <= adr_i(7 DOWNTO 0);
      when '1' => result_low1_o_i <= adr_low_i;
      when others => d <= (others => 'X');
      when others => result_low1_o_i <= (others => 'X');
      end case;
      end case;
   end process u_8combo_proc;
   end process u_8combo_proc;
 
 
 
   -- ModuleWare code(v1.9) for instance 'U_10' of 'tap'
 
   adr_sp_low_o_i <= adr_sp_o_internal(7 downto 0);
 
 
   -- Instance port mappings.
   -- Instance port mappings.
 
 
   -- Implicit buffered output assignments
   -- Implicit buffered output assignments
   adr_sp_o <= adr_sp_o_internal;
   adr_sp_o <= adr_sp_o_internal;
 
 

powered by: WebSVN 2.1.0

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