Hello

I've written simple code to instantiate buffer and generate a square wave.
The code is working fine for OBUFDS, but for tri-state buffers (OBUFTDS &
IOBUFDS), there is nothing on the output. All 3 files are attached. Would
you please let me know what could be wrong? Do we need to do something more
to use tri-state buffers?

Note: In kc705 platform file, I changed output standard of user_sma_gpio_p
and user_sma_gpio_n pins to LVDS25 (a quick hack basically).

Regards
Arpit Agrawal
#!/usr/bin/env python3

from migen import *
from migen.build.platforms import kc705

class DifferentialTristate(TSTriple):
    def get_tristate(self, pad, pad_n):
        return Instance("IOBUFDS",
                        i_I=self.i, o_O=self.o, i_T=self.oe,
                        io_IO=pad, io_IOB=pad_n)

if __name__ == "__main__":
    plat = kc705.Platform()
    m = Module()
    signal1 = Signal(reset=0)
    count1 = Signal(max=1000, reset=0)
    diff1 = DifferentialTristate()
    m.specials += diff1.get_tristate(plat.request("user_sma_gpio_p"), 
plat.request("user_sma_gpio_n"))
    m.comb += [
        diff1.oe.eq(1),
        diff1.i.eq(signal1)
    ]
    m.sync += [
        If(count1 < 999,
           count1.eq(count1 + 1)
        ).Else(
            count1.eq(0),
            signal1.eq(~signal1)
        )
    ]
    plat.build(m, run=True, build_dir="differential", build_name="differential")
    plat.create_programmer().flash(0, "differential.bin")
#!/usr/bin/env python3

from migen import *
from migen.build.platforms import kc705

class DifferentialTristate(TSTriple):
    def get_tristate(self, pad, pad_n):
        return Instance("OBUFDS",
                        i_I=self.i,
                        o_O=pad, o_OB=pad_n)

if __name__ == "__main__":
    plat = kc705.Platform()
    m = Module()
    signal1 = Signal(reset=0)
    count1 = Signal(max=1000, reset=0)
    diff1 = DifferentialTristate()
    m.specials += diff1.get_tristate(plat.request("user_sma_gpio_p"), 
plat.request("user_sma_gpio_n"))
    m.comb += [
        # diff1.oe.eq(1),
        diff1.i.eq(signal1)
    ]
    m.sync += [
        If(count1 < 999,
           count1.eq(count1 + 1)
        ).Else(
            count1.eq(0),
            signal1.eq(~signal1)
        )
    ]
    plat.build(m, run=True, build_dir="differential", build_name="differential")
    plat.create_programmer().flash(0, "differential.bin")
#!/usr/bin/env python3

from migen import *
from migen.build.platforms import kc705

class DifferentialTristate(TSTriple):
    def get_tristate(self, pad, pad_n):
        return Instance("OBUFTDS",
                        i_I=self.i, i_T=self.oe,
                        o_O=pad, o_OB=pad_n)

if __name__ == "__main__":
    plat = kc705.Platform()
    m = Module()
    signal1 = Signal(reset=0)
    count1 = Signal(max=1000, reset=0)
    diff1 = DifferentialTristate()
    m.specials += diff1.get_tristate(plat.request("user_sma_gpio_p"), 
plat.request("user_sma_gpio_n"))
    m.comb += [
        diff1.oe.eq(1),
        diff1.i.eq(signal1)
    ]
    m.sync += [
        If(count1 < 999,
           count1.eq(count1 + 1)
        ).Else(
            count1.eq(0),
            signal1.eq(~signal1)
        )
    ]
    plat.build(m, run=True, build_dir="differential", build_name="differential")
    plat.create_programmer().flash(0, "differential.bin")
_______________________________________________
ARTIQ mailing list
https://ssl.serverraum.org/lists/listinfo/artiq

Reply via email to