-
Notifications
You must be signed in to change notification settings - Fork 11
/
urukul_cpld.py
169 lines (154 loc) · 6.28 KB
/
urukul_cpld.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
from migen.build.generic_platform import *
from migen.build.xilinx import XilinxPlatform
from migen.build.xilinx.ise import XilinxISEToolchain
_io = [
("tp", 0, Pins("A4")),
("tp", 1, Pins("A5")),
("tp", 2, Pins("B5")),
("tp", 3, Pins("A6")),
("tp", 4, Pins("A7")),
("ifc_mode", 0, Pins("E14 B16 A16 B15")),
("hw_rev", 0, Pins("C16 D15 E15 E16")),
# 10k low: AD9912, 0R high: AD9910
("variant", 0, Pins("A15")),
# fail save LVDS enable, LVDS mode selection
# high: type 2 receiver, failsafe low
("fsen", 0, Pins("N15")),
("clk", 0,
Subsignal("div", Pins("E5")),
Subsignal("in_sel", Pins("G5")),
Subsignal("mmcx_osc_sel", Pins("C11")),
Subsignal("osc_en_n", Pins("B6"))),
("dds_common", 0,
Subsignal("master_reset", Pins("F16")),
Subsignal("io_reset", Pins("B9"))),
("dds_sync", 0,
Subsignal("clk0", Pins("P5"), Misc("PULLUP")), # DDS_SYNC_CLK0
Subsignal("clk_out_en", Pins("T5")), # DDS_SYNC_CLK_OUTEN
Subsignal("sync_sel", Pins("T10")), # DDS_SYNC_CLKSEL
Subsignal("sync_out_en", Pins("R6"))), # DDS_SYNC_OUTEN
("att", 0,
Subsignal("clk", Pins("E9")),
Subsignal("rst_n", Pins("N9")),
Subsignal("le", Pins("E10 P8 C8 K4")),
Subsignal("s_in", Pins("B7 D8 D7 L5")),
Subsignal("s_out", Pins("C10 C9 E8 R9"))),
("dds", 0,
Subsignal("rf_sw", Pins("D13")),
Subsignal("led", Pins("E11 B10")),
Subsignal("smp_err", Pins("D4"), Misc("PULLUP")),
Subsignal("pll_lock", Pins("E4"), Misc("PULLUP")),
Subsignal("io_update", Pins("B1")),
Subsignal("profile", Pins("A9 B8 A8")),
Subsignal("osk", Pins("C13")),
Subsignal("drover", Pins("D11")),
Subsignal("drhold", Pins("E13")),
Subsignal("drctl", Pins("C14")),
Subsignal("reset", Pins("B13")),
Subsignal("sck", Pins("A2")),
Subsignal("sdo", Pins("A3"), Misc("PULLUP")),
Subsignal("sdi", Pins("B2")),
Subsignal("cs_n", Pins("B3"))),
("dds", 1,
Subsignal("rf_sw", Pins("C12")),
Subsignal("led", Pins("A13 A11")),
Subsignal("smp_err", Pins("J1"), Misc("PULLUP")),
Subsignal("pll_lock", Pins("K2"), Misc("PULLUP")),
Subsignal("io_update", Pins("P4")),
Subsignal("profile", Pins("D3 D2 E2")),
Subsignal("osk", Pins("C3")),
Subsignal("drover", Pins("B4")),
Subsignal("drhold", Pins("C7")),
Subsignal("drctl", Pins("C4")),
Subsignal("reset", Pins("F2")),
Subsignal("sck", Pins("K3")),
Subsignal("sdo", Pins("J3"), Misc("PULLUP")),
Subsignal("sdi", Pins("K5")),
Subsignal("cs_n", Pins("J4"))),
("dds", 2,
Subsignal("rf_sw", Pins("D10")),
Subsignal("led", Pins("A14 B14")),
Subsignal("smp_err", Pins("P6"), Misc("PULLUP")),
Subsignal("pll_lock", Pins("N7"), Misc("PULLUP")),
Subsignal("io_update", Pins("H5")),
Subsignal("profile", Pins("M1 M6 M5")),
Subsignal("osk", Pins("L1")),
Subsignal("drover", Pins("L2")),
Subsignal("drhold", Pins("L4")),
Subsignal("drctl", Pins("K1")),
Subsignal("reset", Pins("R10")),
Subsignal("sck", Pins("H4")),
Subsignal("sdo", Pins("J2"), Misc("PULLUP")),
Subsignal("sdi", Pins("H3")),
Subsignal("cs_n", Pins("H1"))),
("dds", 3,
Subsignal("rf_sw", Pins("D9")),
Subsignal("led", Pins("A12 B11")),
Subsignal("smp_err", Pins("N6"), Misc("PULLUP")),
Subsignal("pll_lock", Pins("P7"), Misc("PULLUP")),
Subsignal("io_update", Pins("E3")),
Subsignal("profile", Pins("N3 P1 P2")),
Subsignal("osk", Pins("N2")),
Subsignal("drover", Pins("N5")),
Subsignal("drhold", Pins("N4")),
Subsignal("drctl", Pins("N1")),
Subsignal("reset", Pins("T8")),
Subsignal("sck", Pins("H2")),
Subsignal("sdo", Pins("G3"), Misc("PULLUP")),
Subsignal("sdi", Pins("F5")),
Subsignal("cs_n", Pins("G4"))),
("eem", 0,
Subsignal("io", Pins("M2" )),
Subsignal("oe", Pins("P15"))),
("eem", 1,
Subsignal("io", Pins("R13")),
Subsignal("oe", Pins("M15"))),
("eem", 2,
Subsignal("io", Pins("T16")),
Subsignal("oe", Pins("K15"))),
("eem", 3,
Subsignal("io", Pins("R16")),
Subsignal("oe", Pins("N16"))),
("eem", 4,
Subsignal("io", Pins("R15")),
Subsignal("oe", Pins("L15"))),
("eem", 5,
Subsignal("io", Pins("R14")),
Subsignal("oe", Pins("M16"))),
("eem", 6,
Subsignal("io", Pins("R12")),
Subsignal("oe", Pins("L16"))),
("eem", 7,
Subsignal("io", Pins("T15")),
Subsignal("oe", Pins("P16"))),
("eem", 8,
Subsignal("io", Pins("M3")),
Subsignal("oe", Pins("R7"))),
("eem", 9,
Subsignal("io", Pins("J5")),
Subsignal("oe", Pins("T4"))),
("eem", 10,
Subsignal("io", Pins("R3")),
Subsignal("oe", Pins("R4"))),
("eem", 11,
Subsignal("io", Pins("R2")),
Subsignal("oe", Pins("R5"))),
("eem", 12,
Subsignal("io", Pins("R1")),
Subsignal("oe", Pins("M7"))),
("eem", 13,
Subsignal("io", Pins("T1")),
Subsignal("oe", Pins("R8"))),
("eem", 14,
Subsignal("io", Pins("T2")),
Subsignal("oe", Pins("T7"))),
("eem", 15,
Subsignal("io", Pins("T3")),
Subsignal("oe", Pins("M8"))),
]
class Platform(XilinxPlatform):
def __init__(self):
XilinxPlatform.__init__(self, "xc2c256-6-ft256", _io)
self.toolchain.xst_opt = "-ifmt MIXED"
self.toolchain.par_opt = ("-optimize speed -unused pullup "
"-iostd LVCMOS33")