diff --git a/utest.scm b/utest.scm index c8a2217..7de508b 100755 --- a/utest.scm +++ b/utest.scm @@ -528,6 +528,24 @@ ((find (lambda (x) (string-prefix? sim-warn-prefix x)) log) 'warning) (else #t)))) +;;; +;;; Return list of UTEST_* defines +;;; +(define (utest-verilog-defines) + (append + `((UTEST_BASE_DIR ,(format "'\"~a\"'" (utest/base-path))) + (UTEST_WORK_DIR ,(format "'\"~a\"'" (utest/work-path)))) + + (fold (lambda (x l) + (if (car x) + (append l (cdr x)) + l)) + '() + `((,(utest/verbose) UTEST_VERBOSE) + (,(utest/force-dump) UTEST_FORCE_DUMP) + (,(utest/keep-output) UTEST_KEEP_OUTPUT) + (,(utest/restart-dump) UTEST_RESTART_DUMP))))) + ;;; ;;; Run compile and simulation with Icarus Verilog ;;; @@ -564,11 +582,7 @@ (let ((sources (append (map (lambda (x) (path->absolute x base-path)) (arg-to-list sources)) (list timeout-module dump-module))) - - (defines (append defines - `((UTEST_BASE_DIR ,(format "'\"~a\"'" base-path)) - (UTEST_WORK_DIR ,(format "'\"~a\"'" work-path))))) - + (defines (append defines (utest-verilog-defines))) (includes (append (map (lambda (x) (path->absolute x base-path)) (arg-to-list includes)) (list base-path)))