Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from nmigen import *
- from nmigen.build import *
- from nmigen.build.res import *
- from nmigen.lib.io import Pin
- from nmigen_boards.ml505 import ML505Platform
- class IBUFDS(Elaboratable):
- def __init__(self):
- pass
- def elaborate(self, platform):
- m = Module()
- platform.add_resources([
- Resource("IBUFDS", 0,
- DiffPairs("48", "46", conn=("gpio", 1), dir="i"),
- Attrs(IOSTANDARD="LVDS_25", IBUF_LOW_PWR="FALSE")
- ),
- Resource("out", 0,
- Pins("24", conn=("gpio", 0), dir="o"),
- Attrs(IOSTANDARD="LVCMOS33")
- ),
- ])
- input_differential = platform.request("IBUFDS")
- out = platform.request("out")
- m.d.comb += [
- out.o.eq(input_differential.i)
- ]
- return m
- if __name__ == "__main__":
- dut = IBUFDS()
- ML505Platform().build(dut, do_program=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement