Skip to content

Use builtin-yosys for amaranth #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions chipflow_lib/steps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,29 @@
Steps provide an extensible way to modify the `chipflow` command behavior for a given design
"""

import os
from abc import ABC

def setup_amaranth_tools():
_amaranth_settings = {
"AMARANTH_USE_YOSYS": "system",
"YOSYS": "yowasp-yosys",
"SBY": "yowasp-sby",
"SMTBMC": "yowasp-yosys-smtbmc",
"NEXTPNR_ICE40": "yowasp-nextpnr-ice40",
"ICEPACK": "yowasp-icepackr",
"NEXTPNR_ECP5": "yowasp-nextpnr-ecp5",
"ECPBRAM": "yowasp-ecpbram",
"ECPMULTI": "yowasp-ecpmulti",
"ECPPACK": "yowasp-ecppack",
"ECPPLL": "yowasp-ecppll",
"ECPUNPACK": "yowasp-ecpunpack",
"NEXTPNR-ECP5": "yowasp-nextpnr-ecp5",
"YOSYS-WITNESS": "yowasp-yosys-witness",
}

os.environ |= _amaranth_settings

class StepBase(ABC):
def __init__(self, config={}):
...
Expand Down
3 changes: 2 additions & 1 deletion chipflow_lib/steps/board.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# SPDX-License-Identifier: BSD-2-Clause
from . import StepBase
from . import StepBase, setup_amaranth_tools

class BoardStep(StepBase):
"""Build the design for a board."""

def __init__(self, config, platform):
self.platform = platform
setup_amaranth_tools()

def build_cli_parser(self, parser):
pass
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license = {file = "LICENSE.md"}

requires-python = ">=3.10"
dependencies = [
"amaranth>=0.5,<0.7",
"amaranth[builtin-yosys]>=0.5,<0.7",
"amaranth-soc @ git+https://github.com/amaranth-lang/amaranth-soc",
"amaranth-boards @ git+https://github.com/amaranth-lang/amaranth-boards",
"yowasp-yosys>=0.41.0.0",
Expand Down
Loading