Advertisement
Guest User

nmigen-IBUFDS-example

a guest
Oct 9th, 2021
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. from nmigen import *
  2. from nmigen.build import *
  3. from nmigen.build.res import *
  4. from nmigen.lib.io import Pin
  5. from nmigen_boards.ml505 import ML505Platform
  6.  
  7. class IBUFDS(Elaboratable):
  8. def __init__(self):
  9. pass
  10.  
  11. def elaborate(self, platform):
  12. m = Module()
  13.  
  14. platform.add_resources([
  15. Resource("IBUFDS", 0,
  16. DiffPairs("48", "46", conn=("gpio", 1), dir="i"),
  17. Attrs(IOSTANDARD="LVDS_25", IBUF_LOW_PWR="FALSE")
  18. ),
  19. Resource("out", 0,
  20. Pins("24", conn=("gpio", 0), dir="o"),
  21. Attrs(IOSTANDARD="LVCMOS33")
  22. ),
  23. ])
  24.  
  25. input_differential = platform.request("IBUFDS")
  26. out = platform.request("out")
  27.  
  28. m.d.comb += [
  29. out.o.eq(input_differential.i)
  30. ]
  31. return m
  32.  
  33. if __name__ == "__main__":
  34. dut = IBUFDS()
  35. ML505Platform().build(dut, do_program=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement