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

Subversion Repositories klc32

[/] [klc32/] [trunk/] [rtl/] [verilog/] [REGFETCHA.v] - Diff between revs 2 and 7

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

Rev 2 Rev 7
Line 24... Line 24...
REGFETCHA:
REGFETCHA:
        begin
        begin
                a <= rfo;
                a <= rfo;
                b <= 32'd0;
                b <= 32'd0;
                Rn <= ir[20:16];
                Rn <= ir[20:16];
                if (opcode==`RR || opcode==`RRR) begin
                if (opcode==`RR || opcode==`RRR || opcode==`SW || opcode==`SH || opcode==`SB) begin
                        state <= REGFETCHB;
                        state <= REGFETCHB;
                end
                end
                else begin
                else begin
 
                        // RIX format ?
                        if ((hasConst16 && ir[15:0]==16'h8000) || (isStop))
                        if ((hasConst16 && ir[15:0]==16'h8000) || (isStop))
                                state <= FETCH_IMM32;
                                state <= FETCH_IMM32;
                        else begin
                        else begin
                                imm <= {{16{ir[15]}},ir[15:0]};
                                imm <= {{16{ir[15]}},ir[15:0]};
                                state <= EXECUTE;
                                state <= EXECUTE;
Line 86... Line 87...
                                else begin
                                else begin
                                        rst_o <= 1'b1;
                                        rst_o <= 1'b1;
                                        state <= IFETCH;
                                        state <= IFETCH;
                                end
                                end
                        endcase
                        endcase
 
                `R:
 
                        case(func)
 
                        `UNLK:  state <= UNLK;
 
                        endcase
                `NOP: state <= IFETCH;
                `NOP: state <= IFETCH;
                `JSR: begin tgt <= {pc[31:26],ir[25:2],2'b00}; state <= JSR1; end
                `JSR: begin tgt <= {pc[31:26],ir[25:2],2'b00}; state <= JSR1; end
                `JMP: begin pc[25:2] <= ir[25:2]; state <= IFETCH; end
                `JMP: begin pc[25:2] <= ir[25:2]; state <= IFETCH; end
                `Bcc:
                `Bcc:
                        case(cond)
                        case(cond)
Line 128... Line 133...
                        `TVC:   begin if (!cr_vf) begin vector <= `TRAPV_VECTOR; state <= TRAP; end else state <= IFETCH; end
                        `TVC:   begin if (!cr_vf) begin vector <= `TRAPV_VECTOR; state <= TRAP; end else state <= IFETCH; end
                        endcase
                        endcase
                `SETcc: Rn <= ir[15:11];
                `SETcc: Rn <= ir[15:11];
                `PUSH:  state <= PUSH1;
                `PUSH:  state <= PUSH1;
                `POP:   state <= POP1;
                `POP:   state <= POP1;
                `UNLK:  state <= UNLK;
 
                endcase
                endcase
                if (isIllegalOpcode) begin
                if (isIllegalOpcode) begin
                        vector <= `ILLEGAL_INSN;
                        vector <= `ILLEGAL_INSN;
                        state <= TRAP;
                        state <= TRAP;
                end
                end

powered by: WebSVN 2.1.0

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