Minor improvements to DPI open array handling (#2316)

- Allow arbitrary number of open array dimensions, not just 3. Note
right now this only works with the array querying functions specified
in IEEE 1800-2017 H.12.2
- Issue error when passing dynamic array or queue as DPI open array
(currently unsupported)
- Also tweaked AstVar::vlArgTypeRecurse, which should now error or fail
for unsupported types.
This commit is contained in:
Geza Lore
2020-05-08 18:22:44 +01:00
committed by GitHub
parent 27953e26b6
commit ac09ad3ffd
8 changed files with 560 additions and 181 deletions
+7 -2
View File
@@ -875,12 +875,17 @@ private:
if (args != "") args += ", ";
if (portp->isDpiOpenArray()) {
AstNodeDType* dtypep = portp->dtypep()->skipRefp();
if (VN_IS(dtypep, DynArrayDType) || VN_IS(dtypep, QueueDType)) {
v3fatalSrc("Passing dynamic array or queue as actual argument to DPI "
"open array is not yet supported");
}
// Ideally we'd make a table of variable
// characteristics, and reuse it wherever we can
// At least put them into the module's CTOR as static?
string propName = portp->name() + "__Vopenprops";
string propCode = ("static const VerilatedVarProps " + propName + "("
+ portp->vlPropInit() + ");\n");
string propCode = portp->vlPropDecl(propName);
cfuncp->addStmtsp(new AstCStmt(portp->fileline(), propCode));
//
// At runtime we need the svOpenArrayHandle to