Re: More Rate troubles

From: John Lazzaro (lazzaro@CS.Berkeley.EDU)
Date: Mon Jul 10 2000 - 22:34:47 EDT


> Hello all,
>
> This is related to my previous question, but with a different bend. The
> following state keeps giving me "faster than formal argument" error.
>
> eg = kline(1, tableread(rates, 0), 0);
>
> After thinking about it just now, it would appear that the reason that
> this is giving me a trouble is because this statement is enclosed with a
> k-rate block. Does the tableread get its rate from the enclosing block?

Yes, there are a set of rules that govern the rate a
poly-op takes on:

    4.The rate of a rate-polymorphic opcode is the
      fastest of:
         a.The fixed-rate formal parameters of the opcode
           definition, and
         b.The arguments to the opcode call, and
         c.The fastest guard expression of an if, if-else, or
           while statement guarding the call, and
         d.The rate of an opcode encloding the call.
      If none of these conditions act to set the rate of the
      opcode, the opcode defaults to k-rate.

This is taken from:

http://www.cs.berkeley.edu/~lazzaro/sa/book/opcodes/user/index.html#calls

Note this is near the end of the book. When we wrote the first section
of the book that introduces SAOL, we tried to come up with a set of
rate rules for if and while statements that were a little stricter
than the actual standard, in part so that if you obeyed those rules,
the polymorphic core opcode rules could be made simpler -- and so
the complex rule I quoted above could be postponed till later. However,
these simplified rules didn't quite cover the table core opcodes,
which led to Chapter II/3's carefully crafted rate-polymorphic rule:

    3.For rate-polymorphic core opcodes that only
      have rate-polymorphic signal parameters, the
      rate of an opcode call is the rate of the fastest
      expression in the opcode call.

Which excludes the table opcodes. Which is OK as you're reading
through it, since tables aren't even introduced at the time (this
was lifted out of:

http://www.cs.berkeley.edu/~lazzaro/sa/book/saol/simple/index.html#opcode

The idea was to expand on the caveat when we introduced the table
core opcodes in the wavetable chapter, but it looks like that
slipped through the cracks ... oops. But to answer you question,
the rule 4. I quoted above includes (c), which is the one you're
triggering with your example ...

                                                                --jl

-------------------------------------------------------------------------
John Lazzaro -- Research Specialist -- CS Division -- EECS -- UC Berkeley
lazzaro [at] cs [dot] berkeley [dot] edu www.cs.berkeley.edu/~lazzaro
-------------------------------------------------------------------------



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