amaranth-lang / amaranth-yosys

WebAssembly-based Yosys distribution for Amaranth HDL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup on Intel Mac not working

jeremyherbert opened this issue · comments

Hi,

I am trying to use YoWASP with nmigen on an Intel Mac (on Catalina), but it seems that it is not detected by nmigen. pip freeze inside my virtualenv looks like this:

appdirs==1.4.4
bitarray==2.3.4
click==8.0.2
Jinja2==3.0.2
MarkupSafe==2.0.1
nmigen==0.2
nmigen-boards==0.0
nmigen-soc==0.0
nmigen-stdio==0.0
nmigen-tool==0.0.1
nmigen-yosys==0.9.post3746.dev34
pyvcd==0.1.7
six==1.16.0
wasmtime==0.30.0
yowasp-nextpnr-ecp5==0.0.post3849.dev224
yowasp-nextpnr-ecp5-all==0.0.post3849.dev224
yowasp-nextpnr-ice40==0.0.post3849.dev224
yowasp-nextpnr-ice40-all==0.0.post3849.dev224
yowasp-yosys==0.9.post5623.dev231

When I try to run the 01_blinky.py example, I get the following traceback:

Traceback (most recent call last):
  File "/Users/jeremy/Seafile/misc_projects/nmigen_playing/main.py", line 21, in <module>
    platform.build(Blinky(), do_program=False)
  File "/Users/jeremy/Seafile/misc_projects/nmigen_playing/venv/lib/python3.9/site-packages/nmigen/build/plat.py", line 71, in build
    require_tool(tool)
  File "/Users/jeremy/Seafile/misc_projects/nmigen_playing/venv/lib/python3.9/site-packages/nmigen/_toolchain.py", line 33, in require_tool
    raise ToolNotFound("Could not find required tool {} in PATH. Place "
nmigen._toolchain.ToolNotFound: Could not find required tool yosys in PATH. Place it directly in PATH or specify path explicitly via the YOSYS environment variable

yowasp-yosys and yowasp-nextpnr-* are definitely on my path; yowasp-yosys --version returns:

Yosys 0.10+12 (git sha1 356ec7bb, ccache clang 11.0.0-2~ubuntu20.04.1 -Os -flto -flto)

Do I need to specifically force the use of YoWASP using the environment variables mentioned in the traceback?

There's a subtlety here that I think tripped you up: the nmigen-yosys package (which is being used properly) is only useful to generate Verilog. You're building an example that uses a board, which needs a complete toolchain. There is no special knowledge of YoWASP in nMigen; so you're expected to provide the environment variables, just like if you were using any other toolchain build that doesn't put Yosys on PATH.

Thank you! That makes sense.

Perhaps this is an issue for a different tracker, but I do have the YoWASP toolchain on my path (incl all of the ice40/ecp5 tools), but nmigen doesn't seem to be detecting it. Is it because of the yowasp- prefix on all of the commands?

Yes. The prefix is added to avoid collisions between native binaries on PATH (if any) and PyPI binaries.

ok great, thank you.