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

Subversion Repositories v6502

[/] [v6502/] [trunk/] [pr.vhd] - Diff between revs 4 and 6

Show entire file | Details | Blame | View Log

Rev 4 Rev 6
Line 34... Line 34...
end pr;
end pr;
 
 
architecture rtl of pr is
architecture rtl of pr is
constant NOP_P: STD_LOGIC_VECTOR(3 downto 0) := "0000"; -- PR no operation
constant NOP_P: STD_LOGIC_VECTOR(3 downto 0) := "0000"; -- PR no operation
constant PLD_P: STD_LOGIC_VECTOR(3 downto 0) := "0001"; -- PR load
constant PLD_P: STD_LOGIC_VECTOR(3 downto 0) := "0001"; -- PR load
constant FLD_P: STD_LOGIC_VECTOR(3 downto 0) := "0010"; -- NVZC load
constant FLD_P: STD_LOGIC_VECTOR(3 downto 0) := "0010"; -- NZ load
constant SEC_P: STD_LOGIC_VECTOR(3 downto 0) := "0011"; -- 1 => C 
constant FLC_P: STD_LOGIC_VECTOR(3 downto 0) := "0011"; -- NZC load
constant CLC_P: STD_LOGIC_VECTOR(3 downto 0) := "0100"; -- 0 => C 
constant FLV_P: STD_LOGIC_VECTOR(3 downto 0) := "0100"; -- NVZC load
constant SEI_P: STD_LOGIC_VECTOR(3 downto 0) := "0101"; -- 1 => I 
constant SEC_P: STD_LOGIC_VECTOR(3 downto 0) := "0101"; -- 1 => C 
constant CLI_P: STD_LOGIC_VECTOR(3 downto 0) := "0110"; -- 0 => I 
constant CLC_P: STD_LOGIC_VECTOR(3 downto 0) := "0110"; -- 0 => C 
constant SED_P: STD_LOGIC_VECTOR(3 downto 0) := "0111"; -- 1 => D 
constant SEI_P: STD_LOGIC_VECTOR(3 downto 0) := "0111"; -- 1 => I 
constant CLD_P: STD_LOGIC_VECTOR(3 downto 0) := "1000"; -- 0 => D 
constant CLI_P: STD_LOGIC_VECTOR(3 downto 0) := "1000"; -- 0 => I 
constant CLV_P: STD_LOGIC_VECTOR(3 downto 0) := "1010"; -- 0 => V 
constant SED_P: STD_LOGIC_VECTOR(3 downto 0) := "1001"; -- 1 => D 
constant AUC_P: STD_LOGIC_VECTOR(3 downto 0) := "1011"; -- auc => ACR 
constant CLD_P: STD_LOGIC_VECTOR(3 downto 0) := "1010"; -- 0 => D 
constant HAC_P: STD_LOGIC_VECTOR(3 downto 0) := "1100"; -- hold ACR 
constant CLV_P: STD_LOGIC_VECTOR(3 downto 0) := "1011"; -- 0 => V 
constant SID_P: STD_LOGIC_VECTOR(3 downto 0) := "1101"; -- 1 => I/D 
constant AUC_P: STD_LOGIC_VECTOR(3 downto 0) := "1100"; -- auc => ACR 
constant LDZ_P: STD_LOGIC_VECTOR(3 downto 0) := "1110"; -- Z load
constant HAC_P: STD_LOGIC_VECTOR(3 downto 0) := "1101"; -- hold ACR 
 
constant SID_P: STD_LOGIC_VECTOR(3 downto 0) := "1110"; -- 1 => I/D 
 
constant LDZ_P: STD_LOGIC_VECTOR(3 downto 0) := "1111"; -- Z load
 
 
signal  reg: STD_LOGIC_VECTOR(7 downto 0);
signal  reg: STD_LOGIC_VECTOR(7 downto 0);
signal  acr: STD_LOGIC;                                                   -- carry/borrow used for effectve address calculation 
signal  acr: STD_LOGIC;                                                   -- carry/borrow used for effectve address calculation 
signal i_so: STD_LOGIC;
signal i_so: STD_LOGIC;
 
 
Line 68... Line 70...
            case fc is
            case fc is
              when PLD_P  => reg(7 downto 6) <= din(7 downto 6);            -- load NV1BDIZC 
              when PLD_P  => reg(7 downto 6) <= din(7 downto 6);            -- load NV1BDIZC 
                             reg(5)          <= '1';
                             reg(5)          <= '1';
                             reg(4 downto 0) <= din(4 downto 0);
                             reg(4 downto 0) <= din(4 downto 0);
                             acr <= '0';
                             acr <= '0';
              when FLD_P  => reg <= n & v & '1' & reg(4 downto 2) & z & c;  -- load NVZC
              when FLD_P  => reg <= n & reg(6) & '1' & reg(4 downto 2) & z & reg(0);  -- load NZ
 
                             acr <= '0';
 
              when FLC_P  => reg <= n & reg(6) & '1' & reg(4 downto 2) & z & c;       -- load NZC
 
                             acr <= '0';
 
              when FLV_P  => reg <= n & v & '1' & reg(4 downto 2) & z & c;            -- load NZCV
                             acr <= '0';
                             acr <= '0';
              when SEC_P  => reg <= reg or  "00000001";                     -- 1 => C
              when SEC_P  => reg <= reg or  "00000001";                     -- 1 => C
                             acr <= acr;
                             acr <= acr;
              when CLC_P  => reg <= reg and "11111110";                     -- 0 => C
              when CLC_P  => reg <= reg and "11111110";                     -- 0 => C
                             acr <= acr;
                             acr <= acr;

powered by: WebSVN 2.1.0

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