mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
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:
+7
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user