From: krolnik@lsil.com
Date: Tue Oct 28 2003 - 14:59:27 PST
>Number: 496
>Notify-List:
>Category: enhancement
>Originator: Adam Krolnik
>Environment:
>Description:
The VPI diagrams show which methods are callable for a given
element. But when coding, use of the methds is conditional based on the specific type of the object. One thus needs
to check the object type (vpiOpType, vpiType, etc.) and hope
that their checking list is complete to call the method.
Simple example:
my $etype = vpi_get($vpiType, $H);
if (! grep $etype == $_, ($vpiNet, $vpiNetBit, $vpiReg,
$vpiRegBit, $vpiPartSelect, $vpiRealVar,
$vpiParameter, $vpiConstant,
$vpiFuncCall, $vpiIntegerVar,
$vpiSysFuncCall, $vpiMemory, $vpiMemoryWord))
// Only look up the operation type if the object
// is not one of the above.
{
$optype = vpi_get($vpiOpType, $H);
...
It would be better to have a method or macro or etc.
that encapsulates this information so that it doesn't have
to be built be each implementer. If a method was
available, one could instead write:
// Is there an OpType attribute to get?
if (vpi_test($vpiOpType, $H))
{
$optype = vpi_get($vpiOpType, $H);
This archive was generated by hypermail 2.1.4
: Tue Oct 28 2003 - 14:59:34 PST
and
sponsored by Boyd Technology, Inc.