diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 3dd12947f..eae28e858 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -731,8 +731,8 @@ static struct vector_info draw_binary_expr_le(ivl_expr_t exp, assert(ivl_expr_value(re) == IVL_VT_LOGIC || ivl_expr_value(re) == IVL_VT_BOOL); - lv.wid = 0; - rv.wid = 0; + lv.wid = 0; lv.base=0; + rv.wid = 0; rv.base=0; switch (ivl_expr_opcode(exp)) { case 'G': diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 647612486..cc7caa172 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -1590,6 +1590,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus, case 'u': case 'U': *idx += 1; + size = 0; /* fallback value if errors */ if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 || prec != -1) { vpi_printf("WARNING: invalid format %s%s.\n", info->name, fmtb); @@ -1661,6 +1662,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus, case 'z': case 'Z': *idx += 1; + size = 0; /* fallback value if errors */ if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 || prec != -1) { vpi_printf("WARNING: invalid format %s%s.\n", info->name, fmtb); @@ -2161,6 +2163,7 @@ static PLI_INT32 sys_printtimescale_calltf(PLI_BYTE8*xx) vpiHandle scope; if (!argv) { vpiHandle parent = vpi_handle(vpiScope, sys); + scope = NULL; /* fallback value if parent is NULL */ while (parent) { scope = parent; parent = vpi_handle(vpiScope, scope); @@ -2169,7 +2172,7 @@ static PLI_INT32 sys_printtimescale_calltf(PLI_BYTE8*xx) scope = vpi_scan(argv); vpi_free_object(argv); } - + vpi_printf("Time scale of (%s) is ", vpi_get_str(vpiFullName, scope)); vpi_printf("%s / ", pts_convert(vpi_get(vpiTimeUnit, scope))); vpi_printf("%s\n", pts_convert(vpi_get(vpiTimePrecision, scope))); diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index a7494cdcf..966567f2f 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -399,8 +399,10 @@ PLI_INT32 vpi_get_vlog_info(p_vpi_vlog_info vlog_info_p) void vpi_set_vlog_info(int argc, char** argv) { - vpi_vlog_info.product = "Icarus Verilog"; - vpi_vlog_info.version = "$Name: $"; + static char icarus_product[] = "Icarus Verilog"; + static char icarus_version[] = "$Name: $"; + vpi_vlog_info.product = icarus_product; + vpi_vlog_info.version = icarus_version; vpi_vlog_info.argc = argc; vpi_vlog_info.argv = argv; diff --git a/vvp/vpi_vthr_vector.cc b/vvp/vpi_vthr_vector.cc index e8af1d9a2..cc5b87e5a 100644 --- a/vvp/vpi_vthr_vector.cc +++ b/vvp/vpi_vthr_vector.cc @@ -40,7 +40,7 @@ struct __vpiVThrVec { unsigned bas; unsigned wid; unsigned signed_flag : 1; - char *name; + const char *name; }; inline static @@ -427,14 +427,14 @@ vpiHandle vpip_make_vthr_vector(unsigned base, unsigned wid, bool signed_flag) assert(wid < 65536); obj->wid = wid; obj->signed_flag = signed_flag? 1 : 0; - obj->name = "T<>"; + obj->name = vpip_name_string("T<>"); return &obj->base; } struct __vpiVThrWord { struct __vpiHandle base; - char* name; + const char* name; int subtype; unsigned index; }; @@ -545,7 +545,7 @@ vpiHandle vpip_make_vthr_word(unsigned base, const char*type) assert(type[0] == 'r'); obj->base.vpi_type = &vpip_vthr_const_real_rt; - obj->name = "W<>"; + obj->name = vpip_name_string("W<>"); obj->subtype = vpiRealConst; assert(base < 65536); obj->index = base;