2013-04-08 14:28:23 -04:00
|
|
|
from mibuild.generic_platform import *
|
2014-06-20 11:10:09 -04:00
|
|
|
from mibuild.crg import SimpleCRG
|
2014-06-07 06:24:19 -04:00
|
|
|
from mibuild.xilinx_ise import XilinxISEPlatform
|
2014-07-30 05:35:21 -04:00
|
|
|
from mibuild.programmer import XC3SProg
|
2013-04-08 14:28:23 -04:00
|
|
|
|
|
|
|
_io = [
|
|
|
|
("user_led", 0, Pins("P112"), IOStandard("LVCMOS33"), Drive(24), Misc("SLEW=QUIETIO")),
|
|
|
|
|
|
|
|
("clk32", 0, Pins("P94"), IOStandard("LVCMOS33")),
|
|
|
|
|
|
|
|
("serial", 0,
|
2013-05-19 14:24:47 -04:00
|
|
|
Subsignal("tx", Pins("P105"), IOStandard("LVCMOS33"), Misc("SLEW=SLOW")),
|
|
|
|
Subsignal("rx", Pins("P101"), IOStandard("LVCMOS33"), Misc("PULLUP"))
|
2013-04-08 14:28:23 -04:00
|
|
|
),
|
|
|
|
|
|
|
|
("spiflash", 0,
|
2013-11-25 09:14:58 -05:00
|
|
|
Subsignal("cs_n", Pins("P38")),
|
2013-04-08 14:28:23 -04:00
|
|
|
Subsignal("clk", Pins("P70")),
|
|
|
|
Subsignal("mosi", Pins("P64")),
|
|
|
|
Subsignal("miso", Pins("P65"), Misc("PULLUP")),
|
|
|
|
IOStandard("LVCMOS33"), Misc("SLEW=FAST")
|
|
|
|
),
|
2013-11-25 09:14:58 -05:00
|
|
|
("spiflash2x", 0,
|
|
|
|
Subsignal("cs_n", Pins("P38")),
|
|
|
|
Subsignal("clk", Pins("P70")),
|
|
|
|
Subsignal("dq", Pins("P64", "P65")),
|
|
|
|
IOStandard("LVCMOS33"), Misc("SLEW=FAST")
|
|
|
|
),
|
2013-04-08 14:28:23 -04:00
|
|
|
|
|
|
|
("sdram_clock", 0, Pins("P32"), IOStandard("LVCMOS33"), Misc("SLEW=FAST")),
|
|
|
|
("sdram", 0,
|
2013-06-25 16:57:31 -04:00
|
|
|
Subsignal("a", Pins("P140 P139 P138 P137 P46 P45 P44",
|
|
|
|
"P43 P41 P40 P141 P35 P34")),
|
|
|
|
Subsignal("ba", Pins("P143 P142")),
|
2013-04-08 14:28:23 -04:00
|
|
|
Subsignal("cs_n", Pins("P1")),
|
|
|
|
Subsignal("cke", Pins("P33")),
|
|
|
|
Subsignal("ras_n", Pins("P2")),
|
|
|
|
Subsignal("cas_n", Pins("P5")),
|
|
|
|
Subsignal("we_n", Pins("P6")),
|
2013-06-25 16:57:31 -04:00
|
|
|
Subsignal("dq", Pins("P9 P10 P11 P12 P14 P15 P16 P8 P21 P22 P23 P24 P26 P27 P29 P30")),
|
|
|
|
Subsignal("dm", Pins("P7 P17")),
|
2013-04-08 14:28:23 -04:00
|
|
|
IOStandard("LVCMOS33"), Misc("SLEW=FAST")
|
2014-02-16 17:54:11 -05:00
|
|
|
)
|
|
|
|
]
|
|
|
|
|
|
|
|
_connectors = [
|
|
|
|
("A", "P48 P51 P56 P58 P61 P66 P67 P75 P79 P81 P83 P85 P88 P93 P98 P100"),
|
|
|
|
("B", "P99 P97 P92 P87 P84 P82 P80 P78 P74 P95 P62 P59 P57 P55 P50 P47"),
|
|
|
|
("C", "P114 P115 P116 P117 P118 P119 P120 P121 P123 P124 P126 P127 P131 P132 P133 P134")
|
2013-04-08 14:28:23 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
class Platform(XilinxISEPlatform):
|
|
|
|
def __init__(self):
|
|
|
|
XilinxISEPlatform.__init__(self, "xc6slx9-tqg144-2", _io,
|
2014-06-20 11:10:09 -04:00
|
|
|
lambda p: SimpleCRG(p, "clk32", None), _connectors)
|
2013-11-24 17:42:31 -05:00
|
|
|
|
2014-07-30 05:35:21 -04:00
|
|
|
def create_programmer(self):
|
|
|
|
return XC3SProg("papilio", "bscan_spi_lx9_papilio.bit")
|
|
|
|
|
2013-11-24 17:42:31 -05:00
|
|
|
def do_finalize(self, fragment):
|
|
|
|
try:
|
2014-05-19 06:03:26 -04:00
|
|
|
self.add_period_constraint(self.lookup_request("clk32"), 31.25)
|
2013-11-24 17:42:31 -05:00
|
|
|
except ConstraintError:
|
|
|
|
pass
|