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 1 commit into from
Jul 16, 2020


Copy link

@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.

Copy link

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/ 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.

Copy link

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.

Copy link
Member Author

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

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than the one comment.

nmigen_soc/ Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants