Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: amaranth-lang/amaranth-yosys
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1c42e094b670
Choose a base ref
...
head repository: amaranth-lang/amaranth-yosys
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 04d6043a1e73
Choose a head ref
  • 3 commits
  • 7 files changed
  • 1 contributor

Commits on Nov 5, 2021

  1. Copy the full SHA
    a3a1262 View commit details
  2. Simplify CI workflow.

    whitequark committed Nov 5, 2021
    Copy the full SHA
    b4e9125 View commit details

Commits on Dec 10, 2021

  1. Copy the full SHA
    04d6043 View commit details
Showing with 23 additions and 24 deletions.
  1. +5 −5 .github/workflows/main.yml
  2. +1 −1 .gitignore
  3. +4 −4 README.rst
  4. 0 {nmigen_yosys → amaranth_yosys}/__init__.py
  5. +1 −1 {nmigen_yosys → amaranth_yosys}/__main__.py
  6. +5 −5 build.sh
  7. +7 −8 setup.py
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools setuptools_scm wheel
python -m pip install setuptools_scm # for setup.py --version
sudo apt-get install flex bison ccache
- name: Set up ccache
uses: actions/cache@v1
@@ -26,16 +26,16 @@ jobs:
./build.sh
- name: Build binary wheels
run: |
python setup.py bdist_wheel
pip wheel -e . -w dist/
- name: Upload binary wheel artifact
uses: actions/upload-artifact@v2
with:
name: wheel
path: dist/
path: dist/amaranth_yosys-*.whl
- name: Test binary wheels
run: |
pip install dist/*.whl
python -m nmigen_yosys --help
pip install dist/amaranth_yosys-*.whl
python -m amaranth_yosys --help
upload_wheels:
needs: build
runs-on: ubuntu-latest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -10,4 +10,4 @@ __pycache__/
*.wasm

# Yosys
/nmigen_yosys/share
/amaranth_yosys/share
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
nMigen Yosys distribution
#########################
Amaranth Yosys distribution
###########################

`nMigen <https://github.com/nmigen/nmigen>`_ is a Python-based hardware description language that uses `Yosys <http://www.clifford.at/yosys>`_ as a backend to emit Verilog.
`Amaranth <https://github.com/amaranth/amaranth>`_ is a Python-based hardware description language that uses `Yosys <http://www.clifford.at/yosys>`_ as a backend to emit Verilog.

The nMigen Yosys wheels provide a specialized `WebAssembly <https://webassembly.org/>`_ based build of Yosys that runs via `wasmtime-py <https://github.com/bytecodealliance/wasmtime-py>`_ if there is no system-wide Yosys installation, or if that installation is too old. This build is aggressively optimized for binary size and startup latency, and only includes features required by nMigen's Verilog and CXXRTL backends; it is not useful for any other purpose.
The Amaranth HDL Yosys wheels provide a specialized `WebAssembly <https://webassembly.org/>`_ based build of Yosys that runs via `wasmtime-py <https://github.com/bytecodealliance/wasmtime-py>`_ if there is no system-wide Yosys installation, or if that installation is too old. This build is aggressively optimized for binary size and startup latency, and only includes features required by Amaranth's Verilog and CXXRTL backends; it is not useful for any other purpose.

Although this package is platform-independent, it depends on wasmtime-py wheels, which are currently available only for x86_64 Windows, Linux, and macOS. This is expected to improve in the future.

File renamed without changes.
2 changes: 1 addition & 1 deletion nmigen_yosys/__main__.py → amaranth_yosys/__main__.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
wasm_cfg.cache = True

wasi_cfg = wasmtime.WasiConfig()
wasi_cfg.argv = ("nmigen-yosys", *sys.argv[1:])
wasi_cfg.argv = ("amaranth-yosys", *sys.argv[1:])
wasi_cfg.preopen_dir(".", ".")
wasi_cfg.inherit_stdin()
wasi_cfg.inherit_stdout()
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ sed -e 's,new ezMiniSAT(),nullptr,' -i yosys-src/kernel/register.cc

YOSYS_PYPI_VER=$(python3 setup.py --version)
YOSYS_GIT_REV=$(git -C yosys-src rev-parse --short HEAD | tr -d '\n')
YOSYS_VER_STR='nMigen Yosys $(YOSYS_VER) '"(PyPI ver ${YOSYS_PYPI_VER}, git sha1 ${YOSYS_GIT_REV})"
YOSYS_VER_STR='Amaranth Yosys $(YOSYS_VER) '"(PyPI ver ${YOSYS_PYPI_VER}, git sha1 ${YOSYS_GIT_REV})"
YOSYS_OBJS="\
kernel/version_${YOSYS_GIT_REV}.cc \
kernel/driver.o \
@@ -101,7 +101,7 @@ backends/verilog/verilog_backend.o \
"
make -C yosys-src GIT_REV="${YOSYS_GIT_REV}" YOSYS_VER_STR="${YOSYS_VER_STR}" OBJS="${YOSYS_OBJS}" PRETTY=0 CXX="ccache clang"

cp yosys-src/yosys.wasm nmigen_yosys/
rm -rf nmigen_yosys/share
mkdir -p nmigen_yosys/share/include/backends/cxxrtl
cp yosys-src/share/include/backends/cxxrtl/* nmigen_yosys/share/include/backends/cxxrtl/
cp yosys-src/yosys.wasm amaranth_yosys/
rm -rf amaranth_yosys/share
mkdir -p amaranth_yosys/share/include/backends/cxxrtl
cp yosys-src/share/include/backends/cxxrtl/* amaranth_yosys/share/include/backends/cxxrtl/
15 changes: 7 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -26,24 +26,23 @@ def long_description():


setup(
name="nmigen-yosys",
name="amaranth-yosys",
version=version(),
author="whitequark",
author_email="whitequark@whitequark.org",
description="Specialized WebAssembly build of Yosys used by nMigen",
description="Specialized WebAssembly build of Yosys used by Amaranth HDL",
long_description=long_description(),
license="ISC", # same as Yosys
python_requires="~=3.5",
setup_requires=["setuptools_scm", "wheel"],
install_requires=[
"importlib_resources>=1.4; python_version<'3.7'",
"importlib_resources>=1.4; python_version<'3.9'",
"wasmtime>=0.30,<0.31"
],
packages=["nmigen_yosys"],
package_data={"nmigen_yosys": ["yosys.wasm", "share/**/**/**/*"]},
packages=["amaranth_yosys"],
package_data={"amaranth_yosys": ["yosys.wasm", "share/**/**/**/*"]},
project_urls={
"Source Code": "https://github.com/nmigen/nmigen-yosys",
"Bug Tracker": "https://github.com/nmigen/nmigen-yosys/issues",
"Source Code": "https://github.com/amaranth-lang/amaranth-yosys",
"Bug Tracker": "https://github.com/amaranth-lang/amaranth-yosys/issues",
},
classifiers=[
"License :: OSI Approved :: ISC License (ISCL)",