6 # On Windows, manually setting absolute path to Python binary may be required
7 # for launcher executable to work. From MSYS2, this can be done using the
8 # following command: "which python3 | cygpath -w -m -f -".
9 ifeq ($(OS
), Windows_NT
)
10 PYTHON
= $(shell cygpath
-w
-m
$(PREFIX
)/bin
/python3
)
13 .PHONY
: help
install ci
test html
clean
17 @echo
"sudo make install"
18 @echo
" build and install SymbiYosys (sby)"
21 @echo
" build documentation in docs/build/html/"
27 @echo
" run tests and check examples"
28 @echo
" note: this requires a full Tabby CAD Suite or OSS CAD Suite install"
35 mkdir
-p
$(DESTDIR
)$(PREFIX
)/bin
36 mkdir
-p
$(DESTDIR
)$(PREFIX
)/share
/yosys
/python3
37 cp sbysrc
/sby_
*.py
$(DESTDIR
)$(PREFIX
)/share
/yosys
/python3
/
38 sed
-e
's|##yosys-program-prefix##|"'$(PROGRAM_PREFIX
)'"|' < sbysrc
/sby_core.py
> $(DESTDIR
)$(PREFIX
)/share
/yosys
/python3
/sby_core.py
39 ifeq ($(OS
), Windows_NT
)
40 sed
-e
's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' \
41 -e
"s|#!/usr/bin/env python3|#!$(PYTHON)|" < sbysrc
/sby.py
> $(DESTDIR
)$(PREFIX
)/bin
/sby-script.py
42 gcc
-DGUI
=0 -O
-s
-o
$(DESTDIR
)$(PREFIX
)/bin
/sby.exe extern
/launcher.c
44 sed
's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' < sbysrc
/sby.py
> $(DESTDIR
)$(PREFIX
)/bin
/sby
45 chmod
+x
$(DESTDIR
)$(PREFIX
)/bin
/sby
48 .PHONY
: check_cad_suite run_ci
54 test_demo1 test_demo2 test_demo3 \
55 test_abstract_abstr test_abstract_props \
56 test_demos_fib_cover test_demos_fib_prove test_demos_fib_live \
58 test_puzzles_djb2hash test_puzzles_pour853to4 test_puzzles_wolfgoatcabbage \
59 test_puzzles_primegen_primegen test_puzzles_primegen_primes_pass test_puzzles_primegen_primes_fail \
60 test_quickstart_demo test_quickstart_cover test_quickstart_prove test_quickstart_memory \
62 if yosys
-qp
'read -verific' 2> /dev
/null
; then set
-x
; \
63 YOSYS_NOVERIFIC
=1 $(MAKE
) run_ci
; \
67 @if
! which tabbypip
>/dev
/null
2>&1; then \
68 echo
"'make ci' requries the Tabby CAD Suite or the OSS CAD Suite"; \
69 echo
"try 'make test' instead or run 'make run_ci' to proceed anyway."; \
74 cd sbysrc
&& python3 sby.py
-f demo1.sby
77 cd sbysrc
&& python3 sby.py
-f demo2.sby
80 cd sbysrc
&& python3 sby.py
-f demo3.sby
83 @if yosys
-qp
'read -verific' 2> /dev
/null
; then set
-x
; \
84 cd docs
/examples
/abstract
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f abstr.sby
; \
85 else echo
"skipping $@"; fi
88 if yosys
-qp
'read -verific' 2> /dev
/null
; then set
-x
; \
89 cd docs
/examples
/abstract
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f props.sby
; \
90 else echo
"skipping $@"; fi
93 cd docs
/examples
/demos
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f fib.sby cover
96 cd docs
/examples
/demos
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f fib.sby prove
99 cd docs
/examples
/demos
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f fib.sby live
102 cd docs
/examples
/multiclk
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f dpmem.sby
104 test_puzzles_djb2hash
:
105 cd docs
/examples
/puzzles
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f djb2hash.sby
107 test_puzzles_pour853to4
:
108 cd docs
/examples
/puzzles
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f pour_853_to_4.sby
110 test_puzzles_wolfgoatcabbage
:
111 cd docs
/examples
/puzzles
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f wolf_goat_cabbage.sby
113 test_puzzles_primegen_primegen
:
114 cd docs
/examples
/puzzles
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f primegen.sby primegen
116 test_puzzles_primegen_primes_pass
:
117 cd docs
/examples
/puzzles
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f primegen.sby primes_pass
119 test_puzzles_primegen_primes_fail
:
120 cd docs
/examples
/puzzles
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f primegen.sby primes_fail
122 test_quickstart_demo
:
123 cd docs
/examples
/quickstart
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f demo.sby
125 test_quickstart_cover
:
126 cd docs
/examples
/quickstart
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f cover.sby
128 test_quickstart_prove
:
129 cd docs
/examples
/quickstart
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f prove.sby
131 test_quickstart_memory
:
132 cd docs
/examples
/quickstart
&& python3 ..
/..
/..
/sbysrc
/sby.py
-f memory.sby
135 $(MAKE
) -C tests
test
141 $(MAKE
) -C docs
clean
142 rm -rf docs
/build sbysrc
/sby sbysrc
/__pycache__