Skip to content

Commit

Permalink
Don't uppercase toolchain in toolchain_env_var. Fixes amaranth-lang#728.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgreig committed Nov 13, 2022
1 parent db24a14 commit 9ec544d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions amaranth/_toolchain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def tool_env_var(name):
return name.upper().replace("-", "_").replace("+", "X")


def toolchain_env_var(name):
return name.replace("-", "_").replace("+", "X")


def _get_tool(name):
return os.environ.get(tool_env_var(name), name)

Expand Down
4 changes: 2 additions & 2 deletions amaranth/build/plat.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def iter_files(self, *suffixes):

@property
def _deprecated_toolchain_env_var(self):
return f"NMIGEN_ENV_{tool_env_var(self.toolchain)}"
return f"NMIGEN_ENV_{toolchain_env_var(self.toolchain)}"

@property
def _toolchain_env_var(self):
return f"AMARANTH_ENV_{tool_env_var(self.toolchain)}"
return f"AMARANTH_ENV_{toolchain_env_var(self.toolchain)}"

def build(self, elaboratable, name="top",
build_dir="build", do_build=True,
Expand Down

0 comments on commit 9ec544d

Please sign in to comment.