mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-15 14:27:29 +00:00
Permit instructions that end in an address error to differ in transactions.
This commit is contained in:
@@ -258,6 +258,8 @@ template <typename M68000> struct Tester {
|
|||||||
srand(68000);
|
srand(68000);
|
||||||
|
|
||||||
for(int c = 0; c < 65536; c++) {
|
for(int c = 0; c < 65536; c++) {
|
||||||
|
printf("%04x\n", c);
|
||||||
|
|
||||||
// Test only defined opcodes.
|
// Test only defined opcodes.
|
||||||
const auto instruction = decoder.decode(uint16_t(c));
|
const auto instruction = decoder.decode(uint16_t(c));
|
||||||
if(instruction.operation == InstructionSet::M68k::Operation::Undefined) {
|
if(instruction.operation == InstructionSet::M68k::Operation::Undefined) {
|
||||||
@@ -295,7 +297,17 @@ template <typename M68000> struct Tester {
|
|||||||
newTester->run_instructions(1);
|
newTester->run_instructions(1);
|
||||||
oldTester->run_instructions(1);
|
oldTester->run_instructions(1);
|
||||||
|
|
||||||
// Compare bus activity.
|
// Grab final states.
|
||||||
|
oldState = oldTester->processor.get_state();
|
||||||
|
newState = newTester->processor.get_state();
|
||||||
|
|
||||||
|
// Compare bus activity only if it doesn't look like an address
|
||||||
|
// error occurred. Don't check those as I don't have good information
|
||||||
|
// on the proper stack write order, so transactions are permitted to differ.
|
||||||
|
//
|
||||||
|
// Net effect will be 50% fewer transaction comparisons for instructions that
|
||||||
|
// can trigger an address error.
|
||||||
|
if(oldState.program_counter != 0x1404 || newState.registers.program_counter != 0x1404) {
|
||||||
const auto &oldTransactions = oldTester->bus_handler.transactions;
|
const auto &oldTransactions = oldTester->bus_handler.transactions;
|
||||||
const auto &newTransactions = newTester->bus_handler.transactions;
|
const auto &newTransactions = newTester->bus_handler.transactions;
|
||||||
|
|
||||||
@@ -321,11 +333,9 @@ template <typename M68000> struct Tester {
|
|||||||
++newIt;
|
++newIt;
|
||||||
++oldIt;
|
++oldIt;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Compare registers.
|
// Compare registers.
|
||||||
oldState = oldTester->processor.get_state();
|
|
||||||
newState = newTester->processor.get_state();
|
|
||||||
|
|
||||||
bool mismatch = false;
|
bool mismatch = false;
|
||||||
for(int c = 0; c < 8; c++) {
|
for(int c = 0; c < 8; c++) {
|
||||||
mismatch |= oldState.data[c] != newState.registers.data[c];
|
mismatch |= oldState.data[c] != newState.registers.data[c];
|
||||||
|
Reference in New Issue
Block a user