-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add event management primitives #12
Conversation
Updates:
|
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
===========================================
+ Coverage 99.63% 100.00% +0.36%
===========================================
Files 4 5 +1
Lines 552 630 +78
Branches 127 140 +13
===========================================
+ Hits 550 630 +80
+ Misses 1 0 -1
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
], name=name, src_loc_at=1 + src_loc_at) | ||
|
||
# FIXME: get rid of this | ||
__hash__ = object.__hash__ |
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.
This uses the same workaround as csr.Element
, because EventMap
stores event sources as keys of a dict.
I like the naming change a lot! I'll try to review this tomorrow. |
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.
Looks good overall.
One suggestion I would make is to have the Monitor provide a Source so you can stack them. (Quite a few SoCs have these hierarchies of interrupts, usually no more than 2-deep.)
nmigen_soc/event.py
Outdated
---------- | ||
event_map : :class:`EventMap` | ||
Event map. | ||
enable : Signal(event_map.size), one-hot, in |
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.
Are all of these actually one-hot? Not bit masks?
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.
Yep, reworded it.
I updated the Monitor to do so. As a consequence, EventMaps are now (optionally) assigned to Sources in order to support iterating over a hierarchy of events. |
Follow-up of #11, about decoupling event management from peripherals.
Events (represented by the
EventSource
class) can be gathered in anInterruptSource
in order to generate interrupt requests. The interrupt source exposes an IRQ line, and is controlled by three CSRs:status
,pending
andenable
.