美文网首页
How to use "for" statement to fa

How to use "for" statement to fa

作者: monokent | 来源:发表于2017-02-18 22:00 被阅读0次

    Author: monokent

    Example 1

    Below is two simple examples.

    integer j;
    always@(posedge clk)
    begin
        if (!rst_n) begin
            for (j=1; j<=6; j++) 
                p1_real[j] <= 0;
        end
        else begin
    
    genvar i;
    for (i=3; i<=6; i++) begin
        assign p2_real_tr[i] =p2_real[i][wDataInOut+14-1 : 14];
        assign p2_imag_tr[i] =p2_imag[i][wDataInOut+14-1 : 14];
    end
    

    Note the difference between integer and genvar.

    In both case above, the 6 in for sentence can be replaced by a parameter which may be delivered from high level module.

    相关文章

      网友评论

          本文标题:How to use "for" statement to fa

          本文链接:https://www.haomeiwen.com/subject/agedwttx.html