N
nfirtaps
Guest
I have a circular buffer so my read and write index pointers need to
wrap around to the first index in the circular buffer when incremented
past the last index in the circular buffer. In order to index my
circular buffer I do
circular_buffer(conv_integer(write_index)) <= write_data;
write_index <= write_index + 1;
or
read_data <= circular_buffer(conv_integer(read_index));
read_index <= read_index + 1;
This synthesizes fine but I want read_index and write_index to be in a
modulo ring and wrap around when incremented. The simulator (ISE
Simulator Lite) complains about this treatment. It says Index 16 out
of bound 15 downto 0. I have my read and write indexes as
std_logic_vector(15 downto 0).
How do I work around this?
wrap around to the first index in the circular buffer when incremented
past the last index in the circular buffer. In order to index my
circular buffer I do
circular_buffer(conv_integer(write_index)) <= write_data;
write_index <= write_index + 1;
or
read_data <= circular_buffer(conv_integer(read_index));
read_index <= read_index + 1;
This synthesizes fine but I want read_index and write_index to be in a
modulo ring and wrap around when incremented. The simulator (ISE
Simulator Lite) complains about this treatment. It says Index 16 out
of bound 15 downto 0. I have my read and write indexes as
std_logic_vector(15 downto 0).
How do I work around this?