Skip to content

Commit

Permalink
Add icesugar_pro platform file from amaranth-lang#197
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankurte committed Apr 11, 2022
1 parent 2d0a23b commit 76c6367
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions amaranth_boards/icesugar_pro.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ICESugarPRO Platform

import subprocess

from amaranth.build import *
from amaranth.vendor.lattice_ecp5 import *
from amaranth_boards.resources import *

__all__ = ["ICESugarProPlatform"]


class ICESugarProPlatform(LatticeECP5Platform):
name = "IceSugar Pro v1.3"

device = "LFE5U-25F"
package = "BG256"
speed = "6"
default_clk = "clk25"
default_rst = "rst"

resources = [
Resource("clk25", 0, Pins("P6", dir="i"),
Clock(25e6), Attrs(IO_STANDARD="LVCMOS33")),

Resource("rst", 0, Pins("L14",dir="i"), Attrs(IO_TYPE = "LVCMOS33")),

RGBLEDResource(0, r="B11", g="A11", b="A12", attrs=Attrs(IOSTANDARD="LVCMOS33")),
]

def toolchain_program(self, products, name):
with products.extract("{}.bin".format(name)) as bitstream_filename:
subprocess.check_call(["icesprog", bitstream_filename])


if __name__ == "__main__":
from amaranth_boards.test.blinky import *
ICESugarProPlatform().build(Blinky(), do_program=True)

0 comments on commit 76c6367

Please sign in to comment.