-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clocked CPU #105
Comments
Would it be possible to have the old implementation in parallel with the new, as a compile-time option? |
Yes, jotting will be done. :) As for having a compile option, not so sure. Even the first iteration, which should be fairly kind to the structure still requires changing at least one actual instruction. That would mean pretty much keeping separate compilable instances of cpu_run(), cpu_step_instr(), cpu_do_cycle() and any changed instructions. I'm not sure this is manageable for more than one or two instructions, unless the whole cpu/* is preserved and clocked cpu is done alongside it in a new directory of course. |
Yes, I was thinking new directory. |
Ok, I'll start that way. I won't maintain two different models forever though :) |
Ok, plans (everything based off the same 8MHz clock): First iteration
This should take care of the basic bits, and the next code iteration can begin Second iteration
Third iteration
|
Thanks; seem like a level-headed approach. Temporarily handling wait states is easy, if you choose to do that. Share a clock counter between the CPU and MMU. When you want to start a bus cycle, delay until |
Those are not the waitstates I'm refering to. They can be simulated within the cpu. The 2/6-cycle (yes, I know it's not exactly 6c, but dependent on the E-clock) delays from the PSG/ACIA are not something the cpu itself can really predict without too much hacky code. Those could be handled with the split of request/result on the bus. In the meantime, the devices will simulate the extra cycles just like they do today (by increasing icycle) |
Ah, those waitstates. |
There might be a small addition to the second iteration here. The instruction sets icycle to however many cycles that needs to pass before entering the instruction again. Normally 0. It also sets a (new) flag to signal that the instruction is done. This means that the current external waitstate simulation can run as it does now, since that read will just increase the icycle to 2 (or 6 or so), and thereby delaying the instruction a bit. Yes, it will technically be delayed in the wrong way (it will get the result first, then wait), but in the second iteration this is good enough and won't interfere with any existing code. |
The clocked-cpu branch now contains most of the concepts listed in the first iteration. Movem still does the wrong thing, but it works somewhat at least. The first iteration is not finished yet though. |
Helpful hint: Don't run along too far on the branch. I suggest either merging it into master occasionally, or rebasing it to master frequently. I do the latter with my branches. |
Once I get the debugger bits done, I think I'll just merge it for now, since it doesn't affect the old system anyway. Otherwise I would've rebased a lot. |
"68000 Undocumented Behavior Notes" |
@stefanberndtsson is planning to convert the CPU component into a clocked design.
Would it be possible to jot down a few notes here every now and then to get a feel for what's going to happen?
The text was updated successfully, but these errors were encountered: