diff --git a/sv_vpi_user.h b/sv_vpi_user.h index 1282e0ee2..47a5a4296 100644 --- a/sv_vpi_user.h +++ b/sv_vpi_user.h @@ -72,6 +72,9 @@ EXTERN_C_START /********* Many-to-One ***********/ #define vpiMember 742 +/********* task/function properties **********/ +#define vpiOtherFunc 6 + EXTERN_C_END #endif /* SV_VPI_USER_H */ diff --git a/t-dll.cc b/t-dll.cc index 067826466..93564e854 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -603,12 +603,19 @@ static void fill_in_scope_function(ivl_scope_t scope, const NetScope*net) assert(def); const NetNet*return_sig = def->return_sig(); - assert(return_sig); + if (return_sig == 0) { + // Special case: If there is no return signal, this is + // apparently a VOID function. + scope->func_type = IVL_VT_VOID; + scope->func_signed = 0; + scope->func_width = 0; + } else { + scope->func_type = return_sig->data_type(); + scope->func_signed = return_sig->get_signed(); + scope->func_width = return_sig->vector_width(); + } scope->tname_ = def->scope()->basename(); - scope->func_type = return_sig->data_type(); - scope->func_signed = return_sig->get_signed(); - scope->func_width = return_sig->vector_width(); } void dll_target::add_root(const NetScope *s) diff --git a/tgt-vvp/stmt_assign.c b/tgt-vvp/stmt_assign.c index c0f4032de..05ce5021a 100644 --- a/tgt-vvp/stmt_assign.c +++ b/tgt-vvp/stmt_assign.c @@ -445,7 +445,7 @@ static void store_vec4_to_lval(ivl_statement_t net) member. We will use a property assign function. */ assert(!lsig); - assert(!signal_is_return_value(lsig)); + ivl_type_t sub_type = draw_lval_expr(nest); assert(ivl_type_base(sub_type) == IVL_VT_CLASS); fprintf(vvp_out, " %%store/prop/v %d, %u;\n", diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index 0c9850878..43a2144c0 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -2271,7 +2271,8 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent) snprintf(suffix, sizeof suffix, ".obj"); break; case IVL_VT_VOID: - assert(0); + snprintf(suffix, sizeof suffix, ".void"); + break; default: assert(0); break; diff --git a/vvp/vpi_scope.cc b/vvp/vpi_scope.cc index 2cc862a34..8f0ed1ade 100644 --- a/vvp/vpi_scope.cc +++ b/vvp/vpi_scope.cc @@ -506,9 +506,13 @@ compile_scope_decl(char*label, char*type, char*name, char*tname, } else if (strcmp(type,"autofunction.real") == 0) { scope = new vpiScopeFunction(name, tname, true, vpiRealFunc, 0); } else if (strcmp(type,"function.str") == 0) { - scope = new vpiScopeFunction(name, tname, false, vpiSizedFunc, 0); + scope = new vpiScopeFunction(name, tname, false, vpiOtherFunc, 0); } else if (strcmp(type,"autofunction.str") == 0) { - scope = new vpiScopeFunction(name, tname, true, vpiSizedFunc, 0); + scope = new vpiScopeFunction(name, tname, true, vpiOtherFunc, 0); + } else if (strcmp(type,"function.void") == 0) { + scope = new vpiScopeFunction(name, tname, false, vpiOtherFunc, 0); + } else if (strcmp(type,"autofunction.void") == 0) { + scope = new vpiScopeFunction(name, tname, true, vpiOtherFunc, 0); } else if (strcmp(type,"task") == 0) { scope = new vpiScopeTask(name, tname); } else if (strcmp(type,"autotask") == 0) {