From fe684e8733a19bd5ebfd717924c35ccf9a4af839 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 3 Dec 2019 19:12:18 -0500 Subject: [PATCH] Allow redefining VL_PRINTF, bug1598. --- docs/CONTRIBUTORS | 1 + include/verilated.h | 5 +++++ include/verilated.mk.in | 1 - test_regress/t/t_dpi_display_c.cpp | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index d29ca10dc..9219c33fa 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -14,6 +14,7 @@ Howard Su Iztok Jeras Jeremy Bennett John Coiner +Julien Margetts Kanad Kanhere Kevin Kiningham Lukasz Dalek diff --git a/include/verilated.h b/include/verilated.h index 2864dfa0c..db0ba9b44 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -44,6 +44,11 @@ # include #endif +// Allow user to specify their own include file +#ifdef VL_VERILATED_INCLUDE +# include VL_VERILATED_INCLUDE +#endif + //============================================================================= // Switches diff --git a/include/verilated.mk.in b/include/verilated.mk.in index 04ce99804..612474582 100644 --- a/include/verilated.mk.in +++ b/include/verilated.mk.in @@ -48,7 +48,6 @@ VK_CPPFLAGS_ALWAYS += \ -MMD \ -I$(VERILATOR_ROOT)/include \ -I$(VERILATOR_ROOT)/include/vltstd \ - -DVL_PRINTF=printf \ -DVM_COVERAGE=$(VM_COVERAGE) \ -DVM_SC=$(VM_SC) \ -DVM_TRACE=$(VM_TRACE) \ diff --git a/test_regress/t/t_dpi_display_c.cpp b/test_regress/t/t_dpi_display_c.cpp index c49a8f9b4..8a38689fc 100644 --- a/test_regress/t/t_dpi_display_c.cpp +++ b/test_regress/t/t_dpi_display_c.cpp @@ -35,6 +35,10 @@ extern "C" { } #endif +#ifndef VL_PRINTF +# define VL_PRINTF printf +#endif + //====================================================================== void dpii_display_call(const char* c) {