1364-2005, 10.4.1, says, "The keyword automatic declares an automatic function that is reentrant, with all the function declarations allocated dynamically for each concurrent function call. Automatic function items can not be accessed by hierarchical references. Automatic functions can be invoked through the use of their hierarchical name." It does not explicitly say anywhere, I think, that a non-automatic function cannot call itself, but I think the compilers all forbid it. Shalom > -----Original Message----- > From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On > Behalf Of Surya Pratik Saha > Sent: Monday, January 30, 2006 1:54 PM > To: Bresticker, Shalom > Cc: sv-bc@eda.org > Subject: RE: [sv-bc] Is member of recursive task/function > hierarchically referred? > > Hi Shalom, > Thanks for the reply. But I have a doubt. Since the > recursiveness restriction is > removed from LRM, I am not clear why then the test case is > illegal. > > On Mon, 30 Jan 2006, Bresticker, Shalom wrote: > > > Hi, > > > > The text you quote is erroneous and was fixed in 1364-2005, > which you > > should use as reference instead of 1364-2001. > > > > There is no difference in this respect between recursive and > > non-recursive automatic functions. > > See http://boyd.com/1364_btf/report/full_pr/325.html. > > > > In your example, the function inc is recursive but not > automatic, so it > > should be illegal. > > > > Shalom > > > > > > > -----Original Message----- > > > From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On > > > Behalf Of Surya Pratik Saha > > > Sent: Monday, January 30, 2006 12:44 PM > > > To: sv-bc@eda.org > > > Subject: [sv-bc] Is member of recursive task/function > > > hierarchically referred? > > > > > > In 1364-2001 LRM, section 12.4, it is mentioned: > > > > > > [...] > > > At the top of the name hierarchy are the names of one or > more > > > root modules of > > > which no instances have been > > > created.This root or these parallel root modules make up > one or > > > more hierarchies > > > in a design description or > > > description .Inside any module,each module instance > (including > > > an arrayed or > > > generated instance),task def- > > > inition,function definition,and named begin-end or fork- > join > > > block shall define > > > a new branch of the > > > hierarchy.Named blocks within named blocks and within tasks > and > > > functions shall > > > create new branches. > > > Only non-recursively referenced automatic tasks and/or > > > functions create visible > > > branches that can be refer- > > > enced.Recursively called tasks and functions,declared using > the > > > automatic > > > keyword and recursively called > > > from within the same task or function,do not create visible > > > branches that can be > > > referenced.See 10.2.1 and > > > 10.3.1 for a discussion of automatic tasks and functions. > > > [...] > > > > > > What I can understand, the member of a directly recursive > > > task/function is not > > > allowed to be hierarchically referenced. If it is mutually > > > recursive, then the > > > member can be hierarchically referred unless the > task/function > > > is automatic. > > > > > > It is already mentioned, any member of automatic > task/function > > > can not be > > > hierarchically referred. > > > > > > So is the member of a directly recursive task/function > allowed > > > to be > > > hierarchically referred, if the task/function is not > automatic. > > > If yes, then why > > > recursiveness is discussed here. > > > > > > For e.g., is the following test case legal? > > > module tb; > > > dut dut(); > > > initial $dumpvars(); > > > endmodule > > > > > > module dut(input clk, input d, output reg [7:0] q); > > > > > > //{remote href,local href, not} X {user dotted, > implicit > > > dotted} > > > > > > reg [7:0] \t1.local ; // capture? > > > reg [7:0] \literal.local ; > > > > > > function inc (input [7:0] a); > > > reg [7:0] incprev; > > > begin > > > if (a==0) begin > > > if (d) incprev=0; > > > // else reuse global incprev > > > end > > > else incprev=inc(a-1)+1; > > > inc = incprev; > > > end > > > endfunction > > > > > > task t1 (output [7:0] out, input [7:0] in); > > > reg [7:0] local; > > > begin > > > if (in[0]) local=in>>1; > > > out=local+1; > > > end > > > endtask > > > > > > always @(posedge clk) begin > > > t1(\t1.local , inc(4)); > > > q = \t1.local + \literal.local + t1.local + > > > inc.incprev; > > > end > > > > > > endmodule > > > > > > Regards > > > Surya. > > > > Regards > Surya.Received on Mon Jan 30 04:04:16 2006
This archive was generated by hypermail 2.1.8 : Mon Jan 30 2006 - 04:04:57 PST