T
Tricky
with a 2D array, is it possible to assign an entire row in 1 go?
I have the following 2D array
type A_t is array(natural range <>, natural range <>) of natural;
variable A : A_t(0 to 4, 0 to 4) := ( (1,1,1,1,1),
(2,2,2,2,2),
(3,3,3,3,3),
(4,4,4,4,4),
(5,5,5,5,5)
);
And when I try this:
A(1, 0 to 4) := (9,9,9,9,9);
I get what I think is a bit of an odd error:
** Error: D:/Current_Work/ADWEP/VHDL/play_TB.vhd(25): (vcom-1088)
Badly formed indexed name of "a". Index #2 is a range.
** Error: D:/Current_Work/ADWEP/VHDL/play_TB.vhd(25): Target type
std.standard.integer in variable assignment is different from
expression type.
** Error: D:/Current_Work/ADWEP/VHDL/play_TB.vhd(25): (vcom-1152)
Index value 5 is out of index range 0 to 4 of sub-array #1 of a_t.
How does it come to the conclusion Im trying to assign index value 5?
I have the following 2D array
type A_t is array(natural range <>, natural range <>) of natural;
variable A : A_t(0 to 4, 0 to 4) := ( (1,1,1,1,1),
(2,2,2,2,2),
(3,3,3,3,3),
(4,4,4,4,4),
(5,5,5,5,5)
);
And when I try this:
A(1, 0 to 4) := (9,9,9,9,9);
I get what I think is a bit of an odd error:
** Error: D:/Current_Work/ADWEP/VHDL/play_TB.vhd(25): (vcom-1088)
Badly formed indexed name of "a". Index #2 is a range.
** Error: D:/Current_Work/ADWEP/VHDL/play_TB.vhd(25): Target type
std.standard.integer in variable assignment is different from
expression type.
** Error: D:/Current_Work/ADWEP/VHDL/play_TB.vhd(25): (vcom-1152)
Index value 5 is out of index range 0 to 4 of sub-array #1 of a_t.
How does it come to the conclusion Im trying to assign index value 5?