I'm looking to emulate a 6502 on the ARM but I would like to make it cycle accurate so I need some way to interface to an external clock. I can't rely on an internal clock as there are external components that will rely on the external clock as well and the emulator needs to be able to run in lockstep with everything else. One thing to keep in mind is once everything is in working order I will want to increase my clock to several hundred MHz so the mechanism with which I interface with the external clock has to be extremely fast, preferably a pin on the ARM itself that I can poll and sync with. I don't want to utilize interrupts either since the code is performance sensitive. Any ideas on whether this is possible on the ARMv8 such as the A53/A57? From what I understand, the Raspberry Pi 3 uses a low speed protocol for communication and is interrupt based, and for my purposes those two are big no-no's for what I'm doing so that won't work. I'd appreciate some expert advice as this is starting to stretch the limits of what may be possible.
It is going to be difficult to get a software emulated core running at several hundred MHz (I haven't seen 6502 microcontrollers running at that speed anyway, excluding FPGA/ASICs with modern process technologies :-) ). One thing you can consider is to generate a software controlled clock to exteral components.
Most of the ARM processors have an external event input signal (for Cortex-M processors, this is called RXEV - receive event). You can use it together with WFE instruction to provide a wait control. But this WFE instruction enter sleep conditionally and might not fit your application. Potentially there could be other sources generate events, or if pin is not accessible from external. Page 10 of the paper below explained how this could be used in FSM (Finite State Machine) design.
http://www2.keil.com/docs/default-source/default-document-library/software-based-finite-state-machine-(fsm)-with-general-purpose-processorsf4f837f788736c26abc1ff00001d2c02.pdf