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
Added constants to cas module #348
Conversation
Generated header now includes constant for number of devices
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.
Generally looks good. I don't think you need the name=XXX
arguments to CSRConstant, they should automagically pick up the name based on your assignments.
gateware/cas.py
Outdated
@@ -30,6 +30,8 @@ def __init__(self, platform, clk_freq): | |||
user_leds[i].eq(leds[i]), | |||
] | |||
|
|||
self.num_leds = CSRConstant(len(user_leds), name='num_leds') |
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.
You shouldn't need name='num_leds'
here?
gateware/cas.py
Outdated
@@ -46,6 +48,8 @@ def __init__(self, platform, clk_freq): | |||
switches[i].eq(~user_sws[i]), | |||
] | |||
|
|||
self.num_sws = CSRConstant(len(user_sws), name='num_switches') |
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.
You shouldn't need name='num_switches'
gateware/cas.py
Outdated
@@ -73,3 +77,4 @@ def __init__(self, platform, clk_freq): | |||
self.submodules += [btn_timer] | |||
|
|||
self.buttons_ev.finalize() | |||
self.num_buttons = CSRConstant(len(user_btns), name='num_buttons') |
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.
You shouldn't need name='num_buttons'
here?
* Remove unneeded name property. * Name the CSRs as `_xxx_count`, constant ends up as `cas_xxx_count_read()`.
Thanks Tim, I'll need to go back and change the micropython code to match the constant names. Was there anything else you wanted me to do with this one? |
@karl-malakoff - Sorry for the slow reply, I wanted to check the constant names looked good and they do now. See
|
Generated header now includes constant for number of devices