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

Add Digilent Nexys 4 DDR board #43

Merged
merged 8 commits into from
Jan 15, 2020
Merged

Conversation

nicolas-robin
Copy link
Contributor

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.

Copy link
Contributor

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

nmigen_boards/nexys4ddr.py Outdated Show resolved Hide resolved

Resource("accelerometer", 0, # ADXL362
SPIResource("spi", cs="D15", clk="F15", mosi="F14", miso="E15",
attrs=Attrs(IOSTANDARD="LVCMOS33")),
Copy link
Contributor

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.

Sorry, something went wrong.

Copy link
Contributor Author

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.

Sorry, something went wrong.

Copy link
Contributor Author

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:

  1. Use two resources for accelerometer: one SPIResource(...) and one for int 2-bit
  2. Use a single resource for accelerometer: with just Subsignal(...) and don't reuse SPIResource to avoid nesting
  3. any other option I don't know yet ?

Copy link
Contributor

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(...).

Copy link
Contributor Author

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")

Copy link
Contributor

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.

nmigen_boards/nexys4ddr.py Outdated Show resolved Hide resolved
@nicolas-robin
Copy link
Contributor Author

New commit available, please let me know what you think about it. Thanks for reviewing.

attrs=Attrs(IOSTANDARD="LVCMOS33")),
Resource("accelerometer_int", 0,
Pins("B13 C16", dir="i"),
Attrs(IOSTANDARD="LVCMOS33", PULLUP="TRUE")),
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@whitequark whitequark merged commit d53687c into m-labs:master Jan 15, 2020
@whitequark
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants