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

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [fv/] [alu_chk.e] - Diff between revs 132 and 133

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

Rev 132 Rev 133
Line 57... Line 57...
                                default: {
                                default: {
                                        dut_error("error at e code");
                                        dut_error("error at e code");
                                };
                                };
                        };
                        };
 
 
                        // here comes the compare!
                        // here i have already calculated. must compare!
 
                        if (reg_a != alu_result) {
 
                                dut_error("WRONG!");
 
                        };
 
 
 
                        if (reg_x != alu_x) {
 
                                dut_error("WRONG!");
 
                        };
 
 
 
                        if (reg_y != alu_y) {
 
                                dut_error("WRONG!");
 
                        };
 
 
 
                        if (reg_status != alu_status) {
 
                                dut_error("WRONG!");
 
                        };
                }
                }
        };
        };
 
 
        execute() is {
        execute() is {
                case inst.alu_opcode {
                case inst.alu_opcode {
Line 72... Line 87...
                        ADC_ABX: { exec_sum(); };
                        ADC_ABX: { exec_sum(); };
                        ADC_ABY: { exec_sum(); };
                        ADC_ABY: { exec_sum(); };
                        ADC_IDX: { exec_sum(); };
                        ADC_IDX: { exec_sum(); };
                        ADC_IDY: { exec_sum(); };
                        ADC_IDY: { exec_sum(); };
 
 
                        AND_IMM: { exec_and(); };
                        AND_IMM: { exec_and(); }; // A,Z,N = A&M
                        AND_ZPG: { exec_and(); };
                        AND_ZPG: { exec_and(); };
                        AND_ZPX: { exec_and(); };
                        AND_ZPX: { exec_and(); };
                        AND_ABS: { exec_and(); };
                        AND_ABS: { exec_and(); };
                        AND_ABX: { exec_and(); };
                        AND_ABX: { exec_and(); };
                        AND_ABY: { exec_and(); };
                        AND_ABY: { exec_and(); };
Line 89... Line 104...
                        }
                        }
                };
                };
        };
        };
 
 
        exec_and() is {
        exec_and() is {
 
                reg_a = reg_a & inst.alu_a; // TODO: this is probably wrong
 
                update_z(reg_a);
 
                update_n(reg_a);
        };
        };
 
 
        exec_sum() is {
        exec_sum() is {
                update_c(reg_a, inst.alu_a);
                update_c(reg_a, inst.alu_a);
                reg_a = reg_a + inst.alu_a;
                reg_a = reg_a + inst.alu_a;

powered by: WebSVN 2.1.0

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