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

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [ifetch.v] - Diff between revs 23 and 25

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

Rev 23 Rev 25
Line 20... Line 20...
//                                                                          
//                                                                          
// ============================================================================
// ============================================================================
//
//
IFETCH:
IFETCH:
        begin
        begin
 
                suppress_pcinc <= 4'hF;                         // default: no suppression of increment
                opc <= pc;
                opc <= pc;
                if (nmi_edge & !imiss & gie) begin      // imiss indicates cache controller is active and this state is in a waiting loop
                hwi <= `FALSE;
 
                if (nmi_edge & !imiss & gie & !isExec & !isAtni) begin  // imiss indicates cache controller is active and this state is in a waiting loop
                        nmi_edge <= 1'b0;
                        nmi_edge <= 1'b0;
                        wai <= 1'b0;
                        wai <= 1'b0;
                        bf <= 1'b0;
                        bf <= 1'b0;
 
                        hwi <= `TRUE;
                        if (em & !nmoi) begin
                        if (em & !nmoi) begin
                                radr <= {spage[31:8],sp[7:2]};
                                radr <= {spage[31:8],sp[7:2]};
                                radr2LSB <= sp[1:0];
                                radr2LSB <= sp[1:0];
                                wadr <= {spage[31:8],sp[7:2]};
                                wadr <= {spage[31:8],sp[7:2]};
                                wadr2LSB <= sp[1:0];
                                wadr2LSB <= sp[1:0];
Line 60... Line 63...
                                dat_o <= pc;
                                dat_o <= pc;
                                vect <= `NMI_VECT;
                                vect <= `NMI_VECT;
                                state <= IRQ1;
                                state <= IRQ1;
                        end
                        end
                end
                end
                else if (irq_i && !imiss & gie) begin
                else if (irq_i && !imiss & gie & !isExec & !isAtni) begin
                        if (im) begin
                        if (im) begin
                                wai <= 1'b0;
                                wai <= 1'b0;
                                if (unCachedInsn) begin
                                if (isExec) begin
 
                                        ir <= exbuf;
 
                                        exbuf <= 64'd0;
 
                                        suppress_pcinc <= 4'h0;
 
                                        state <= em ? BYTE_DECODE : DECODE;
 
                                end
 
                                else if (unCachedInsn) begin
                                        if (bhit) begin
                                        if (bhit) begin
                                                ir <= ibuf;
                                                ir <= ibuf + exbuf;
 
                                                exbuf <= 64'd0;
                                                state <= em ? BYTE_DECODE : DECODE;
                                                state <= em ? BYTE_DECODE : DECODE;
                                        end
                                        end
                                        else
                                        else
                                                imiss <= `TRUE;
                                                imiss <= `TRUE;
                                end
                                end
                                else begin
                                else begin
                                        if (ihit) begin
                                        if (ihit) begin
                                                ir <= insn;
                                                ir <= insn + exbuf;
 
                                                exbuf <= 64'd0;
                                                state <= em ? BYTE_DECODE : DECODE;
                                                state <= em ? BYTE_DECODE : DECODE;
                                        end
                                        end
                                        else
                                        else
                                                imiss <= `TRUE;
                                                imiss <= `TRUE;
                                end
                                end
                        end
                        end
                        else begin
                        else begin
                                bf <= 1'b0;
                                bf <= 1'b0;
                                wai <= 1'b0;
                                wai <= 1'b0;
 
                                hwi <= `TRUE;
                                if (em & !nmoi) begin
                                if (em & !nmoi) begin
                                        radr <= {spage[31:8],sp[7:2]};
                                        radr <= {spage[31:8],sp[7:2]};
                                        radr2LSB <= sp[1:0];
                                        radr2LSB <= sp[1:0];
                                        wadr <= {spage[31:8],sp[7:2]};
                                        wadr <= {spage[31:8],sp[7:2]};
                                        wadr2LSB <= sp[1:0];
                                        wadr2LSB <= sp[1:0];
Line 120... Line 132...
                                        state <= IRQ1;
                                        state <= IRQ1;
                                end
                                end
                        end
                        end
                end
                end
                else if (!wai) begin
                else if (!wai) begin
                        if (unCachedInsn) begin
                        if (isExec) begin
 
                                ir <= exbuf;
 
                                exbuf <= 64'd0;
 
                                suppress_pcinc <= 4'h0;
 
                                state <= em ? BYTE_DECODE : DECODE;
 
                        end
 
                        else if (unCachedInsn) begin
                                if (bhit) begin
                                if (bhit) begin
                                        ir <= ibuf;
                                        ir <= ibuf + exbuf;
 
                                        exbuf <= 64'd0;
                                        state <= em ? BYTE_DECODE : DECODE;
                                        state <= em ? BYTE_DECODE : DECODE;
                                end
                                end
                                else
                                else
                                        imiss <= `TRUE;
                                        imiss <= `TRUE;
                        end
                        end
                        else begin
                        else begin
                                if (ihit) begin
                                if (ihit) begin
                                        ir <= insn;
                                        ir <= insn + exbuf;
 
                                        exbuf <= 64'd0;
                                        state <= em ? BYTE_DECODE : DECODE;
                                        state <= em ? BYTE_DECODE : DECODE;
                                end
                                end
                                else
                                else
                                        imiss <= `TRUE;
                                        imiss <= `TRUE;
                        end
                        end
Line 219... Line 239...
                                default:        ;
                                default:        ;
                                endcase
                                endcase
                                case(ir[7:0])
                                case(ir[7:0])
                                `TAY,`TXY,`DEY,`INY:    begin y <= res; nf <= resn32; zf <= resz32; end
                                `TAY,`TXY,`DEY,`INY:    begin y <= res; nf <= resn32; zf <= resz32; end
                                `TAX,`TYX,`TSX,`DEX,`INX:       begin x <= res; nf <= resn32; zf <= resz32; end
                                `TAX,`TYX,`TSX,`DEX,`INX:       begin x <= res; nf <= resn32; zf <= resz32; end
                                `TAS,`TXS,`SUB_SP:      begin isp <= res; gie <= 1'b1; end
                                `TAS,`TXS:      begin isp <= res; gie <= 1'b1; end
 
                                `SUB_SP8,`SUB_SP16,`SUB_SP32:   isp <= res;
                                `TSA,`TYA,`TXA,`INA,`DEA:       begin acc <= res; nf <= resn32; zf <= resz32; end
                                `TSA,`TYA,`TXA,`INA,`DEA:       begin acc <= res; nf <= resn32; zf <= resz32; end
                                `TRS:
                                `TRS:
                                        begin
                                        begin
                                                case(ir[15:12])
                                                case(ir[15:12])
                                                4'h0:   begin
                                                4'h0:   begin

powered by: WebSVN 2.1.0

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