Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

what should i replace with question mark?

hi every body

this is my code


architecture structure of main is
    
   .....
begin           
   
    L1:for s in 0  to N-1 generate
        
        L2:for t in 0 to 2**s-1 generate
            
            -- Output index
            constant output_index : integer := (2**s-1) + t;
            
            -- Input indices (based on the output index)
            constant input_index_start  : integer := 2*output_index+1 ;
            constant input_index_end    : integer := 2*output_index + 2;
            
            begin
            DUT: entity work.trans  
            port map (
                rstN => rstN,
                clk  => clk,                                          
                data => n(input_index_end downto  input_index_start),
                i    => n(output_index),
                d     => m(output_index)
                );
                       
        Avrg(???????????)<=m(output_index);     
            
        end generate;
    end generate;    

m is the output of my for-generate statement.

i wanna save the value of m in Avrg , every loop .

i mean in the first loop i want to save m in the LSB of Avrg(0)

in the second , save it in Avrg(1)

etc.

what should i replace with question mark?

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you are confusing yourself because you have nested for loops. I think you want to put Avrg in the outer loop?