A VPI by index will only work for a reg or a net

This commit is contained in:
Cary R 2020-05-18 22:32:42 -07:00
parent 38d16e5f2f
commit 19d63f0c96
1 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2018 Stephen Williams (steve@icarus.com)
* Copyright (c) 2001-2020 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
@ -681,7 +681,11 @@ static vpiHandle signal_index(int idx, vpiHandle ref)
} else {
if ((idx < rfp->msb.get_value()) || (idx > rfp->lsb.get_value())) return 0;
}
/* Return a handle for the individual bit. */
PLI_INT32 type = vpi_get(vpiType, ref);
if ((type != vpiNet) && (type != vpiReg)) return 0;
/* Return a vpiNetBit or vpiRegBit handle for the individual bit. */
cerr << "Sorry: Icarus does not currently support "
<< "vpi_get_handle_by_index() for "
<< vpi_get_str(vpiType, ref);