regarding error “Range must be bounded by constant expressions”

后端 未结 1 1534
说谎
说谎 2021-01-03 16:10
always @(numint or numfrac)
  begin
     begin : BIT_DET
     for (i=22;i>0;i=i-1)
       begin
         if (numint[i]==1\'b1)
           begin

           ieeesi         


        
相关标签:
1条回答
  • 2021-01-03 16:49

    The error is for [i-1:0] and [22:i]. Part-select cannot have a variable range. Bit-select can use a variable. Each bit of ieeemant needs to be assigned individually.

    Change:

    ieeemant[22:0] <= { numint[i-1:0] , numfrac[22:i] } ;
    

    to:

    for(j=0; j<23; j+=1) begin
        ieeemant[j] <= (i+j < 23) ? numfrac[j+i] : numint[j-i];
    end
    
    0 讨论(0)
提交回复
热议问题