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.
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. |
whitequark
left a comment
There was a problem hiding this comment.
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.)
| ---------- | ||
| event_map : :class:`EventMap` | ||
| Event map. | ||
| enable : Signal(event_map.size), one-hot, in |
There was a problem hiding this comment.
Are all of these actually one-hot? Not bit masks?
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
EventSourceclass) can be gathered in anInterruptSourcein order to generate interrupt requests. The interrupt source exposes an IRQ line, and is controlled by three CSRs:status,pendingandenable.