DPI: Fix imports from unit level

This commit is contained in:
Wilson Snyder 2009-12-04 07:41:18 -05:00
parent 5a9309de78
commit a3c1724d17
2 changed files with 5 additions and 3 deletions

View File

@ -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*) {

View File

@ -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."