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

periph: add a PeripheralInfo class for metadata. #19

Merged
merged 1 commit into from Jul 16, 2020

Conversation

@jfng
Copy link
Contributor

@jfng jfng commented Jun 29, 2020

As suggested in #11 (comment).

This PR proposes a PeripheralInfo class to gather the resources of a peripheral, with the aim of advertising them to the BSP generator. A ConfigDict class is also provided to collect constants.

@codecov
Copy link

@codecov codecov bot commented Jun 29, 2020

Codecov Report

Merging #19 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #19   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         7    +1     
  Lines          675       693   +18     
  Branches       142       145    +3     
=========================================
+ Hits           675       693   +18     
Impacted Files Coverage Δ
nmigen_soc/periph.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20d0dd7...117e18c. Read the comment docs.

@whitequark
Copy link
Member

@whitequark whitequark commented Jun 29, 2020

I'll need some time to dig into this--please ping me on IRC in a week or two if I don't review this quickly enough.

@jfng
Copy link
Contributor Author

@jfng jfng commented Jul 8, 2020

Updates, based on feedback from the July 6th IRC meeting:

  • Remove the constant dictionary. Its implementation will be the subject of another PR.
  • Use an event.Source corresponding to the IRQ line of the peripheral, instead of an event map describing local events. This gives the BSP generator a mean to recover both:
    • the IRQ number of the peripheral (by calling .index(periph_info.irq) on the interrupt controller event map)
    • the numbers of local events, in order to clear their pending bits. (by querying periph_info.irq.event_map)
  • Also, use getter-only properties instead of attributes, for added safety.

Copy link
Member

@whitequark whitequark left a comment

Looks good other than the one comment.

nmigen_soc/periph.py Show resolved Hide resolved
@whitequark whitequark merged commit 1218e26 into amaranth-lang:master Jul 16, 2020
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants