Handle void functions with new .scope format.
This commit is contained in:
parent
fac7de2133
commit
c114edfa6c
|
|
@ -72,6 +72,9 @@ EXTERN_C_START
|
||||||
/********* Many-to-One ***********/
|
/********* Many-to-One ***********/
|
||||||
#define vpiMember 742
|
#define vpiMember 742
|
||||||
|
|
||||||
|
/********* task/function properties **********/
|
||||||
|
#define vpiOtherFunc 6
|
||||||
|
|
||||||
EXTERN_C_END
|
EXTERN_C_END
|
||||||
|
|
||||||
#endif /* SV_VPI_USER_H */
|
#endif /* SV_VPI_USER_H */
|
||||||
|
|
|
||||||
13
t-dll.cc
13
t-dll.cc
|
|
@ -603,12 +603,19 @@ static void fill_in_scope_function(ivl_scope_t scope, const NetScope*net)
|
||||||
assert(def);
|
assert(def);
|
||||||
|
|
||||||
const NetNet*return_sig = def->return_sig();
|
const NetNet*return_sig = def->return_sig();
|
||||||
assert(return_sig);
|
if (return_sig == 0) {
|
||||||
|
// Special case: If there is no return signal, this is
|
||||||
scope->tname_ = def->scope()->basename();
|
// 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_type = return_sig->data_type();
|
||||||
scope->func_signed = return_sig->get_signed();
|
scope->func_signed = return_sig->get_signed();
|
||||||
scope->func_width = return_sig->vector_width();
|
scope->func_width = return_sig->vector_width();
|
||||||
|
}
|
||||||
|
|
||||||
|
scope->tname_ = def->scope()->basename();
|
||||||
}
|
}
|
||||||
|
|
||||||
void dll_target::add_root(const NetScope *s)
|
void dll_target::add_root(const NetScope *s)
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,7 @@ static void store_vec4_to_lval(ivl_statement_t net)
|
||||||
member. We will use a property assign
|
member. We will use a property assign
|
||||||
function. */
|
function. */
|
||||||
assert(!lsig);
|
assert(!lsig);
|
||||||
assert(!signal_is_return_value(lsig));
|
|
||||||
ivl_type_t sub_type = draw_lval_expr(nest);
|
ivl_type_t sub_type = draw_lval_expr(nest);
|
||||||
assert(ivl_type_base(sub_type) == IVL_VT_CLASS);
|
assert(ivl_type_base(sub_type) == IVL_VT_CLASS);
|
||||||
fprintf(vvp_out, " %%store/prop/v %d, %u;\n",
|
fprintf(vvp_out, " %%store/prop/v %d, %u;\n",
|
||||||
|
|
|
||||||
|
|
@ -2271,7 +2271,8 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
|
||||||
snprintf(suffix, sizeof suffix, ".obj");
|
snprintf(suffix, sizeof suffix, ".obj");
|
||||||
break;
|
break;
|
||||||
case IVL_VT_VOID:
|
case IVL_VT_VOID:
|
||||||
assert(0);
|
snprintf(suffix, sizeof suffix, ".void");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -506,9 +506,13 @@ compile_scope_decl(char*label, char*type, char*name, char*tname,
|
||||||
} else if (strcmp(type,"autofunction.real") == 0) {
|
} else if (strcmp(type,"autofunction.real") == 0) {
|
||||||
scope = new vpiScopeFunction(name, tname, true, vpiRealFunc, 0);
|
scope = new vpiScopeFunction(name, tname, true, vpiRealFunc, 0);
|
||||||
} else if (strcmp(type,"function.str") == 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) {
|
} 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) {
|
} else if (strcmp(type,"task") == 0) {
|
||||||
scope = new vpiScopeTask(name, tname);
|
scope = new vpiScopeTask(name, tname);
|
||||||
} else if (strcmp(type,"autotask") == 0) {
|
} else if (strcmp(type,"autotask") == 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue