Subject: Re: SystemVerilog: always_comb and functions
From: Stuart Sutherland (stuart@sutherland-hdl.com)
Date: Thu Mar 28 2002 - 11:44:54 PST
At 11:10 AM 3/28/2002, Clifford E. Cummings wrote:
> From the SystemVerilog 3.0/draft 4 - section 10.3, page 40, 2nd bulleted
> paragraph:
>
>The SystemVerilog always_comb procedure differs from the Verilog-2001
>always @* in the following ways:
>- <text>
>- always_comb is sensitive to changes within the contents of a
>function, whereas always @* is only sensitive to changes to the arguments
>of a function.
>- <text>
>
>PROPOSAL: do NOT change the second bullet. Users have found intelligent
>ways to take advantage of this functionality to add both abstraction and
>readability to their code.
>
>This does of course open another avenue for language abuse (function1
>calls function2 which calls function3 which calls function1 again, etc.)
>but it will be up to us trainers to explain the features and benefits
>while still warning against the unintended potential abuses.
>
>After seeing what the Intel group wants to do, I support the idea of
>always_comb descending into functions (or perhaps tasks) to find signals
>required for the sensitivity list.
Wow, someone who gave the draft number and section number--thanks,
Cliff! [I couldn't resist saying that ;) ]
I would like to just throw an idea in to the arena, and leave it to you
syntax/semantic wolves to attack... Could we add the now infamous .*
connection to function call argument lists? It would be used to say "any
names common within the function and the calling scope are inferred in the
function call argument list". This would mean:
- An always_comb only has to be sensitive to the function call arguments
(listed and inferred). The function might still reference something
outside the calling scope, but the always_comb would not be sensitive to it.
- The "calling scope" can be a named block. This would prevent sensitivity
to something a function referenced several levels of up in the
hierarchy. It would also allow different named blocks to call the same
function, and yet connect to different signals.
- The side affects of sensitivity to static variables in automatic function
may be reduced (I haven't thought that through).
- A user has to deliberately say he intends to shoot himself in the foot.
Something to ponder, anyway.
Stu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stuart Sutherland Sutherland HDL Inc.
stuart@sutherland-hdl.com 22805 SW 92nd Place
phone: 503-692-0898 Tualatin, OR 97062
www.sutherland-hdl.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This archive was generated by hypermail 2b28 : Thu Mar 28 2002 - 11:41:30 PST