numato_mimas: add spi_flash#0 resource.
[nmigen-boards.git] / nmigen_boards / numato_mimas.py
1 import os
2 import subprocess
3
4 from nmigen.build import *
5 from nmigen.vendor.xilinx_spartan_3_6 import *
6 from .dev import *
7
8
9 __all__ = ["NumatoMimasPlatform"]
10
11
12 class NumatoMimasPlatform(XilinxSpartan6Platform):
13 device = "xc6slx9"
14 package = "tqg144"
15 speed = "2"
16 default_clk = "clk100"
17 resources = [
18 Resource("clk100", 0, Pins("P126", dir="i"),
19 Clock(100e6), Attrs(IOSTANDARD="LVCMOS33")),
20
21 Resource("user_led", 0, Pins("P119", dir="o"),
22 Attrs(IOSTANDARD="LVCMOS33")),
23 Resource("user_led", 1, Pins("P118", dir="o"),
24 Attrs(IOSTANDARD="LVCMOS33")),
25 Resource("user_led", 2, Pins("P117", dir="o"),
26 Attrs(IOSTANDARD="LVCMOS33")),
27 Resource("user_led", 3, Pins("P116", dir="o"),
28 Attrs(IOSTANDARD="LVCMOS33")),
29 Resource("user_led", 4, Pins("P115", dir="o"),
30 Attrs(IOSTANDARD="LVCMOS33")),
31 Resource("user_led", 5, Pins("P114", dir="o"),
32 Attrs(IOSTANDARD="LVCMOS33")),
33 Resource("user_led", 6, Pins("P112", dir="o"),
34 Attrs(IOSTANDARD="LVCMOS33")),
35 Resource("user_led", 7, Pins("P111", dir="o"),
36 Attrs(IOSTANDARD="LVCMOS33")),
37
38 Resource("user_btn", 0, Pins("P124", dir="i"),
39 Attrs(IOSTANDARD="LVCMOS33", PULLUP="TRUE")),
40 Resource("user_btn", 1, Pins("P123", dir="i"),
41 Attrs(IOSTANDARD="LVCMOS33", PULLUP="TRUE")),
42 Resource("user_btn", 2, Pins("P121", dir="i"),
43 Attrs(IOSTANDARD="LVCMOS33", PULLUP="TRUE")),
44 Resource("user_btn", 3, Pins("P120", dir="i"),
45 Attrs(IOSTANDARD="LVCMOS33", PULLUP="TRUE")),
46
47 *SPIFlashResources(0,
48 cs="P38", clk="P70", mosi="P64", miso="65",
49 attrs=Attrs(IOSTANDARD="LVCMOS33")
50 ),
51 ]
52 connectors = [
53 Connector("p", 1,
54 "- - P35 P34 P33 P32 P30 P29 P27 P26 "
55 "P24 P23 P22 P21 P17 P16 P15 P14 P12 P11 "
56 "P10 P9 P8 P7 P6 P5 P2 P1 P142 P141 "
57 "P140 P139 P138 P137 P134 P133 P132 P131 - - "
58 ),
59 Connector("p", 2,
60 "- - P43 P44 P45 P46 P47 P48 P50 P51 "
61 "P55 P56 P74 P75 P78 P79 P80 P81 - - "
62 "P82 P83 P84 P85 P87 P88 P92 P93 P94 P95 "
63 "P97 P98 P99 P100 P101 P102 P104 P105 - - "
64 )
65 ]
66
67 # Programming this board is not currently supported.
68
69
70 if __name__ == "__main__":
71 from ._blinky import Blinky
72 NumatoMimasPlatform().build(Blinky())