J
JohnSmith
Guest
Hi,
What does the (2) here?
StateTable'LENGTH(2)
Thanks
What does the (2) here?
StateTable'LENGTH(2)
Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I expect that it would cause a syntax error.What does the (2) here?
StateTable'LENGTH(2)
Actually, a legal interpretation would exist if StateTable is an arrayJohnSmith wrote:
What does the (2) here?
StateTable'LENGTH(2)
I expect that it would cause a syntax error.
StateTable'LENGTH = 2 would be a valid boolean.
-- Mike Treseler
But why would the above work?On Nov 2, 11:25 am, Mike Treseler <mtrese...@gmail.com> wrote:
JohnSmith wrote:
What does the (2) here?
StateTable'LENGTH(2)
I expect that it would cause a syntax error.
StateTable'LENGTH = 2 would be a valid boolean.
-- Mike Treseler
Actually, a legal interpretation would exist if StateTable is an array
with 2 or more dimensions. Then this would return the length of the
second index range. For example, if StateTable were of a type like:
array(1 to 3, 100 to 199, 16 to 66) of BIT;
then the above subterm would evaluate to 100.
- Kenn
Because that is the syntax for getting the length of the 2nd elementBut why would the above work?
No, StateTable(2)'length would get you the length of the secondShouldnt it be StateTable(2)'length ?
....On Nov 2, 11:25 am, Mike Treseler <mtrese...@gmail.com> wrote:
JohnSmith wrote:
What does the (2) here?
StateTable'LENGTH(2)
I expect that it would cause a syntax error.
StateTable'LENGTH = 2 would be a valid boolean.
-- Mike Treseler
Actually, a legal interpretation would exist if StateTable is an array
with 2 or more dimensions. Then this would return the length of the
second index range. For example, if StateTable were of a type like:
array(1 to 3, 100 to 199, 16 to 66) of BIT;
then the above subterm would evaluate to 100.
- Kenn
According to the LRM, the LENGTH attribute is only defined forOn Nov 2, 6:37 pm, kennheinr...@sympatico.ca wrote:
On Nov 2, 11:25 am, Mike Treseler <mtrese...@gmail.com> wrote:
JohnSmith wrote:
What does the (2) here?
StateTable'LENGTH(2)
I expect that it would cause a syntax error.
StateTable'LENGTH = 2 would be a valid boolean.
-- Mike Treseler
Actually, a legal interpretation would exist if StateTable is an array
with 2 or more dimensions. Then this would return the length of the
second index range. For example, if StateTable were of a type like:
array(1 to 3, 100 to 199, 16 to 66) of BIT;
then the above subterm would evaluate to 100.
- Kenn
...
TYPE VitalStateTableType IS ARRAY ( NATURAL RANGE <>, NATURAL
RANGE <> )
OF VitalStateSymbolType;
begin
process
variable X_FF_O_tab : VitalStateTableType;
begin
.....
What about open arrays?
These constructs are used in VITAL packages. In VitalStateTableOn Nov 4, 4:06 pm, JohnSmith <csnew...@gmail.com> wrote:
On Nov 2, 6:37 pm, kennheinr...@sympatico.ca wrote:
On Nov 2, 11:25 am, Mike Treseler <mtrese...@gmail.com> wrote:
JohnSmith wrote:
What does the (2) here?
StateTable'LENGTH(2)
I expect that it would cause a syntax error.
StateTable'LENGTH = 2 would be a valid boolean.
-- Mike Treseler
Actually, a legal interpretation would exist if StateTable is an array
with 2 or more dimensions. Then this would return the length of the
second index range. For example, if StateTable were of a type like:
array(1 to 3, 100 to 199, 16 to 66) of BIT;
then the above subterm would evaluate to 100.
- Kenn
...
TYPE VitalStateTableType IS ARRAY ( NATURAL RANGE <>, NATURAL
RANGE <> )
OF VitalStateSymbolType;
begin
process
variable X_FF_O_tab : VitalStateTableType;
begin
.....
What about open arrays?
According to the LRM, the LENGTH attribute is only defined for
_constrained_ array subtypes, which rules out your "open" or
unconstrained arrays. I'd expect to see an error message.
- Kenn- Hide quoted text -
- Show quoted text -
But even though a type can have an unconstrained array size, an actualWhat about open arrays?
According to the LRM, the LENGTH attribute is only defined for
_constrained_ array subtypes, which rules out your "open" or
unconstrained arrays. I'd expect to see an error message.
These constructs are used in VITAL packages. In VitalStateTable
procedure (prmtvs_b.vhd), VitalStateTableType is defined in
prmtvs_p.vhd
Agreed, the input parameter has this unconstrained type. But the arrayThese constructs are used in VITAL packages. In VitalStateTable
procedure (prmtvs_b.vhd), VitalStateTableType is defined in
prmtvs_p.vhd