for datan in range(3):
name = "data" + str(datan)
invert = False
- try:
- s = getattr(pads, name)
- except AttributeError:
- s = getattr(pads, name + "_n")
- invert = True
+ if hasattr(pads, name + "_p"):
+ s = Signal()
+ self.specials += Instance("IBUFDS",
+ Instance.Input("I", getattr(pads, name + "_p")),
+ Instance.Input("IB", getattr(pads, name + "_n")),
+ Instance.Output("O", s)
+ )
+ else:
+ try:
+ s = getattr(pads, name)
+ except AttributeError:
+ s = getattr(pads, name + "_n")
+ invert = True
cap = DataCapture(8, invert)
setattr(self.submodules, name + "_cap", cap)
###
+ if hasattr(pads, "clk_p"):
+ clkin = Signal()
+ self.specials += Instance("IBUFDS",
+ Instance.Input("I", pads.clk_p),
+ Instance.Input("IB", pads.clk_n),
+ Instance.Output("O", clkin)
+ )
+ else:
+ clkin = pads.clk
+
clkfbout = Signal()
pll_locked = Signal()
pll_clk0 = Signal()
Instance.Output("CLKOUT3", pll_clk3),
Instance.Output("LOCKED", pll_locked),
Instance.Input("CLKFBIN", clkfbout),
- Instance.Input("CLKIN", pads.clk),
+ Instance.Input("CLKIN", clkin),
Instance.Input("RST", self._r_pll_reset.storage)
)