1 // -*- mode: C++; c-file-style: "cc-mode" -*- 2 // 3 // DESCRIPTION: Verilator: Verilog Test module 4 // 5 // Copyright 2009 by Wilson Snyder. This program is free software; you can 6 // redistribute it and/or modify it under the terms of either the GNU 7 // Lesser General Public License Version 3 or the Perl Artistic License 8 // Version 2.0. 9 // SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 10 //************************************************************************* 11 12 #include <cstdio> 13 #include <cstring> 14 #include "svdpi.h" 15 16 //====================================================================== 17 18 // clang-format off 19 #if defined(VERILATOR) 20 # include "Vt_dpi_imp_gen__Dpi.h" 21 #elif defined(VCS) 22 # include "../vc_hdrs.h" 23 #elif defined(CADENCE) 24 # define NEED_EXTERNS 25 #else 26 # error "Unknown simulator for DPI test" 27 #endif 28 // clang-format on 29 30 #ifdef NEED_EXTERNS 31 extern "C" { 32 extern void dpi_genvarTest(); 33 } 34 #endif 35 36 //====================================================================== 37 38 // Called from our Verilog code to run the tests dpi_genvarTest()39void dpi_genvarTest() { 40 const char* scopeName = svGetNameFromScope(svGetScope()); 41 printf("scope name : %s\n", scopeName); 42 } 43