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

Subversion Repositories t6507lp

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /t6507lp/trunk/fv
    from Rev 134 to Rev 135
    Reverse comparison

Rev 134 → Rev 135

/alu_opcodes.e
2,8 → 2,8
<'
type valid_opcodes : [
ADC_IMM = 8'h69, ADC_ZPG = 8'h65, ADC_ZPX = 8'h75, ADC_ABS = 8'h6D, ADC_ABX = 8'h7D, ADC_ABY = 8'h79, ADC_IDX = 8'h61, ADC_IDY = 8'h71,
AND_IMM = 8'h29, AND_ZPG = 8'h25, AND_ZPX = 8'h35, AND_ABS = 8'h2D, AND_ABX = 8'h3D, AND_ABY = 8'h39, AND_IDX = 8'h21, AND_IDY = 8'h31];
// ASL_ACC = 8'h0A, ASL_ZPG = 8'h06, ASL_ZPX = 8'h16, ASL_ABS = 8'h0E, ASL_ABX = 8'h1E, BCC_REL = 8'h90, BCS_REL = 8'hB0, BEQ_REL = 8'hF0,
AND_IMM = 8'h29, AND_ZPG = 8'h25, AND_ZPX = 8'h35, AND_ABS = 8'h2D, AND_ABX = 8'h3D, AND_ABY = 8'h39, AND_IDX = 8'h21, AND_IDY = 8'h31,
ASL_ACC = 8'h0A, ASL_ZPG = 8'h06, ASL_ZPX = 8'h16, ASL_ABS = 8'h0E, ASL_ABX = 8'h1E ]; //, BCC_REL = 8'h90, BCS_REL = 8'hB0, BEQ_REL = 8'hF0,
// BIT_ZPG = 8'h24, BIT_ABS = 8'h2C, BMI_REL = 8'h30, BNE_REL = 8'hD0, BPL_REL = 8'h10, BRK_IMP = 8'h00, BVC_REL = 8'h50, BVS_REL = 8'h70,
// CLC_IMP = 8'h18, CLD_IMP = 8'hD8, CLI_IMP = 8'h58, CLV_IMP = 8'hB8, CMP_IMM = 8'hC9, CMP_ZPG = 8'hC5, CMP_ZPX = 8'hD5, CMP_ABS = 8'hCD,
// CMP_ABX = 8'hDD, CMP_ABY = 8'hD9, CMP_IDX = 8'hC1, CMP_IDY = 8'hD1, CPX_IMM = 8'hE0, CPX_ZPG = 8'hE4, CPX_ABS = 8'hEC, CPY_IMM = 8'hC0,
/alu_chk.e
7,6 → 7,7
reg_x : byte;
reg_y : byte;
reg_status : byte;
reg_result : byte;
 
inst : alu_input_s;
next_inst : alu_input_s;
45,9 → 46,9
reg_y = alu_y;
reg_status = alu_status;
reg_a = 0; // TODO: check this
reg_result = 0;
}
else {
 
out ("CYCLE ", count_cycles, " COMPARE:");
print inst;
 
65,9 → 66,14
};
// here i have already calculated. must compare!
if (reg_a != alu_result) {
print reg_a;
if (reg_result != alu_result) {
print inst;
print me;
print alu_result;
print alu_status;
print alu_x;
print alu_y;
dut_error("WRONG!");
};
 
105,7 → 111,13
AND_IDX: { exec_and(); };
AND_IDY: { exec_and(); };
 
ASL_ACC: { exec_asl_acc(); }; // A,Z,C,N = M*2
 
ASL_ZPG: { exec_asl_mem(); }; // M,Z,C,N = M*2
ASL_ZPX: { exec_asl_mem(); };
ASL_ABS: { exec_asl_mem(); };
ASL_ABX: { exec_asl_mem(); };
 
default: {
//dut_error("unknown opcode");
}
112,10 → 124,26
};
};
 
exec_asl_acc() is {
reg_status[0:0] = reg_a[7:7];
reg_a = reg_a * 2;
update_z(reg_a);
update_n(reg_a);
reg_result = reg_a;
};
 
exec_asl_mem() is {
reg_status[0:0] = inst.alu_a[7:7];
reg_result = inst.alu_a * 2;
update_z(reg_result);
update_n(reg_result);
};
 
exec_and() is {
reg_a = reg_a & inst.alu_a; // TODO: this is probably wrong
update_z(reg_a);
update_n(reg_a);
reg_result = reg_a;
};
 
exec_sum() is {
123,9 → 151,8
reg_a = reg_a + inst.alu_a;
update_z(reg_a);
update_n(reg_a);
 
print me;
 
reg_result = reg_a;
//print me;
//dut_error();
};
 

powered by: WebSVN 2.1.0

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