From 9558e14479d4d291b68a9d08eb55997ddb6bbaca Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 12 May 2011 06:59:13 -0400 Subject: [PATCH] Fix DPI undeclared svBitVecVal compile error, bug346. Additional change. --- src/V3EmitC.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 3c325dd1c..19cee0ea9 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -1619,7 +1619,12 @@ void EmitCImp::emitInt(AstNodeModule* modp) { if (v3Global.needHInlines()) { // Set by V3EmitCInlines; should have been called before us puts("#include \""+topClassName()+"__Inlines.h\"\n"); } - // No __Dpi.h needed, we've shimmed it all into the interface + if (v3Global.dpi()) { + // do this before including our main .h file so that any references to + // types defined in svdpi.h are available + puts("#include \""+ topClassName() +"__Dpi.h\"\n"); + puts("\n"); + } // Declare foreign instances up front to make C++ happy puts("class "+symClassName()+";\n"); @@ -1792,12 +1797,6 @@ void EmitCImp::emitImp(AstNodeModule* modp) { puts("//############################################################\n"); puts("#sp implementation\n"); } - if (v3Global.dpi()) { - // do this before including our main .h file so that any references to - // types defined in svdpi.h are available - puts("#include \""+ topClassName() +"__Dpi.h\"\n"); - puts("\n"); - } ofp()->printf("#include \"%-20s // For This\n", (modClassName(modp)+".h\"").c_str());