diff --git a/tgt-vlog95/scope.c b/tgt-vlog95/scope.c index 1e51da7e0..c005d770a 100644 --- a/tgt-vlog95/scope.c +++ b/tgt-vlog95/scope.c @@ -995,12 +995,6 @@ int emit_scope(ivl_scope_t scope, ivl_scope_t parent) unsigned is_auto = ivl_scope_is_auto(scope); unsigned idx; - // Convert SV void functions with no arguments to tasks. This may - // lead to errors if the function is called from another function, - // but there is no way to translate that case. - if (is_void_function(scope) && (ivl_scope_ports(scope) == 1)) - sc_type = IVL_SCT_TASK; - /* Output the scope definition. */ switch (sc_type) { case IVL_SCT_MODULE: diff --git a/tgt-vlog95/stmt.c b/tgt-vlog95/stmt.c index fb2c54428..3107baffa 100644 --- a/tgt-vlog95/stmt.c +++ b/tgt-vlog95/stmt.c @@ -1433,7 +1433,11 @@ static void emit_stmt_utask(ivl_scope_t scope, ivl_statement_t stmt) || (is_void_function(task_scope) && ivl_scope_ports(task_scope) == 1)); fprintf(vlog_out, "%*c", get_indent(), ' '); + if (is_void_function(task_scope)) + fprintf(vlog_out, "if ("); emit_scope_path(scope, task_scope); + if (is_void_function(task_scope)) + fprintf(vlog_out, "(1'bx))"); fprintf(vlog_out, ";"); emit_stmt_file_line(stmt); fprintf(vlog_out, "\n");