-
Notifications
You must be signed in to change notification settings - Fork 13
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 Digilent Nexys 4 DDR board #43
Conversation
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 great, and thank you for taking care to reuse existing Resources!
Apart from the minor issue with the accelerometer, do you think you could adjust the formatting to (a) consistently wrap subsignals and keyword arguments past the first line, and (b) indent the second and further lines in a resource definition by 4 spaces? Similar to versa_ecp5
. This isn't a blocker for merging though, just a wish.
|
||
Resource("accelerometer", 0, # ADXL362 | ||
SPIResource("spi", cs="D15", clk="F15", mosi="F14", miso="E15", | ||
attrs=Attrs(IOSTANDARD="LVCMOS33")), |
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.
Does this do anything useful? Nested resources aren't supposed to work, and I'm surprised this isn't an error.
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.
I've asked myself as it's not done like this anywhere else. I've tried to request the nested resource and looks like it works. But I will remove this as it is not supported.
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.
In this case, which options do you think is better:
- Use two resources for
accelerometer
: oneSPIResource(...)
and one forint
2-bit - Use a single resource for
accelerometer
: with justSubsignal(...)
and don't reuseSPIResource
to avoid nesting - any other option I don't know yet ?
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 can just pass int="B13 C16"
to SPIResource(...)
.
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.
Thanks I didn't see this parameter.
So I've done this, but I don't see how to handle the 2 attributes I have for these 2 pins (PULLUP="TRUE")
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.
Yes, attributes are unfortunately an issue. I never came up with a satisfying solution to this problem. For now, unfortunately I think you should go back to specifying the resource explicitly (to specify attributes), but otherwise it should be identical to the one produced by SPIResource
.
New commit available, please let me know what you think about it. Thanks for reviewing. |
nmigen_boards/nexys4ddr.py
Outdated
attrs=Attrs(IOSTANDARD="LVCMOS33")), | ||
Resource("accelerometer_int", 0, | ||
Pins("B13 C16", dir="i"), | ||
Attrs(IOSTANDARD="LVCMOS33", PULLUP="TRUE")), |
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.
Could you merge these two resources into one manually-defined one, similarly to how you tackled temp_sensor
below?
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.
Yes I'will do that
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.
Done
Thank you! |
Tested succesfully on the actual board with blinky and an UART demo with flow control.
The others resources are based on the official XDC (and schematic for the DDR2), but not tested.