Subject: DirectC: pointers and triggering sensitivity for arrays
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Tue Jan 07 2003 - 14:10:14 PST
Kevin, Michael, Doug, et al.,
If I correctly got your concerns with allowing to access/modify array elements
via pointers, it seems to be a trade-off between the efficiency of manipulating
an array and the efficiency of propagating (detecting, to be exact) value change
events.
If array elements may be accessed/modified solely via a function that takes
indices, then simulator may optimize event triggering sensitive to individual
elements of an array; a track can be kept of the affected array elements.
Otherwise, i.e. if it is possible to get a pointer to the whole array
(or to individual an element), then such optimization is compromised and
the whole array will have to be scanned for a value change.
There is a simply reason why I'm not going to argue that the convenience and efficiency of manipulating the whole array (copying one onto another,
initializing, writing onto a file and reading back, etc.) is equally or more
important in that trade-off.
Any restrictions imposed upon open arrays and abstract access will be in vain
because we cannot control the sized arrays, which are accessed using C indexing.
If a formal argument is sized and therefore directly accessed an array, then
there is no way to keep track of individual elements being modified in C code.
And hence all elements have to be scanned in order to determine value change
events. No optimizations seems possible for value change propagation.
So why should we bother to restrict the abstract access only?
Andrzej
This archive was generated by hypermail 2b28 : Tue Jan 07 2003 - 14:11:10 PST