I am wondering if it is possible to use a variable inside a generate statement.
signal bitmap_nodes : std_logic_vector(0 to NB_NODES-1) := (others => '0');
CIRCULAR: if (CLOCKWISE = 0) generate
variable index : integer := 0;
begin
GENERATE_NODE : for i in NB_NODES-1 to 0 generate
begin
node_inst: node
port map (
rx_bitmap => bitmap_nodes(index)
);
-- Increment index
index := index + 1;
end generate GENERATE_NODE;
end generate CIRCULAR;
Here, the variable is only used for the vector slicing. What it will do is assign the following (assume NB_NODES equals 4):
NODE0 -> bitmap_nodes(3)
NODE1 -> bitmap_nodes(2)
NODE2 -> bitmap_nodes(1)
NODE3 -> bitmap_nodes(0)