vhdl - Error: indexed name is not a integer -
i got error when synthesized project. have error in line:
axi_rdata <= patterncount(axi_awaddr(addr_lsb+opt_mem_addr_bits downto addr_lsb));
and got error:
[synth 8-2234] indexed name not integer
i appreciate if me.
you have declared array type:
type patterncount_memory array (31 0) of std_logic_vector(4 downto 0); signal patterncount : patterncount_memory;
you access elements in array this:
a <= patterncount(3); b <= patterncount(0);
as can see, array indexed integer. if have bitfield:
signal bit_field : std_logic_vector(4 downto 0) := "01010";
then error index array directly using this:
a <= patterncount(bit_field); -- error, indexed name not integer
you want convert bitfield, interpreted integer:
a <= patterncount(to_integer(unsigned(bit_field))); -- ok, have converted our bitfield
these conversion functions available when using numeric_std
package.
Comments
Post a Comment