⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 it51_glue.vhd

📁 這是最新版本修正過後的8051,經過debug並有實現在某家公司的silicon上ㄛ
💻 VHD
📖 第 1 页 / 共 2 页
字号:
            Int2_r <= Int2_r(0) & INT2;            Int3_r <= Int3_r(0) & INT3;            Int4_r <= Int4_r(0) & INT4;            Int5_r <= Int5_r(0) & INT5;            if IO_Wr = '1' and IO_Addr_r = "1101000" then                EIE <= IO_WData;            end if;            if IO_Wr = '1' and IO_Addr_r = "0010001" then                EXIF <= IO_WData;            else                if Int_Acc(10)='1' then                    EXIF(7) <= '0';                elsif Int5_r = "10" then                    EXIF(7) <= '1';                end if;                if Int_Acc(9)='1' then                    EXIF(6) <= '0';                elsif Int4_r = "01" then                    EXIF(6) <= '1';                end if;                if Int_Acc(8)='1' then                    EXIF(5) <= '0';                elsif Int3_r = "10" then                    EXIF(5) <= '1';                end if;                if Int_Acc(7)='1' then                    EXIF(4) <= '0';                elsif Int2_r = "01" then                    EXIF(4) <= '1';                end if;            end if;            if IO_Wr = '1' and IO_Addr_r = "0101000" then                IE <= IO_WData;            end if;            if IO_Wr = '1' and IO_Addr_r = "0001000" then                TCON <= IO_WData;            end if;            if OF0 = '1' then                TCON(5) <= '1';            end if;            if Int_Acc(1) = '1' then                TCON(5) <= '0';            end if;            if OF1 = '1' then                TCON(7) <= '1';            end if;            if Int_Acc(3) = '1' then                TCON(7) <= '0';            end if;            -- External interrupts            if TCON(0) = '1' then                if Int_Acc(0) = '1' then                    TCON(1) <= '0';                end if;                if Int0_r = "10" then                    TCON(1) <= '1';                end if;            else                TCON(1) <= not Int0_r(0);            end if;            if TCON(2) = '1' then                if Int_Acc(2) = '1' then                    TCON(3) <= '0';                end if;                if Int1_r = "10" then                    TCON(3) <= '1';                end if;            else                TCON(3) <= not Int1_r(0);            end if;        end if;    end process;    Int_Trig_i(0)  <= '0' when IE(7) = '0' or IE(0) = '0' else not Int0_r(1) when TCON(0) = '0' else TCON(1);    Int_Trig_i(1)  <= '1' when IE(7) = '1' and IE(1) = '1' and TCON(5) = '1' else '0';    Int_Trig_i(2)  <= '0' when IE(7) = '0' or IE(2) = '0' else not Int1_r(1) when TCON(2) = '0' else TCON(3);    Int_Trig_i(3)  <= '1' when IE(7) = '1' and IE(3) = '1' and TCON(7) = '1' else '0';    Int_Trig_i(4)  <= '1' when IE(7) = '1' and IE(4) = '1' and (RI = '1' or TI = '1') else '0';    Int_Trig_i(5)  <= '1' when IE(7) = '1' and IE(5) = '1' and OF2 = '1' else '0';    Int_Trig_i(6)  <= '0';    Int_Trig_i(7)  <= '1' when EIE(0) = '1' and EXIF(4) = '1' else '0'; -- INT2    Int_Trig_i(8)  <= '1' when EIE(1) = '1' and EXIF(5) = '1' else '0'; -- INT3    Int_Trig_i(9)  <= '1' when EIE(2) = '1' and EXIF(6) = '1' else '0'; -- INT4    Int_Trig_i(10) <= '1' when EIE(3) = '1' and EXIF(7) = '1' else '0'; -- INT5    -------------------------    -- TMOD    TMOD_Sel   <= TMOD_Sel_i;    TMOD_Sel_i <= '1' when IO_Addr = "0001001" else '0';    TMOD_Wr    <= '1' when TMOD_Sel_r = '1'  and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            TMOD_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            TMOD_Sel_r <= TMOD_Sel_i;        end if;    end process;    -------------------------    -- TL0    TL0_Sel   <= TL0_Sel_i;    TL0_Sel_i <= '1' when IO_Addr = "0001010" else '0';    TL0_Wr    <= '1' when TL0_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            TL0_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            TL0_Sel_r <= TL0_Sel_i;        end if;    end process;    -------------------------    -- TL1    TL1_Sel   <= TL0_Sel_i;    TL1_Sel_i <= '1' when IO_Addr = "0001011" else '0';    TL1_Wr    <= '1' when TL1_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            TL1_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            TL1_Sel_r <= TL1_Sel_i;        end if;    end process;    -------------------------    -- TH0    TH0_Sel   <= TH0_Sel_i;    TH0_Sel_i <= '1' when IO_Addr = "0001100" else '0';    TH0_Wr    <= '1' when TH0_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            TH0_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            TH0_Sel_r <= TH0_Sel_i;        end if;    end process;    -------------------------    -- TH1    TH1_Sel   <= TH1_Sel_i;    TH1_Sel_i <= '1' when IO_Addr = "0001101" else '0';    TH1_Wr    <= '1' when TH1_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            TH1_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            TH1_Sel_r <= TH1_Sel_i;        end if;    end process;    -------------------------    -- T2CON    T2CON_Sel   <= T2CON_Sel_i;    T2CON_Sel_i <= '1' when IO_Addr = "1001000" else '0';    T2CON_Wr    <= '1' when T2CON_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            T2CON_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            T2CON_Sel_r <= T2CON_Sel_i;        end if;    end process;    -------------------------    -- RCAP2L    RCAP2L_Sel   <= RCAP2L_Sel_i;    RCAP2L_Sel_i <= '1' when IO_Addr = "1001010" else '0';    RCAP2L_Wr    <= '1' when RCAP2L_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            RCAP2L_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            RCAP2L_Sel_r <= RCAP2L_Sel_i;        end if;    end process;    -------------------------    -- RCAP2H    RCAP2H_Sel   <= RCAP2H_Sel_i;    RCAP2H_Sel_i <= '1' when IO_Addr = "1001011" else '0';    RCAP2H_Wr    <= '1' when RCAP2H_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            RCAP2H_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            RCAP2H_Sel_r <= RCAP2H_Sel_i;        end if;    end process;    -------------------------    -- TL2    TL2_Sel   <= TL2_Sel_i;    TL2_Sel_i <= '1' when IO_Addr = "1001100" else '0';    TL2_Wr    <= '1' when TL2_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            TL2_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            TL2_Sel_r <= TL2_Sel_i;        end if;    end process;    -------------------------    -- TH2    TH2_Sel   <= TH2_Sel_i;    TH2_Sel_i <= '1' when IO_Addr = "1001101" else '0';    TH2_Wr    <= '1' when TH2_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            TH2_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            TH2_Sel_r <= TH2_Sel_i;        end if;    end process;    -------------------------    -- SCON    SCON_Sel   <= SCON_Sel_i;    SCON_Sel_i <= '1' when IO_Addr = "0011000" else '0';    SCON_Wr    <= '1' when SCON_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            SCON_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            SCON_Sel_r <= SCON_Sel_i;        end if;    end process;    -------------------------    -- SBUF    SBUF_Sel   <= SBUF_Sel_i;    SBUF_Sel_i <= '1' when IO_Addr = "0011001" else '0';    SBUF_Wr    <= '1' when SBUF_Sel_r = '1' and IO_Wr = '1' else '0';    process (Clk, Rst_n)    begin        if Rst_n = '0' then            SBUF_Sel_r <= '0';        elsif Clk'event and Clk = '1' then            SBUF_Sel_r <= SBUF_Sel_i;        end if;    end process;end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -