mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-05 15:06:11 +00:00
Add VERBOSE (and V) option to Makefiles
This commit is contained in:
parent
90ead9bbc2
commit
2bab5d3fa5
2 changed files with 11 additions and 5 deletions
|
|
@ -28,6 +28,12 @@ export YOSYS_MAX_THREADS
|
||||||
export LLVM_PROFILE_FILE
|
export LLVM_PROFILE_FILE
|
||||||
export LLVM_PROFILE_FILE_BUFFER_SIZE=0
|
export LLVM_PROFILE_FILE_BUFFER_SIZE=0
|
||||||
|
|
||||||
|
ifeq ($(or $(V),$(VERBOSE)),1)
|
||||||
|
QUIET :=
|
||||||
|
else
|
||||||
|
QUIET := >/dev/null 2>&1
|
||||||
|
endif
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
||||||
ifndef OVERRIDE_MAIN
|
ifndef OVERRIDE_MAIN
|
||||||
|
|
@ -38,7 +44,7 @@ endif
|
||||||
define run_test
|
define run_test
|
||||||
@set -e; \
|
@set -e; \
|
||||||
rc=0; \
|
rc=0; \
|
||||||
( set -e; $(2) ) >/dev/null 2>&1 || rc=$$?; \
|
( set -e; $(2) ) $(QUIET) || rc=$$?; \
|
||||||
if [ $$rc -eq 0 ]; then \
|
if [ $$rc -eq 0 ]; then \
|
||||||
echo "PASS $1"; \
|
echo "PASS $1"; \
|
||||||
echo PASS > $1.result; \
|
echo PASS > $1.result; \
|
||||||
|
|
|
||||||
|
|
@ -26,27 +26,27 @@ def generate_target(name, command, deps = None):
|
||||||
print(f"\t@$(call run_test,{target}, $({target}_cmd))")
|
print(f"\t@$(call run_test,{target}, $({target}_cmd))")
|
||||||
|
|
||||||
def generate_ys_test(ys_file, yosys_args="", commands=""):
|
def generate_ys_test(ys_file, yosys_args="", commands=""):
|
||||||
cmd = f'$(YOSYS) -ql {ys_file}.err {yosys_args} {ys_file} && mv {ys_file}.err {ys_file}.log'
|
cmd = f'$(YOSYS) -l {ys_file}.err {yosys_args} {ys_file} && mv {ys_file}.err {ys_file}.log'
|
||||||
if commands:
|
if commands:
|
||||||
cmd += f"; \\\n{commands}"
|
cmd += f"; \\\n{commands}"
|
||||||
generate_target(ys_file, cmd)
|
generate_target(ys_file, cmd)
|
||||||
|
|
||||||
def generate_tcl_test(tcl_file, yosys_args="", commands=""):
|
def generate_tcl_test(tcl_file, yosys_args="", commands=""):
|
||||||
cmd = f'$(YOSYS) -ql {tcl_file}.err {yosys_args} {tcl_file} && mv {tcl_file}.err {tcl_file}.log'
|
cmd = f'$(YOSYS) -l {tcl_file}.err {yosys_args} {tcl_file} && mv {tcl_file}.err {tcl_file}.log'
|
||||||
if commands:
|
if commands:
|
||||||
cmd += f"; \\\n{commands}"
|
cmd += f"; \\\n{commands}"
|
||||||
generate_target(tcl_file, cmd)
|
generate_target(tcl_file, cmd)
|
||||||
|
|
||||||
def generate_sv_check(sv_file, yosys_args="", yosys_cmds=""):
|
def generate_sv_check(sv_file, yosys_args="", yosys_cmds=""):
|
||||||
yosys_cmd = f'read -sv {sv_file}; {yosys_cmds}'
|
yosys_cmd = f'read -sv {sv_file}; {yosys_cmds}'
|
||||||
cmd = f'$(YOSYS) -ql {sv_file}.err -p "{yosys_cmd}" {yosys_args} && mv {sv_file}.err {sv_file}.log'
|
cmd = f'$(YOSYS) -l {sv_file}.err -p "{yosys_cmd}" {yosys_args} && mv {sv_file}.err {sv_file}.log'
|
||||||
generate_target(sv_file, cmd)
|
generate_target(sv_file, cmd)
|
||||||
|
|
||||||
def generate_sv_test(sv_file, yosys_args="", commands=""):
|
def generate_sv_test(sv_file, yosys_args="", commands=""):
|
||||||
base = os.path.splitext(sv_file)[0]
|
base = os.path.splitext(sv_file)[0]
|
||||||
if not os.path.exists(base + ".ys"):
|
if not os.path.exists(base + ".ys"):
|
||||||
yosys_cmd = '-p "prep -top top; async2sync; sat -enable_undef -verify -prove-asserts"'
|
yosys_cmd = '-p "prep -top top; async2sync; sat -enable_undef -verify -prove-asserts"'
|
||||||
cmd = f'$(YOSYS) -ql {sv_file}.err {yosys_cmd} {yosys_args} {sv_file} && mv {sv_file}.err {sv_file}.log'
|
cmd = f'$(YOSYS) -l {sv_file}.err {yosys_cmd} {yosys_args} {sv_file} && mv {sv_file}.err {sv_file}.log'
|
||||||
if commands:
|
if commands:
|
||||||
cmd += f"; \\\n{commands}"
|
cmd += f"; \\\n{commands}"
|
||||||
generate_target(sv_file, cmd)
|
generate_target(sv_file, cmd)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue