From 63811b929a04d002f132e9fcb4b1a492908c76cb Mon Sep 17 00:00:00 2001 From: saji Date: Sun, 22 Sep 2024 10:55:52 -0500 Subject: [PATCH] add amaranth-boards to pdm, add platform pins --- pdm.lock | 13 +++--- pyproject.toml | 2 +- .../platforms/colorlight_5a75b_v8_2.py | 40 +++++++++---------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/pdm.lock b/pdm.lock index 10d8103..8a69a49 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:00a75da930aaa4d4233631525c1b6bb3c9642e99065be33cf83e74d4ad611d08" +content_hash = "sha256:fbfe1db54d73aa2641413610d5e62d87b02de247293e2af3cd53ee0c283318db" [[metadata.targets]] requires_python = "==3.12.*" @@ -29,11 +29,14 @@ files = [ [[package]] name = "amaranth-boards" -version = "0" -summary = "Placeholder package name reserved for Amaranth HDL" +version = "0.1.dev250" +requires_python = "~=3.8" +git = "https://github.com/amaranth-lang/amaranth-boards.git" +revision = "19b97324ecf9111c5d16377af79f82aad761c476" +summary = "Board and connector definitions for Amaranth HDL" groups = ["default"] -files = [ - {file = "amaranth_boards-0-py3-none-any.whl", hash = "sha256:0cc6af682122197b532eef7c2d378a59905ac5e63ec5c69b9147b1e05bf2c600"}, +dependencies = [ + "amaranth<0.7,>=0.4", ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 2e41bbd..c2608df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ authors = [ ] dependencies = [ "amaranth>=0.5.1", - "amaranth-boards>=0", + "amaranth-boards @ git+https://github.com/amaranth-lang/amaranth-boards.git", ] requires-python = "==3.12.*" readme = "README.md" diff --git a/src/groovylight/platforms/colorlight_5a75b_v8_2.py b/src/groovylight/platforms/colorlight_5a75b_v8_2.py index d22a7e2..6d5713a 100644 --- a/src/groovylight/platforms/colorlight_5a75b_v8_2.py +++ b/src/groovylight/platforms/colorlight_5a75b_v8_2.py @@ -2,7 +2,7 @@ import os import subprocess from amaranth.vendor import LatticeECP5Platform from amaranth.build import Resource, Pins, Attrs, Clock, Subsignal, PinsN, Connector -# from amaranth_boards.resources import SDRAMResource, LEDResources, ButtonResources +from amaranth_boards.resources import SDRAMResource, LEDResources, ButtonResources class Colorlight_5A75B_R82Platform(LatticeECP5Platform): @@ -23,25 +23,25 @@ class Colorlight_5A75B_R82Platform(LatticeECP5Platform): Subsignal("copi", Pins("T8", dir="o")), Attrs(IO_TYPE="LVCMOS33"), ), - Resource("led", 0, PinsN("T6", dir="o"), Attrs(IO_TYPE="LVCMOS33")), - # *ButtonResources( - # pins="R7", invert=True, attrs=Attrs(IO_TYPE="LVCMOS33", PULLMODE="UP") - # ), - # SDRAMResource( - # 0, - # clk="C8", - # we_n="B5", - # cas_n="A6", - # ras_n="B6", - # ba="B7 A8", - # a="A9 B9 B10 C10 D9 C9 E9 D8 E8 C7 B8", - # dq="B2 A2 C3 A3 B3 A4 B4 A5 E7 C6 D7 D6 " - # "E6 D5 C5 E5 A11 B11 B12 A13 B13 A14 B14 D14 D13 " - # "E11 C13 D11 C12 D10 C11 D10", - # attrs=Attrs( - # PULLMODE="NONE", DRIVE="4", SLEWRATE="FAST", IO_TYPE="LVCMOS33" - # ), - # ), + *LEDResources(pins="T6", invert=True, attrs=Attrs(IO_TYPE="LVCMOS33", DRIVE="4")), + *ButtonResources( + pins="R7", invert=True, attrs=Attrs(IO_TYPE="LVCMOS33", PULLMODE="UP") + ), + SDRAMResource( + 0, + clk="C8", + we_n="B5", + cas_n="A6", + ras_n="B6", + ba="B7 A8", + a="A9 B9 B10 C10 D9 C9 E9 D8 E8 C7 B8", + dq="B2 A2 C3 A3 B3 A4 B4 A5 E7 C6 D7 D6 " + "E6 D5 C5 E5 A11 B11 B12 A13 B13 A14 B14 D14 D13 " + "E11 C13 D11 C12 D10 C11 D10", + attrs=Attrs( + PULLMODE="NONE", DRIVE="4", SLEWRATE="FAST", IO_TYPE="LVCMOS33" + ), + ), Resource( "eth_rgmii", 0,