From e006f9e1321eb6fe25b0beb05f45f40d9be9a947 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 17 Mar 2015 21:14:30 +0000 Subject: [PATCH] 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. --- vvp/vpi_signal.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vvp/vpi_signal.cc b/vvp/vpi_signal.cc index 2515b0dff..81b10cece 100644 --- a/vvp/vpi_signal.cc +++ b/vvp/vpi_signal.cc @@ -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;