Enable abusive CPU_TRACING test

This commit is contained in:
Aaron Culliney 2014-11-02 12:09:30 -08:00
parent c7c888d218
commit 9144b48885
3 changed files with 23 additions and 23 deletions

View File

@ -99,12 +99,10 @@ TEST test_boot_disk_bytes() {
PASS(); PASS();
} }
#if 0
#error this is not a stable test ... we don't know exactly where the CPU will be at when we begin
// This test is fairly abusive ... it creates an ~88MB file in $HOME // This test is fairly abusive ... it creates an ~88MB file in $HOME
// ... but if it's correct, you're fairly assured the cpu/vm is working =) // ... but if it's correct, you're fairly assured the cpu/vm is working =)
#define EXPECTED_CPU_TRACE_FILE_SIZE 87611579 #define EXPECTED_CPU_TRACE_FILE_SIZE 86057107
#define EXPECTED_CPU_TRACE_SHA "8DE74ED640E0CE4AB1AAC40E95BE9B8507A37434" #define EXPECTED_CPU_TRACE_SHA "525098EDD23E4602791D0167DAE0FB65ACE33ABD"
TEST test_boot_disk_cputrace() { TEST test_boot_disk_cputrace() {
char *homedir = getenv("HOME"); char *homedir = getenv("HOME");
char *output = NULL; char *output = NULL;
@ -141,7 +139,6 @@ TEST test_boot_disk_cputrace() {
PASS(); PASS();
} }
#endif
TEST test_boot_disk() { TEST test_boot_disk() {
BOOT_TO_DOS(); BOOT_TO_DOS();
@ -3352,9 +3349,7 @@ GREATEST_SUITE(test_suite_vm) {
// TESTS -------------------------- // TESTS --------------------------
RUN_TESTp(test_boot_disk_bytes); RUN_TESTp(test_boot_disk_bytes);
RUN_TESTp(test_boot_disk_cputrace);
//RUN_TESTp(test_boot_disk_cputrace);
RUN_TESTp(test_boot_disk); RUN_TESTp(test_boot_disk);
RUN_TESTp(test_inithello_dsk); RUN_TESTp(test_inithello_dsk);

View File

@ -24,6 +24,18 @@
#define DebugCurrOpcode SN(cpu65_opcode) #define DebugCurrOpcode SN(cpu65_opcode)
#define DebugCycleCount SN(cpu65_opcycles) #define DebugCycleCount SN(cpu65_opcycles)
#define CommonSaveCPUState() \
movw EffectiveAddr, DebugCurrEA; \
movb A_Reg, SN(cpu65_a); \
xorw %ax, %ax; \
movb F_Reg, %al; \
SNX_PROLOGUE(cpu65_flags_encode); \
movb SNX(cpu65_flags_encode,_XAX,1), %al; \
movb %al, SN(cpu65_f); \
movb X_Reg, SN(cpu65_x); \
movb Y_Reg, SN(cpu65_y); \
movb SP_Reg_L, SN(cpu65_sp)
#if CPU_TRACING #if CPU_TRACING
# define TRACE_PROLOGUE \ # define TRACE_PROLOGUE \
movw PC_Reg, SN(cpu65_pc); \ movw PC_Reg, SN(cpu65_pc); \
@ -35,7 +47,9 @@
# define TRACE_ARG2 \ # define TRACE_ARG2 \
callLQ CALL(cpu65_trace_arg2); callLQ CALL(cpu65_trace_arg2);
# define TRACE_EPILOGUE \ # define TRACE_EPILOGUE \
movw EffectiveAddr, DebugCurrEA; \ pushLQ _XAX; \
CommonSaveCPUState(); \
popLQ _XAX; \
callLQ CALL(cpu65_trace_epilogue); callLQ CALL(cpu65_trace_epilogue);
#else #else
# define TRACE_PROLOGUE # define TRACE_PROLOGUE
@ -2238,17 +2252,8 @@ E(cpu65_run)
exit_cpu65_run: exit_cpu65_run:
// Save CPU state when returning from being called from C // Save CPU state when returning from being called from C
movw EffectiveAddr, DebugCurrEA
movw PC_Reg, SN(cpu65_pc) movw PC_Reg, SN(cpu65_pc)
movb A_Reg, SN(cpu65_a) CommonSaveCPUState()
xorw %ax, %ax
movb F_Reg, %al
SNX_PROLOGUE(cpu65_flags_encode)
movb SNX(cpu65_flags_encode,_XAX,1), %al
movb %al, SN(cpu65_f)
movb X_Reg, SN(cpu65_x)
movb Y_Reg, SN(cpu65_y)
movb SP_Reg_L, SN(cpu65_sp)
jmp exit_frame jmp exit_frame
emul_reinit: movb $0, SN(cpu65__signal) emul_reinit: movb $0, SN(cpu65__signal)