7 nMigen requires Python 3.6; it works on CPython_ 3.6 (or newer), and works faster on PyPy3.6_ 7.2 (or newer).
9 For most workflows, nMigen requires Yosys_ 0.9 (or newer). A compatible version of Yosys is distributed via PyPI_ for most popular platforms.
11 Simulating nMigen code requires no additional software. However, a waveform viewer like GTKWave_ is invaluable for debugging.
13 Synthesizing, placing and routing an nMigen design for an FPGA requires the FPGA family specific toolchain.
15 .. TODO: Link to FPGA family docs here
17 .. _CPython: https://www.python.org/
18 .. _PyPy3.6: https://www.pypy.org/
19 .. _Yosys: http://www.clifford.at/yosys/
20 .. _PyPI: https://pypi.org/
21 .. _GTKWave: http://gtkwave.sourceforge.net/
26 Installing prerequisites
27 ========================
31 .. tab-container:: windows
34 `Install Python <python:using-on-windows>`_, either from Windows Store or using the full installer. If using the full installer, make sure to install a 64-bit version of Python.
36 `Download GTKWave`_, either win32 or win64 binaries. GTKWave does not need to be installed; it can be unpacked to any convenient location and run from there.
38 .. _Download GTKWave: https://sourceforge.net/projects/gtkwave/files/
40 .. tab-container:: macos
43 Install Homebrew_. Then, install Python and GTKWave by running:
45 .. code-block:: console
47 $ brew install python gtkwave
49 .. _Homebrew: https://brew.sh
51 .. tab-container:: linux
54 .. rubric:: Debian-based distributions
56 Install Python and GTKWave by running:
58 .. code-block:: console
60 $ sudo apt-get install python3-pip gtkwave
62 On architectures other than x86_64 and AArch64, install Yosys by running:
64 .. code-block:: console
66 $ sudo apt-get install yosys
68 If Yosys 0.9 (or newer) is not available, `build Yosys from source`_.
70 .. rubric:: Other distributions
72 Install Python and GTKWave from the package repository of your distribution.
74 On architectures other than x86_64 and AArch64, install Yosys from the package repository of your distribution.
76 If Yosys 0.9 (or newer) is not available, `build Yosys from source`_.
78 .. _build Yosys from source: https://github.com/YosysHQ/yosys/#setup
86 The latest release of nMigen should work well for most applications. A development snapshot---any commit from the ``master`` branch of nMigen---should be similarly reliable, but is likely to include experimental API changes that will be in flux until the next release. With that in mind, development snapshots can be used to try out new functionality or to avoid bugs fixed since the last release.
94 .. |release:install| replace:: To install the latest release of nMigen, run:
98 .. tab-container:: windows
103 .. code-block:: doscon
105 > pip install --upgrade nmigen[builtin-yosys]
107 .. tab-container:: macos
112 .. code-block:: console
114 $ pip install --upgrade nmigen[builtin-yosys]
116 .. tab-container:: linux
119 If you **did not** install Yosys manually in the :ref:`previous step <install-deps>`, to install the latest release of nMigen, run:
121 .. code-block:: console
123 $ pip3 install --upgrade nmigen[builtin-yosys]
125 If you **did** install Yosys manually in the previous step, run:
127 .. code-block:: console
129 $ pip3 install --upgrade nmigen
137 .. |snapshot:first-time| replace:: To install a development snapshot of nMigen for the first time, run:
138 .. |snapshot:update| replace:: Any changes made to the ``nmigen`` directory will immediately affect any code that uses nMigen. To update the snapshot, run:
139 .. |snapshot:reinstall| replace:: It is important to run the ``pip3 install --editable .[builtin-yosys]`` each time the development snapshot is updated in case package dependencies have been added or changed. Otherwise, code using nMigen may misbehave or crash with an ``ImportError``.
143 .. tab-container:: windows
146 |snapshot:first-time|
148 .. code-block:: doscon
150 > git clone https://github.com/nmigen/nmigen
152 > pip install --editable .[builtin-yosys]
156 .. code-block:: doscon
159 > git pull --ff-only origin master
160 > pip install --editable .[builtin-yosys]
164 .. tab-container:: macos
167 |snapshot:first-time|
169 .. code-block:: console
171 $ git clone https://github.com/nmigen/nmigen
173 $ pip install --editable .[builtin-yosys]
177 .. code-block:: console
180 $ git pull --ff-only origin master
181 $ pip install --editable .[builtin-yosys]
185 .. tab-container:: linux
188 If you have :ref:`previously <install-deps>` installed Yosys manually, omit ``[builtin-yosys]`` from the following commands.
190 |snapshot:first-time|
192 .. code-block:: console
194 $ git clone https://github.com/nmigen/nmigen
196 $ pip3 install --editable .[builtin-yosys]
200 .. code-block:: console
203 $ git pull --ff-only origin master
204 $ pip3 install --editable .[builtin-yosys]
209 Installing board definitions
210 =============================
214 Explain how to install `<https://github.com/nmigen/nmigen-boards>`_.