Fix constant propagation across DPI imports of inout strings.

This commit is contained in:
Wilson Snyder
2017-12-07 20:10:27 -05:00
parent 662ebece71
commit b11fa372b1
3 changed files with 9 additions and 1 deletions
+2
View File
@@ -12,6 +12,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
**** Fix false ALWCOMBORDER on interface references, bug1247. [Josh Redford]
**** Fix constant propagation across DPI imports of inout strings. [Victor Besyakov]
* Verilator 3.916 2017-11-25
+6
View File
@@ -386,6 +386,9 @@ private:
pinp->v3error("Function/task output connected to constant instead of variable: "+portp->prettyName());
}
else if (portp->isInout()) {
// Correct lvalue; see comments below
V3LinkLValue::linkLValueSet(pinp);
if (AstVarRef* varrefp = pinp->castVarRef()) {
// Connect to this exact variable
AstVarScope* localVscp = varrefp->varScopep(); if (!localVscp) varrefp->v3fatalSrc("Null var scope");
@@ -489,6 +492,9 @@ private:
pinp->v3error("Function/task output connected to constant instead of variable: "+portp->prettyName());
}
else if (portp->isInout()) {
// Correct lvalue; see comments below
V3LinkLValue::linkLValueSet(pinp);
if (pinp->castVarRef()) {
// Connect to this exact variable
} else {
+1 -1
View File
@@ -59,7 +59,7 @@ module t (/*AUTOARG*/
import "DPI-C" pure function void dpii_v_struct (input str_t i, output str_t o);
import "DPI-C" pure function void dpii_v_substruct(input substr_t i, output int o);
import "DPI-C" pure function void dpii_v_chandle (input chandle i, output chandle o);
import "DPI-C" pure function void dpii_v_string (input string i, output string o);
import "DPI-C" pure function void dpii_v_string (input string i, inout string o);
import "DPI-C" pure function void dpii_v_real (input real i, output real o);
import "DPI-C" pure function void dpii_v_uint (input int unsigned i, output int unsigned o);