Forum Discussion
Altera_Forum
Honored Contributor
15 years agoVHDL question
Hi all!
According to std.standard: TYPE string IS ARRAY ( positive RANGE <> OF character); "hello" is a valid string litteral "" is a valid string litteral too, it is the empty string. Let TYPE foo IS ARRAY ( positive RANGE <> OF integer); (0, 1, 1, 2, 3, 5) is a valid foo litteral What is the litteral for an empty foo? Thx Julien5 Replies
- Altera_Forum
Honored Contributor
I dont think there is. Could you explain why you want to do it?
another less "clean" way - declare a pointer to foo. type foo_ptr_t is access foo; variable foo_ptr : foo_ptr_t; and then you can actually compare it to null: if foo_ptr = null then ...etc But that is getting rather extreme. - Altera_Forum
Honored Contributor
OK for 1 downto 2 range.
Any other (cleaner) way? - Altera_Forum
Honored Contributor
yes.
neither of these work :( - Altera_Forum
Honored Contributor
The only way I know is to create a null array constant, and use that in place of a literal:
constant NULL_FOO : foo(1 downto 2) := (others => 0); - Altera_Forum
Honored Contributor
Did you try () or (null)?