diff --git a/src/V3Name.cpp b/src/V3Name.cpp index 85296175e..f16bba04d 100644 --- a/src/V3Name.cpp +++ b/src/V3Name.cpp @@ -87,6 +87,7 @@ private: // Don't iterate... Don't need temps for RANGES under the Var. rename(nodep, (!m_modp->isTop() && !nodep->isSigPublic() + && !nodep->isFuncLocal() // Isn't exposed, and would mess up dpi import wrappers && !nodep->isTemp())); // Don't bother to rename internal signals } virtual void visit(AstCFunc* nodep, AstNUser*) { diff --git a/test_regress/t/t_dpi_sys.v b/test_regress/t/t_dpi_sys.v index baecb8a02..3321b2f8e 100644 --- a/test_regress/t/t_dpi_sys.v +++ b/test_regress/t/t_dpi_sys.v @@ -5,10 +5,11 @@ // Lesser General Public License Version 3 or the Perl Artistic License // Version 2.0. -module t (); +// Global is the most likely usage scenario +import "DPI-C" dpii_sys_task = function void \$dpii_sys (integer i); +import "DPI-C" dpii_sys_func = function int \$dpii_func (integer i); - import "DPI-C" dpii_sys_task = function void \$dpii_sys (integer i); - import "DPI-C" dpii_sys_func = function int \$dpii_func (integer i); +module t (); `ifndef verilator `error "Only Verilator supports PLI-ish DPI calls."