Re: On UDOs ...

From: Giorgio Zoia (Giorgio.Zoia@epfl.ch)
Date: Mon May 22 2000 - 09:58:38 EDT


At 07:43 PM 5/18/2000, John Lazzaro wrote:

>how does SAINT currently handle:
>
>----
>
>aopcode bar (ksig a)
>
>{
> ksig b;
>
> if (!b)
> {
> b = a;
> }
> return(aphasor(b) - 0.5);
>}
>
>
>instr foo () {
>
> ksig d;
>
> d = d + 1;
> if (d > 100)
> {
> output(bar(d));
> }
>
>}

in this first case the if statement is uprated to a, since it
contains output. It is executed in this way:

k_reg1 = (d > 100); // krate
if(k_reg1) { // arate
         a_reg1 = bar(d);
         output(a_reg1);
}

in bar the the increment and the if statement are evaluated
at the first call of the a-cycle, which in this case is also the
only call of the cycle since the a-block is executed on a
vector.

>-----
>
>and its related example:
>
>
>aopcode bar (ivar a[1])
>
>{
> ivar b;
>
> if (!b)
> {
> b = a;
> }
> return(aphasor(b) - 0.5);
>}
>
>
>instr foo () {
>
> ivar d[1];
> ksig dummy;
>
> d[dummy] = d[dummy] + 1;
>
> if (d[dummy] > 100)
> {
> output(bar(d));
> }
>
>}

in this second example the increment is again executed at
k-rate because of the index. So the memory location contains
a passed value that changes every call to bar. In bar instead
the if statement is executed only at the first call in each instance
of foo, and then the new values are never seen. These seemed
and seems ok to me, since b is not a control parameter of the
opcode, rather an initialization parameter.
btw: the same will happen if you pass directly a to aphasor, since
arrays are not resolved directly like numbers and simple variables (and
hidden registers).

>And do you recommend SAINT's semantics to be standardized?

:-))

Best regards,

         Giorgio

__________________________________________________________________
Giorgio ZOIA

Integrated Systems Laboratory - DE/LSI - EPFL
CH-1015 Lausanne - SWITZERLAND

Phone: + 41 21 693 69 79 E-mail: Giorgio.Zoia@epfl.ch
Fax: +41 21 693 46 63
__________________________________________________________________



This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 12:03:56 EST