From fac7de2133e23e5c5109fce11ef6c8ca91ab0b28 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sun, 31 Jan 2016 16:16:02 -0800 Subject: [PATCH] Better handle some different function types in the .scope setup. --- t-dll-api.cc | 6 +++--- tgt-vvp/vvp_scope.c | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/t-dll-api.cc b/t-dll-api.cc index d74938e4b..8cad0a4af 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -2053,8 +2053,8 @@ extern "C" ivl_variable_type_t ivl_scope_func_type(ivl_scope_t net) extern "C" int ivl_scope_func_signed(ivl_scope_t net) { assert(net); - assert(net->type_ == IVL_SCT_FUNCTION); - assert(net->func_type == IVL_VT_LOGIC); + assert(net->type_==IVL_SCT_FUNCTION); + assert(net->func_type==IVL_VT_LOGIC || net->func_type==IVL_VT_BOOL); return net->func_signed? !0 : 0; } @@ -2062,7 +2062,7 @@ extern "C" unsigned ivl_scope_func_width(ivl_scope_t net) { assert(net); assert(net->type_ == IVL_SCT_FUNCTION); - assert(net->func_type == IVL_VT_LOGIC); + assert(net->func_type==IVL_VT_LOGIC || net->func_type==IVL_VT_BOOL); return net->func_width; } diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index 56c3ca928..0c9850878 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -2254,6 +2254,7 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent) if (ivl_scope_type(net)==IVL_SCT_FUNCTION) { switch (ivl_scope_func_type(net)) { case IVL_VT_LOGIC: + case IVL_VT_BOOL: snprintf(suffix, sizeof suffix, ".vec4.%c%u", ivl_scope_func_signed(net)? 'u' : 's', ivl_scope_func_width(net)); @@ -2265,8 +2266,12 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent) snprintf(suffix, sizeof suffix, ".str"); break; case IVL_VT_CLASS: + case IVL_VT_DARRAY: + case IVL_VT_QUEUE: snprintf(suffix, sizeof suffix, ".obj"); break; + case IVL_VT_VOID: + assert(0); default: assert(0); break;