From bb339d619f10a00eebaadbbb3f3d61e9d0f27fa0 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 28 Mar 2024 14:23:00 -0400 Subject: [PATCH] Eliminate trace test; I don't think I'm going to work it through. --- .../Mac/Clock SignalTests/ARMDecoderTests.mm | 74 ------------------- 1 file changed, 74 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/ARMDecoderTests.mm b/OSBindings/Mac/Clock SignalTests/ARMDecoderTests.mm index f80e44611..94d9e25d9 100644 --- a/OSBindings/Mac/Clock SignalTests/ARMDecoderTests.mm +++ b/OSBindings/Mac/Clock SignalTests/ARMDecoderTests.mm @@ -11,7 +11,6 @@ #include "../../../InstructionSets/ARM/Disassembler.hpp" #include "../../../InstructionSets/ARM/Executor.hpp" -#include "CSROMFetcher.hpp" #include "NSData+dataWithContentsOfGZippedFile.h" #include @@ -21,49 +20,6 @@ using namespace InstructionSet::ARM; namespace { -struct Memory { - std::vector rom; - - template - bool write(uint32_t address, IntT source, Mode mode, bool trans) { - (void)mode; - (void)trans; - - printf("W of %08x to %08x [%lu]\n", source, address, sizeof(IntT)); - - if(has_moved_rom_ && address < ram_.size()) { - *reinterpret_cast(&ram_[address]) = source; - } - - return true; - } - - template - bool read(uint32_t address, IntT &source, Mode mode, bool trans) { - (void)mode; - (void)trans; - - if(address >= 0x3800000) { - has_moved_rom_ = true; - source = *reinterpret_cast(&rom[address - 0x3800000]); - } else if(!has_moved_rom_) { - // TODO: this is true only very transiently. - source = *reinterpret_cast(&rom[address]); - } else if(address < ram_.size()) { - source = *reinterpret_cast(&ram_[address]); - } else { - source = 0; - printf("Unknown read from %08x [%lu]\n", address, sizeof(IntT)); - } - - return true; - } - - private: - bool has_moved_rom_ = false; - std::array ram_{}; -}; - struct MemoryLedger { template bool write(uint32_t address, IntT source, Mode, bool) { @@ -394,10 +350,6 @@ struct MemoryLedger { input >> opcode; test_count = 0; -// if(opcode == 0x01a0f000) { -// printf(""); -// } - InstructionSet::ARM::Disassembler disassembler; InstructionSet::ARM::dispatch(opcode, disassembler); static constexpr uint32_t pc_address_mask = 0x03ff'fffc; @@ -591,30 +543,4 @@ struct MemoryLedger { } } -// TODO: turn the below into a trace-driven test case. -- (void)testROM319 { - constexpr ROM::Name rom_name = ROM::Name::AcornRISCOS319; - ROM::Request request(rom_name); - const auto roms = CSROMFetcher()(request); - - auto executor = std::make_unique>(); - executor->bus.rom = roms.find(rom_name)->second; - - for(int c = 0; c < 1000; c++) { - uint32_t instruction; - executor->bus.read(executor->pc(), instruction, executor->registers().mode(), false); - - if(instruction == 0xe33ff343) { - printf(""); - } - - printf("%08x: %08x [", executor->pc(), instruction); - for(int c = 0; c < 15; c++) { - printf("r%d:%08x ", c, executor->registers()[c]); - } - printf("psr:%08x]\n", executor->registers().status()); - execute(instruction, *executor); - } -} - @end