|
2 | 2 | import argparse |
3 | 3 | import subprocess |
4 | 4 | import shutil |
| 5 | +import unittest |
5 | 6 |
|
6 | 7 | from amaranth.build import * |
7 | 8 | from amaranth.vendor import LatticeECP5Platform |
@@ -44,7 +45,7 @@ class _ULX3SPlatform(LatticeECP5Platform): |
44 | 45 | Resource("button_right", 0, Pins("H16", dir="i"), Attrs(IO_TYPE="LVCMOS33", PULLMODE="DOWN")), |
45 | 46 |
|
46 | 47 | # FTDI connection. |
47 | | - UARTResource(0, |
| 48 | + UARTResource(0, |
48 | 49 | rx="M1", tx="L4", rts="M3", dtr="N1", role="dce", |
49 | 50 | attrs=Attrs(IO_TYPE="LVCMOS33") |
50 | 51 | ), |
@@ -103,7 +104,7 @@ class _ULX3SPlatform(LatticeECP5Platform): |
103 | 104 | Resource("diff_gpio", 1, DiffPairs("A10", "A11"), Attrs(IO_TYPE="LVCMOS33")), |
104 | 105 | Resource("diff_gpio", 2, DiffPairs("A9", "B10"), Attrs(IO_TYPE="LVCMOS33")), |
105 | 106 | Resource("diff_gpio", 3, DiffPairs("B9", "C10"), Attrs(IO_TYPE="LVCMOS33")), |
106 | | - |
| 107 | + |
107 | 108 | # HDMI (only TX, due to the top bank of ECP5 only supporting diff. outputs) |
108 | 109 | Resource("hdmi", 0, |
109 | 110 | Subsignal("cec", Pins("A18", dir="io"), |
@@ -177,16 +178,22 @@ class ULX3S_85F_Platform(_ULX3SPlatform): |
177 | 178 | device = "LFE5U-85F" |
178 | 179 |
|
179 | 180 |
|
| 181 | +class TestCase(unittest.TestCase): |
| 182 | + def test_smoke(self): |
| 183 | + from .test.blinky import Blinky |
| 184 | + ULX3S_45F_Platform().build(Blinky(), do_build=False) |
| 185 | + |
| 186 | + |
180 | 187 | if __name__ == "__main__": |
181 | 188 | from .test.blinky import * |
182 | | - |
| 189 | + |
183 | 190 | variants = { |
184 | 191 | '12F': ULX3S_12F_Platform, |
185 | 192 | '25F': ULX3S_25F_Platform, |
186 | 193 | '45F': ULX3S_45F_Platform, |
187 | 194 | '85F': ULX3S_85F_Platform |
188 | 195 | } |
189 | | - |
| 196 | + |
190 | 197 | # Figure out which FPGA variant we want to target... |
191 | 198 | parser = argparse.ArgumentParser() |
192 | 199 | parser.add_argument('variant', choices=variants.keys()) |
|
0 commit comments