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

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [byte_irq.v] - Diff between revs 5 and 10

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

Rev 5 Rev 10
Line 1... Line 1...
// IRQ processing states
// ============================================================================
 
//        __
 
//   \\__/ o\    (C) 2013  Robert Finch, Stratford
 
//    \  __ /    All rights reserved.
 
//     \/_//     robfinch<remove>@opencores.org
 
//       ||
 
//
 
// This source file is free software: you can redistribute it and/or modify 
 
// it under the terms of the GNU Lesser General Public License as published 
 
// by the Free Software Foundation, either version 3 of the License, or     
 
// (at your option) any later version.                                      
 
//                                                                          
 
// This source file is distributed in the hope that it will be useful,      
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
 
// GNU General Public License for more details.                             
 
//                                                                          
 
// You should have received a copy of the GNU General Public License        
 
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
 
//                                                                          
 
// ============================================================================
 
//
 
// IRQ processing states for 65C02 emulation mode
// The high order PC[31:16] is set to zero, forcing the IRQ routine to be in bank zero.
// The high order PC[31:16] is set to zero, forcing the IRQ routine to be in bank zero.
//
//
BYTE_IRQ1:
BYTE_IRQ1:
        if (ack_i) begin
        if (ack_i) begin
 
                state <= BYTE_IRQ2;
 
                retstate <= BYTE_IRQ2;
                cyc_o <= 1'b0;
                cyc_o <= 1'b0;
                stb_o <= 1'b0;
                stb_o <= 1'b0;
                we_o <= 1'b0;
                we_o <= 1'b0;
                sel_o <= 4'h0;
                sel_o <= 4'h0;
                sp <= sp_dec;
                sp <= sp_dec;
                if (dhit) begin
                if (dhit) begin
                        wrsel <= sel_o;
                        wrsel <= sel_o;
                        wr <= 1'b1;
                        wr <= 1'b1;
                end
                end
                state <= BYTE_IRQ2;
                else if (write_allocate) begin
 
                        state <= WAIT_DHIT;
 
                        dmiss <= `TRUE;
 
                end
        end
        end
BYTE_IRQ2:
BYTE_IRQ2:
        begin
        begin
                radr <= {24'h1,sp[7:2]};
                radr <= {24'h1,sp[7:2]};
                radr2LSB <= sp[1:0];
                radr2LSB <= sp[1:0];
Line 34... Line 61...
                dat_o <= {4{pc[23:16]}};
                dat_o <= {4{pc[23:16]}};
                state <= BYTE_IRQ3;
                state <= BYTE_IRQ3;
        end
        end
BYTE_IRQ3:
BYTE_IRQ3:
        if (ack_i) begin
        if (ack_i) begin
 
                state <= BYTE_IRQ4;
 
                retstate <= BYTE_IRQ4;
                cyc_o <= 1'b0;
                cyc_o <= 1'b0;
                stb_o <= 1'b0;
                stb_o <= 1'b0;
                we_o <= 1'b0;
                we_o <= 1'b0;
                sel_o <= 4'h0;
                sel_o <= 4'h0;
                sp <= sp_dec;
                sp <= sp_dec;
                if (dhit) begin
                if (dhit) begin
                        wrsel <= sel_o;
                        wrsel <= sel_o;
                        wr <= 1'b1;
                        wr <= 1'b1;
                end
                end
                state <= BYTE_IRQ4;
                else if (write_allocate) begin
 
                        state <= WAIT_DHIT;
 
                        dmiss <= `TRUE;
 
                end
        end
        end
BYTE_IRQ4:
BYTE_IRQ4:
        begin
        begin
                radr <= {24'h1,sp[7:2]};
                radr <= {24'h1,sp[7:2]};
                radr2LSB <= sp[1:0];
                radr2LSB <= sp[1:0];
Line 67... Line 99...
                dat_o <= {4{pc[15:8]}};
                dat_o <= {4{pc[15:8]}};
                state <= BYTE_IRQ5;
                state <= BYTE_IRQ5;
        end
        end
BYTE_IRQ5:
BYTE_IRQ5:
        if (ack_i) begin
        if (ack_i) begin
 
                state <= BYTE_IRQ6;
 
                retstate <= BYTE_IRQ6;
                cyc_o <= 1'b0;
                cyc_o <= 1'b0;
                stb_o <= 1'b0;
                stb_o <= 1'b0;
                we_o <= 1'b0;
                we_o <= 1'b0;
                sel_o <= 4'h0;
                sel_o <= 4'h0;
                sp <= sp_dec;
                sp <= sp_dec;
                if (dhit) begin
                if (dhit) begin
                        wrsel <= sel_o;
                        wrsel <= sel_o;
                        wr <= 1'b1;
                        wr <= 1'b1;
                end
                end
                state <= BYTE_IRQ6;
                else if (write_allocate) begin
 
                        state <= WAIT_DHIT;
 
                        dmiss <= `TRUE;
 
                end
        end
        end
BYTE_IRQ6:
BYTE_IRQ6:
        begin
        begin
                radr <= {24'h1,sp[7:2]};
                radr <= {24'h1,sp[7:2]};
                radr2LSB <= sp[1:0];
                radr2LSB <= sp[1:0];
Line 100... Line 137...
                dat_o <= {4{pc[7:0]}};
                dat_o <= {4{pc[7:0]}};
                state <= BYTE_IRQ7;
                state <= BYTE_IRQ7;
        end
        end
BYTE_IRQ7:
BYTE_IRQ7:
        if (ack_i) begin
        if (ack_i) begin
 
                state <= BYTE_IRQ8;
 
                retstate <= BYTE_IRQ8;
                cyc_o <= 1'b0;
                cyc_o <= 1'b0;
                stb_o <= 1'b0;
                stb_o <= 1'b0;
                we_o <= 1'b0;
                we_o <= 1'b0;
                sel_o <= 4'h0;
                sel_o <= 4'h0;
                sp <= sp_dec;
                sp <= sp_dec;
                if (dhit) begin
                if (dhit) begin
                        wrsel <= sel_o;
                        wrsel <= sel_o;
                        wr <= 1'b1;
                        wr <= 1'b1;
                end
                end
                state <= BYTE_IRQ8;
                else if (write_allocate) begin
 
                        state <= WAIT_DHIT;
 
                        dmiss <= `TRUE;
 
                end
        end
        end
BYTE_IRQ8:
BYTE_IRQ8:
        begin
        begin
                radr <= {24'h1,sp[7:2]};
                radr <= {24'h1,sp[7:2]};
                radr2LSB <= sp[1:0];
                radr2LSB <= sp[1:0];
Line 133... Line 175...
                dat_o <= {4{sr8[7:0]}};
                dat_o <= {4{sr8[7:0]}};
                state <= BYTE_IRQ9;
                state <= BYTE_IRQ9;
        end
        end
BYTE_IRQ9:
BYTE_IRQ9:
        if (ack_i) begin
        if (ack_i) begin
 
                state <= BYTE_JMP_IND1;
 
                retstate <= BYTE_JMP_IND1;
                cyc_o <= 1'b0;
                cyc_o <= 1'b0;
                stb_o <= 1'b0;
                stb_o <= 1'b0;
                we_o <= 1'b0;
                we_o <= 1'b0;
                sel_o <= 4'h0;
                sel_o <= 4'h0;
                sp <= sp_dec;
                sp <= sp_dec;
                if (dhit) begin
                if (dhit) begin
                        wrsel <= sel_o;
                        wrsel <= sel_o;
                        wr <= 1'b1;
                        wr <= 1'b1;
                end
                end
 
                else if (write_allocate) begin
 
                        state <= WAIT_DHIT;
 
                        dmiss <= `TRUE;
 
                end
                pc[31:16] <= 16'h0000;
                pc[31:16] <= 16'h0000;
                radr <= vect[31:2];
                radr <= vect[31:2];
                radr2LSB <= vect[1:0];
                radr2LSB <= vect[1:0];
                state <= BYTE_JMP_IND1;
 
        end
        end
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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