Skip to content

Commit 76c6367

Browse files
committed
Add icesugar_pro platform file from #197
1 parent 2d0a23b commit 76c6367

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

amaranth_boards/icesugar_pro.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ICESugarPRO Platform
2+
3+
import subprocess
4+
5+
from amaranth.build import *
6+
from amaranth.vendor.lattice_ecp5 import *
7+
from amaranth_boards.resources import *
8+
9+
__all__ = ["ICESugarProPlatform"]
10+
11+
12+
class ICESugarProPlatform(LatticeECP5Platform):
13+
name = "IceSugar Pro v1.3"
14+
15+
device = "LFE5U-25F"
16+
package = "BG256"
17+
speed = "6"
18+
default_clk = "clk25"
19+
default_rst = "rst"
20+
21+
resources = [
22+
Resource("clk25", 0, Pins("P6", dir="i"),
23+
Clock(25e6), Attrs(IO_STANDARD="LVCMOS33")),
24+
25+
Resource("rst", 0, Pins("L14",dir="i"), Attrs(IO_TYPE = "LVCMOS33")),
26+
27+
RGBLEDResource(0, r="B11", g="A11", b="A12", attrs=Attrs(IOSTANDARD="LVCMOS33")),
28+
]
29+
30+
def toolchain_program(self, products, name):
31+
with products.extract("{}.bin".format(name)) as bitstream_filename:
32+
subprocess.check_call(["icesprog", bitstream_filename])
33+
34+
35+
if __name__ == "__main__":
36+
from amaranth_boards.test.blinky import *
37+
ICESugarProPlatform().build(Blinky(), do_program=True)

0 commit comments

Comments
 (0)