Hi,
As per LRM SV 2009 draft 7a, the let constructor searching is defined
as:
"
In the scope of declaration, let body shall be defined before it is
used."
That means no forward reference is allowed on let construct usage.
In other context, for function and task searching rule defined as in "
23.8.1
Task and Function name resolution", the body should not be searched
until the current scope is not complete.
But there is no syntactical difference for let constructor call and a
function call. So if a let constructor call and function call are mixed
up in a design, LRM is not clear how to resolve it. If we consider the
following example:
module top;
int x, y, z;
let f(a, b) = a < b;
if (1) begin:b
x = f (y,z); // is it let constructor call of a function call
defined later?
function int f( int a, b);
return 1;
endfunction
end
endmodule
If the above call is resolved to function call, then I don't think
there is any harm to resolve any let constructor call like function
call except the hierarchical reference which is allowed only for
function. Because, anyway, the let constructor call can't be resolved
immediately at the the place of call. We need to defer until the
current scope is completed. So the following e.g. will be legal:
module top;
int x, y, z;
if (1) begin:b
x = f (y,z); // is it let constructor call of a function call
defined later?
let f(a, b) = a < b;
end
endmodule
Please forgive me if there is any syntax error in the e.g. as "let"
construct is new to me.
Please let me know your thoughts.
--
Regards
Surya
--
This message has been scanned for viruses and
dangerous content by
MailScanner, and is
believed to be clean.
Received on Mon Jun 8 23:34:33 2009