Skip to content
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

Low level bus signals #6

Closed
jotego opened this issue Mar 28, 2021 · 2 comments
Closed

Low level bus signals #6

jotego opened this issue Mar 28, 2021 · 2 comments

Comments

@jotego
Copy link

jotego commented Mar 28, 2021

Hello,

Although this emulator claims to be cycle-accurate, it isn't possible to emulate a single clock cycle, let alone half a clock cycle.

For accurately representing bus transactions, it would be needed to emulate the rise and falling edges of the clock. For instance, the /DTACK bus signal may take many clock cycles to come down. Maybe you have a way around that at the moment by setting the clock cycle count via a method. The important thing is that data is not in the bus when the read16 method is called, and that's why /DTACK halts the CPU, but the read16 method cannot emulate that because it has to reply with a value.

I understand that this probably falls out of your scope, but I just wanted to share it; in case you want to aim for a more truly cycle-accurate emulation.

Thank you

@dirkwhoffmann
Copy link
Owner

it isn't possible to emulate a single clock cycle, let alone half a clock cycle.

No, this is not possible. The goal of the CPU implementation is to provide a high-speed CPU that is accurate enough for being used in an Amiga emulator or similar projects. It is cycle-accurate in the sense that the CPU issues several sync() calls during the execution of a single instruction (there is a sync() call before every memory access). Inside the sync handler, the environment (e.g., my virtual Amiga) has the ability to update the bus value w.r.t. to the current CPU cycle before the read access is carried out. This approach is perfectly suited for emulating an Amiga. It is not accurate enough for applications that require a true cycle-by-cycle execution which seems to be the case in your project.

@jotego
Copy link
Author

jotego commented Mar 28, 2021

Thank you for your kind explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants