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

CHK, DIVU, DIVS trap case cycles differs from Musashi #68

Closed
marhel opened this issue Feb 11, 2016 · 6 comments
Closed

CHK, DIVU, DIVS trap case cycles differs from Musashi #68

marhel opened this issue Feb 11, 2016 · 6 comments

Comments

@marhel
Copy link
Owner

marhel commented Feb 11, 2016

Since 80adcfc we differ from Musashi for instructions taking trap paths (CHK, DIVS, DIVU for now). This is on purpose, as we think Musashi incorrectly includes instruction cycles even in the trap case, which we no longer do.

Consider a PR to Musashi to fix this (could probably try do deduct instruction cycles just before taking the trap) or adding some config to our QC to ignore cycle count differences on some ops.

This was referenced Feb 11, 2016
@marhel
Copy link
Owner Author

marhel commented Feb 19, 2016

I think if we don't open PRs, we should at least consider opening issues in Musashi for the various differing cycle counts (now also the Scc + reg instructions) in order to keep track of them and increase the off chance that someone else fixes that in Musashi ;)

@emoon
Copy link
Contributor

emoon commented Feb 19, 2016

Indeed

@emoon
Copy link
Contributor

emoon commented Feb 19, 2016

I think it would be fine for now to open issues and maybe do some fixes later.

@marhel
Copy link
Owner Author

marhel commented Apr 28, 2016

Now we have multiple workarounds for this in place - we now both ignore cycles when an CHK or 0DIV exception occurs, and have gotten a few PRs accepted for undoing the instruction cycles in TRAP/TRAP#n exceptions. The former could perhaps be removed once we verify that the cycle result for the exception cases are as expected.

@marhel marhel closed this as completed Apr 28, 2016
@marhel
Copy link
Owner Author

marhel commented Apr 28, 2016

I forgot to mention that even after the PRs, ignoring cycles are still needed, because there are still differences, because Musashi does not take EA-calculation time into account for TRAP/TRAP#n, and thus returns a constant value regardless of EA-mode of the instruction.

@emoon
Copy link
Contributor

emoon commented Apr 28, 2016

Ah I see

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