Fix vvp crash when a part select of a wire is passed to $monitor.

When the PV expression is compiled, the parent net may not yet be
resolved, so we may not be able to get its VPI handle straight away.
This commit is contained in:
Martin Whitaker 2015-03-17 21:14:30 +00:00
parent 437dc10341
commit e006f9e132
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2014 Stephen Williams (steve@icarus.com)
* Copyright (c) 2001-2015 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -1384,7 +1384,7 @@ vpiHandle __vpiPV::vpi_handle(int code)
vpiHandle vpip_make_PV(char*var, int base, int width)
{
struct __vpiPV*obj = new __vpiPV;
obj->parent = vvp_lookup_handle(var);
compile_vpi_lookup(&obj->parent, strdup(var));
obj->sbase = 0;
obj->tbase = base;
obj->width = (unsigned) width;
@ -1397,7 +1397,7 @@ vpiHandle vpip_make_PV(char*var, int base, int width)
vpiHandle vpip_make_PV(char*var, char*symbol, int width)
{
struct __vpiPV*obj = new __vpiPV;
obj->parent = vvp_lookup_handle(var);
compile_vpi_lookup(&obj->parent, strdup(var));
compile_vpi_lookup(&obj->sbase, symbol);
obj->tbase = 0;
obj->width = (unsigned) width;
@ -1410,7 +1410,7 @@ vpiHandle vpip_make_PV(char*var, char*symbol, int width)
vpiHandle vpip_make_PV(char*var, vpiHandle handle, int width)
{
struct __vpiPV*obj = new __vpiPV;
obj->parent = vvp_lookup_handle(var);
compile_vpi_lookup(&obj->parent, strdup(var));
obj->sbase = handle;
obj->tbase = 0;
obj->width = (unsigned) width;