Guest
Why doesn't the following code compile?
type header_t is
record
A : std_logic_vector(31 downto 0);
B : std_logic_vector(39 downto 0);
C : std_logic_vector(8 downto 0);
D : std_logic_vector(7 downto 0);
E : std_logic_vector(9 downto 0);
end record;
type compare_t is
record
A1 : std_logic_vector(header_t.A'LEFT downto header_t.A'RIGHT)); -- (152)
B1 : std_logic_vector(header_t.D'LEFT downto header_t.D'RIGHT));
C1 : std_logic_vector(header_t.E'LEFT downto header_t.E'RIGHT);
end record;
Modelsim gives the error for all three compare_t entries:
# ** Warning: sorter_pkg.vhd(152): (vcom-1260) Type mark (header_t) cannot be prefix of selected name.
The website http://www.csee.umbc.edu/portal/help/VHDL/attribute.html
indicates that the 'LEFT and 'RIGHT can be used for any type.
Is there another way to code this?
type header_t is
record
A : std_logic_vector(31 downto 0);
B : std_logic_vector(39 downto 0);
C : std_logic_vector(8 downto 0);
D : std_logic_vector(7 downto 0);
E : std_logic_vector(9 downto 0);
end record;
type compare_t is
record
A1 : std_logic_vector(header_t.A'LEFT downto header_t.A'RIGHT)); -- (152)
B1 : std_logic_vector(header_t.D'LEFT downto header_t.D'RIGHT));
C1 : std_logic_vector(header_t.E'LEFT downto header_t.E'RIGHT);
end record;
Modelsim gives the error for all three compare_t entries:
# ** Warning: sorter_pkg.vhd(152): (vcom-1260) Type mark (header_t) cannot be prefix of selected name.
The website http://www.csee.umbc.edu/portal/help/VHDL/attribute.html
indicates that the 'LEFT and 'RIGHT can be used for any type.
Is there another way to code this?