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

Subversion Repositories cpu_lecture

[/] [cpu_lecture/] [trunk/] [src/] [opc_fetch.vhd] - Diff between revs 13 and 18

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

Rev 13 Rev 18
Line 64... Line 64...
signal P_PC             : std_logic_vector(15 downto 0);
signal P_PC             : std_logic_vector(15 downto 0);
 
 
signal L_INVALIDATE     : std_logic;
signal L_INVALIDATE     : std_logic;
signal L_LONG_OP        : std_logic;
signal L_LONG_OP        : std_logic;
signal L_NEXT_PC        : std_logic_vector(15 downto 0);
signal L_NEXT_PC        : std_logic_vector(15 downto 0);
 
signal L_OPC_10q0_qq0   : std_logic;
 
signal L_OPC_9_000      : std_logic;
 
signal L_OPC_9_5_000x_8 : std_logic;
 
signal L_OPC_9_5_110x_8 : std_logic;
 
signal L_OPC_9_10x1     : std_logic;
 
signal L_OPC_F_11       : std_logic;
signal L_PC             : std_logic_vector(15 downto 0);
signal L_PC             : std_logic_vector(15 downto 0);
signal L_T0             : std_logic;
signal L_T0             : std_logic;
signal L_WAIT           : std_logic;
signal L_WAIT           : std_logic;
 
 
begin
begin
Line 111... Line 117...
                            (P_OPC( 3 downto  0) = "0000")))    -- LDS, STS
                            (P_OPC( 3 downto  0) = "0000")))    -- LDS, STS
            else '0';
            else '0';
 
 
    -- Two cycle opcodes:
    -- Two cycle opcodes:
    --
    --
    -- 10q0 qq0d dddd 1qqq - LDD (Y + q)
    -- 10q0 qq0d dddd 1qqq - LDD (Y + q)    L_OPC_10q0_qq0
    -- 10q0 qq0d dddd 0qqq - LDD (Z + q)
    -- 10q0 qq0d dddd 0qqq - LDD (Z + q)    L_OPC_10q0_qq0
    -- 1001 000d dddd .... - LDS etc.
    -- 1001 000d dddd .... - LDS etc.       L_OPC_9_000
    -- 1001 0101 0000 1000 - RET
    -- 1001 0101 0000 1000 - RET            L_OPC_9_5_000x_8
    -- 1001 0101 0001 1000 - RETI
    -- 1001 0101 0001 1000 - RETI           L_OPC_9_5_000x_8
    -- 1001 1001 AAAA Abbb - SBIC
    -- 1001 0101 1100 1000 - LPM            L_OPC_9_5_110x_8
    -- 1001 1011 AAAA Abbb - SBIS
    -- 1001 0101 1101 1000 - ELPM           L_OPC_9_5_110x_8
    -- 1111 110r rrrr 0bbb - SBRC
    -- 1001 1001 AAAA Abbb - SBIC           L_OPC_9_10x1
    -- 1111 111r rrrr 0bbb - SBRS
    -- 1001 1011 AAAA Abbb - SBIS           L_OPC_9_10x1
 
    -- 1111 110r rrrr 0bbb - SBRC           L_OPC_F_11
 
    -- 1111 111r rrrr 0bbb - SBRS           L_OPC_F_11
    --
    --
    L_WAIT <= '0'  when ((L_INVALIDATE = '1') or (I_INTVEC(5)  = '1'))
    L_OPC_10q0_qq0   <= '1' when ((P_OPC(15 downto 14) = "10" )
         else L_T0 when ( (   (P_OPC(15 downto  14) = "10" )        -- LDD
 
                          and (P_OPC(12) = '0')
                          and (P_OPC(12) = '0')
                          and (P_OPC( 9) = '0') )
                             and  (P_OPC( 9) = '0'))                   else '0';
                     or (      P_OPC(15 downto   9) = "1001000")    -- LDS etc.
    L_OPC_9_000      <= '1' when ( P_OPC(15 downto  9) = "1001000")    else '0';
                     or ( (    P_OPC(15 downto   8) = "10010101")   -- RET etc.
    L_OPC_9_5_000x_8 <= '1' when ((P_OPC(15 downto  5) = "10010101000")
                          and (P_OPC( 3 downto 0) /= "1010"))   -- but not DEC
                             and  (P_OPC( 3 downto  0) = "1000"))      else '0';
                     or ( (    P_OPC(15 downto 10) = "100110")      -- SBI[CS]
    L_OPC_9_5_110x_8 <= '1' when ((P_OPC(15 downto  5) = "10010101110")
                          and (P_OPC(8) = '1'))
                             and  (P_OPC( 3 downto  0) = "1000"))      else '0';
                     or  (P_OPC(15 downto  10) = "111111"))         -- SBR[CS]
    L_OPC_9_10x1     <= '1' when ((P_OPC(15 downto 10) = "100110")
         else '0';
                             and  (P_OPC(8) = '1'))                    else '0';
 
    L_OPC_F_11       <= '1' when ( P_OPC(15 downto  10) = "111111")    else '0';
 
 
 
    L_WAIT <= L_T0 and (L_OPC_10q0_qq0   or     -- LDD
 
                        L_OPC_9_000      or     -- LDS, LD, LPM, POP
 
                        L_OPC_9_5_000x_8 or     -- RET, RETI, LPM
 
                        L_OPC_9_5_110x_8 or     -- LPM, ELPM
 
                        L_OPC_9_10x1     or     -- SBIC, SBIS
 
                        L_OPC_F_11)             -- SBRC, SBRS
 
                   and (not L_INVALIDATE)
 
                   and (not I_INTVEC(5));
 
 
    L_INVALIDATE <= I_CLR or I_SKIP;
    L_INVALIDATE <= I_CLR or I_SKIP;
 
 
    Q_OPC <= X"00000000" when (L_INVALIDATE = '1')
    Q_OPC <= X"00000000" when (L_INVALIDATE = '1')
        else P_OPC       when (I_INTVEC(5) = '0')
        else P_OPC       when (I_INTVEC(5) = '0')

powered by: WebSVN 2.1.0

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