J
Jonathan Bromley
Guest
OK, I'm stuck; time to expose my ignorance.
I said that you can't have a function parameter of
class VARIABLE, even when it's of mode IN:
function is_empty(variable S: in string) ---illegal
function is_empty(S: in string) --- legal
And two different simulators agree. But then I
remembered that of course you *can* have function
input parameters of class SIGNAL; if this were not
true, then it would be impossible to write function
RISING_EDGE, for example.
The relevant bit of LRM is 1076-2002 clause 2.1.1.
It clearly says that function parameters must be
mode IN and can be CONSTANT or SIGNAL class
(or FILE, which of course is somewhat special).
Does anyone have any idea why VARIABLE is
outlawed here? It's completely mysterious to me.
The IN restriction would make any such variable
parameters read-only, as required by common sense.
Yours confused
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
I said that you can't have a function parameter of
class VARIABLE, even when it's of mode IN:
function is_empty(variable S: in string) ---illegal
function is_empty(S: in string) --- legal
And two different simulators agree. But then I
remembered that of course you *can* have function
input parameters of class SIGNAL; if this were not
true, then it would be impossible to write function
RISING_EDGE, for example.
The relevant bit of LRM is 1076-2002 clause 2.1.1.
It clearly says that function parameters must be
mode IN and can be CONSTANT or SIGNAL class
(or FILE, which of course is somewhat special).
Does anyone have any idea why VARIABLE is
outlawed here? It's completely mysterious to me.
The IN restriction would make any such variable
parameters read-only, as required by common sense.
Yours confused
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.