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

Subversion Repositories cpu_lecture

[/] [cpu_lecture/] [trunk/] [src/] [io.vhd] - Diff between revs 22 and 23

Show entire file | Details | Blame | View Log

Rev 22 Rev 23
Line 165... Line 165...
    begin
    begin
        if (rising_edge(I_CLK)) then
        if (rising_edge(I_CLK)) then
            if (I_CLR = '1') then
            if (I_CLR = '1') then
                L_INTVEC <= "000000";
                L_INTVEC <= "000000";
            else
            else
 
                case L_INTVEC is
 
                    when "101011" => -- vector 11 interrupt pending.
 
                        if (L_RX_INT_ENABLED and U_RX_READY) = '0' then
 
                            L_INTVEC <= "000000";
 
                        end if;
 
 
 
                    when "101100" => -- vector 12 interrupt pending.
 
                        if (L_TX_INT_ENABLED and not U_TX_BUSY) = '0' then
 
                            L_INTVEC <= "000000";
 
                        end if;
 
 
 
                    when others   =>
 
                        -- no interrupt is pending.
 
                        -- We accept a new interrupt.
 
                        --
                if (L_RX_INT_ENABLED and U_RX_READY) = '1' then
                if (L_RX_INT_ENABLED and U_RX_READY) = '1' then
                    if (L_INTVEC(5) = '0') then     -- no interrupt pending
 
                        L_INTVEC <= "101011";       -- _VECTOR(11)
                        L_INTVEC <= "101011";       -- _VECTOR(11)
                    end if;
 
                elsif (L_TX_INT_ENABLED and not U_TX_BUSY) = '1' then
                elsif (L_TX_INT_ENABLED and not U_TX_BUSY) = '1' then
                    if (L_INTVEC(5) = '0') then     -- no interrupt pending
 
                        L_INTVEC <= "101100";       -- _VECTOR(12)
                        L_INTVEC <= "101100";       -- _VECTOR(12)
 
                        else
 
                            L_INTVEC <= "000000";            -- no interrupt
                    end if;
                    end if;
                else                                -- no interrupt
                end case;
                    L_INTVEC <= "000000";
 
                end if;
 
            end if;
            end if;
        end if;
        end if;
    end process;
    end process;
 
 
    L_WE_UART <= I_WE_IO when (I_ADR_IO = X"2C") else '0'; -- write UART UDR
    L_WE_UART <= I_WE_IO when (I_ADR_IO = X"2C") else '0'; -- write UART UDR

powered by: WebSVN 2.1.0

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