-
Notifications
You must be signed in to change notification settings - Fork 16
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
Asynchronous interrupts #532
Conversation
dc75ef0
to
b7f42b2
Compare
f369afc
to
0515e2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
PR is ready - I integrated @Kristopher38 's tests from feature/interrupts and extended them to cover pending interrupts during ISR execution. Two bugs were found and fixed:
I added Zicsr to basic_core_config, because it supported ExceptionUnit, and handling them wouldn't make to much sense without csr support ( |
Does this mean we're really close to getting speculative execution? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Un)healthy does of bikeshedding - finished reviewing this and turns out almost all of my comments are about comments, but it's probably a good sign if anything.
test/test_core.py
Outdated
# 10-15 is the smallest feasible cycle count between interrupts to provide forward progress | ||
("interrupt.asm", 300, {4: 21, 8: 9349}, {2: 21, 7: 9349, 31: 0xDE}, 10, 15), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried to lower hi
and lo
params? This comment was true in my implementation but might no longer hold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it turns out we always have forward progression! updated values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we required by the spec to handle next interrupt immediately after the previous one returns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but hi/lo reffers only to execution cycles while not in ISR. Interrupts that happen during ISR and are executed immediately at MRET are triggred by independent random() < 0.4
condition in test.
d42cac7
to
b302b08
Compare
Yes! And I plan it to integrate if (at least partially) via reporting branch mispredictions as exceptions in next, or nextnext PR.
Things TODO for future (that we forgot about):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! And I plan it to integrate if (at least partially) via reporting branch mispredictions as exceptions in next, or nextnext PR.
Awesome, can't wait to see it happen! I might even bang out some nontrivial branch predictor if my time constraints allow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Unfortunately, Fmax went down a lot, this needs to be investigated. |
@tilk |
Is the additional delay to ExceptionCauseRegister safe? I fear a race condition can happen.
Indeed, this looks fishy. I wonder what will happen when jumps will no longer stall the fetcher.
I wouldn't worry about the Carry LUT spike on the basic core, a corresponding spike is not seen on the full core. IPC loss is possibly due to more transaction conflicts. I want to introduce a simple Transactron profiler soon, which will hopefully help find such bottlenecks. |
Haha, I know now.
|
Implementations of asynchronous interrupts based on idea that we came up with @lekcyjna123 and @Arusekk
Async interrupts are handled just like exceptions (via internal
ExceptionCauseRegister
) and are inserted only at branch instructions (which already know its pc in FU) (+ conditonally immediately after (at) MRET and CSR because it is required by spec)This way we don't need to store PC in ROB or use it in all FUs. Additionaly the same logic would be used for handling mispredictions (very easy to do)!
InterruptController
is temporary solution and will be replaced with proper CSR based controller with the same interface in other PR (in progress)Marked as draft because I want to add some simple tests (+ probably port ones from
feature/interrupts
)Of course depends on #523 (and needed to see a nice diff :) )