mirror of
https://github.com/YosysHQ/yosys
synced 2026-06-02 23:28:00 +00:00
Merge pull request #5481 from YosysHQ/micko/pyosys_ci
Build pyosys on CI
This commit is contained in:
commit
b91dbc7324
3 changed files with 42 additions and 4 deletions
39
.github/workflows/test-verific.yml
vendored
39
.github/workflows/test-verific.yml
vendored
|
|
@ -83,3 +83,42 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make -j$procs unit-test ENABLE_LTO=1 ENABLE_LIBYOSYS=1
|
make -j$procs unit-test ENABLE_LTO=1 ENABLE_LIBYOSYS=1
|
||||||
|
|
||||||
|
test-pyosys:
|
||||||
|
needs: pre-job
|
||||||
|
if: ${{ needs.pre-job.outputs.should_skip != 'true' && github.repository == 'YosysHQ/Yosys' }}
|
||||||
|
runs-on: [self-hosted, linux, x64, fast]
|
||||||
|
steps:
|
||||||
|
- name: Checkout Yosys
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
submodules: true
|
||||||
|
- name: Install UV
|
||||||
|
run: |
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
- name: Runtime environment
|
||||||
|
run: |
|
||||||
|
echo "procs=$(nproc)" >> $GITHUB_ENV
|
||||||
|
echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Build pyosys
|
||||||
|
run: |
|
||||||
|
make config-clang
|
||||||
|
echo "ENABLE_VERIFIC := 1" >> Makefile.conf
|
||||||
|
echo "ENABLE_VERIFIC_EDIF := 1" >> Makefile.conf
|
||||||
|
echo "ENABLE_VERIFIC_LIBERTY := 1" >> Makefile.conf
|
||||||
|
echo "ENABLE_VERIFIC_YOSYSHQ_EXTENSIONS := 1" >> Makefile.conf
|
||||||
|
echo "ENABLE_CCACHE := 1" >> Makefile.conf
|
||||||
|
echo "ENABLE_PYOSYS := 1" >> Makefile.conf
|
||||||
|
echo "PYTHON_DESTDIR := /usr/lib/python3/site-packages" >> Makefile.conf
|
||||||
|
make -j$procs
|
||||||
|
|
||||||
|
- name: Install pyosys
|
||||||
|
run: |
|
||||||
|
make install DESTDIR=${GITHUB_WORKSPACE}/.local PREFIX=
|
||||||
|
|
||||||
|
- name: Run pyosys tests
|
||||||
|
run: |
|
||||||
|
export PYTHONPATH=${GITHUB_WORKSPACE}/.local/usr/lib/python3/site-packages:$PYTHONPATH
|
||||||
|
python3 tests/pyosys/run_tests.py
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -1040,7 +1040,7 @@ ifeq ($(ENABLE_LIBYOSYS),1)
|
||||||
if [ -n "$(STRIP)" ]; then $(INSTALL_SUDO) $(STRIP) -S $(DESTDIR)$(LIBDIR)/libyosys.so; fi
|
if [ -n "$(STRIP)" ]; then $(INSTALL_SUDO) $(STRIP) -S $(DESTDIR)$(LIBDIR)/libyosys.so; fi
|
||||||
ifeq ($(ENABLE_PYOSYS),1)
|
ifeq ($(ENABLE_PYOSYS),1)
|
||||||
$(INSTALL_SUDO) mkdir -p $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
|
$(INSTALL_SUDO) mkdir -p $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
|
||||||
$(INSTALL_SUDO) cp pyosys/__init__.py $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/__init__.py
|
$(INSTALL_SUDO) cp $(YOSYS_SRC)/pyosys/__init__.py $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/__init__.py
|
||||||
$(INSTALL_SUDO) cp libyosys.so $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/libyosys.so
|
$(INSTALL_SUDO) cp libyosys.so $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys/libyosys.so
|
||||||
$(INSTALL_SUDO) cp -r share $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
|
$(INSTALL_SUDO) cp -r share $(DESTDIR)$(PYTHON_DESTDIR)/$(subst -,_,$(PROGRAM_PREFIX))pyosys
|
||||||
ifeq ($(ENABLE_ABC),1)
|
ifeq ($(ENABLE_ABC),1)
|
||||||
|
|
|
||||||
|
|
@ -168,9 +168,8 @@ pyosys_headers = [
|
||||||
"global_negative_id_prefix_storage_",
|
"global_negative_id_prefix_storage_",
|
||||||
"global_refcount_storage_",
|
"global_refcount_storage_",
|
||||||
"global_free_idx_list_",
|
"global_free_idx_list_",
|
||||||
"last_created_idx_ptr_",
|
|
||||||
"last_created_idx_",
|
|
||||||
"builtin_ff_cell_types",
|
"builtin_ff_cell_types",
|
||||||
|
"substrings",
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -455,7 +454,7 @@ class PyosysWrapperGenerator(object):
|
||||||
) -> str:
|
) -> str:
|
||||||
is_method = isinstance(function, Method)
|
is_method = isinstance(function, Method)
|
||||||
function_return_type = function.return_type.format()
|
function_return_type = function.return_type.format()
|
||||||
if class_basename == "Const" and function_return_type in {
|
if class_basename in {"Const","IdString"} and function_return_type in {
|
||||||
"iterator",
|
"iterator",
|
||||||
"const_iterator",
|
"const_iterator",
|
||||||
}:
|
}:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue