T
Tricky
I have an image type declared:
type image_int_1D_t is
array(integer range <>) of natural range 0 to 255;
and a type containing image dimensions:
type image_dimensions_t is
record
width : natural;
height : natural;
end record image_dimensions_t;
Is there anyway I can add a reference to the image data in the record.
Obviously the problem is I cant size the array until it is actually
used, so I cannot constrain the array in the record type
"image_dimensions_t".
I thought I could use an access type to point to an "image_int_1D_t"
as an element in the record, but then I have problems 2 fold:
How can I actually access data in the array via the pointer?
I already have functions based on the type, rather than an access
type, so i would have to copy them to use an access type as a
parameter. If I could access the data via the pointer, this would not
be needed?
Or am I going past the scope of access types in VHDL, and thinking too
much like C?
A second question: which standard of VHDL allows unconstrained 2D
arrays (unconstrained in both dimensions). My Modelsim (altera 6.1g)
only seems to allow up to VHDL 2002, and either it doesnt allow them
or I am declaring the types wrong (I expect the former, and can work
around it). Could someone explain, as an image is naturally a 2D
array.
Thanks for any help
type image_int_1D_t is
array(integer range <>) of natural range 0 to 255;
and a type containing image dimensions:
type image_dimensions_t is
record
width : natural;
height : natural;
end record image_dimensions_t;
Is there anyway I can add a reference to the image data in the record.
Obviously the problem is I cant size the array until it is actually
used, so I cannot constrain the array in the record type
"image_dimensions_t".
I thought I could use an access type to point to an "image_int_1D_t"
as an element in the record, but then I have problems 2 fold:
How can I actually access data in the array via the pointer?
I already have functions based on the type, rather than an access
type, so i would have to copy them to use an access type as a
parameter. If I could access the data via the pointer, this would not
be needed?
Or am I going past the scope of access types in VHDL, and thinking too
much like C?
A second question: which standard of VHDL allows unconstrained 2D
arrays (unconstrained in both dimensions). My Modelsim (altera 6.1g)
only seems to allow up to VHDL 2002, and either it doesnt allow them
or I am declaring the types wrong (I expect the former, and can work
around it). Could someone explain, as an image is naturally a 2D
array.
Thanks for any help