def __init__(self, device, pins, std, toolchain="ise"):
     ios = [self.make_spi(0, pins, std, toolchain)]
     if device == "xc7k325t-ffg900-1":  # debug
         ios += [
             ("user_sma_clock_p", 0, mb.Pins("L25"), mb.IOStandard("LVCMOS25")),
             ("user_sma_clock_n", 0, mb.Pins("K25"), mb.IOStandard("LVCMOS25")),
             ("user_sma_gpio_p", 0, mb.Pins("Y23"), mb.IOStandard("LVCMOS25")),
             ("user_sma_gpio_n", 0, mb.Pins("Y24"), mb.IOStandard("LVCMOS25")),
         ]
     xilinx.XilinxPlatform.__init__(self, device, ios, toolchain=toolchain)
 def make_spi(i, pins, std, toolchain):
     pu = "PULLUP" if toolchain == "ise" else "PULLUP TRUE"
     pd = "PULLDOWN" if toolchain == "ise" else "PULLDOWN TRUE"
     cs_n, clk, mosi, miso = pins[:4]
     io = ["spiflash", i,
         mb.Subsignal("cs_n", mb.Pins(cs_n), mb.Misc(pu)),
         mb.Subsignal("mosi", mb.Pins(mosi), mb.Misc(pu)),
         mb.Subsignal("miso", mb.Pins(miso), mb.Misc(pu)),
         mb.IOStandard(std),
         ]
     if clk:
         io.append(mb.Subsignal("clk", mb.Pins(clk), mb.Misc(pd)))
     for i, p in enumerate(pins[4:]):
         io.append(mb.Subsignal("pullup{}".format(i), mb.Pins(p),
                             mb.Misc(pu)))
     return io