Gord wrote on 2008.01.16,
"I certainly agree that since consts, parameters, literals, etc. are not lvals, they aren't allowed for normal ref formals.
But there is a related sub-question on that. Since a "const ref" is not an lval, I have been assuming that a "const" variable (at least) is a valid actual for a const ref. I think that I'd be prepared to allow a parameter or localparam as well. Literals, concats, etc. I'd probably want to leave off although I could be convinced otherwise."
That mail seems not to have been accepted on the reflector, though.
Shalom
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Daniel Mlynek
Sent: Wednesday, August 24, 2011 3:31 PM
To: sv-ec@eda.org
Subject: [sv-ec] "const ref" for parameters and consts
LRM about refs says:
Only the following shall be legal to pass by reference:
- a variable,
- a class property,
- a member of an unpacked structure, or
- an element of an unpacked array.
So only variables are allowed for ref ports (no word about const, parameter)
But then const ref was added to the standart.
IMHO there is no sensible argument to forbid parameters to be passed by "const ref" like in below case.
module top;
parameter byte a = 1;
task automatic t (const ref byte a);
$display(a);
endtask
initial
t(a);
endmodule
Maybe LRM should allow parameters and const explicitly for const ref only.
Should I register a mantis - there is no similar yet?
DANiel
-- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Aug 24 06:35:51 2011
This archive was generated by hypermail 2.1.8 : Wed Aug 24 2011 - 06:35:54 PDT