2

関数で for ループを使用する場合の Verilog でのタイミングについていくつか質問があります。

  1. for ループが動作している関数を実行するために必要なクロック サイクルを見積もるにはどうすればよいですか?

  2. また、1 回の for ループの反復に必要なクロック時間を見積もるにはどうすればよいでしょうか。

  3. 関数は割り込みのように機能しますか。例: シーケンシャル ロジックで関数を呼び出した場合、関数が終了するまですべてが停止しますか?

[更新] for ループを正確に使用しているものについて、さらに詳しい情報を次に示します。

integer n;

 always@(posedge CLK)
     if(IN)              // some input wire IN   
       begin
         n = n + 1;
         Result[31:0] <= Approx(n); //put Result from Approx into output reg Result
       end

 function [31:0] Approx
    input n;
     integer n;
     real fp;  //some real number to store the approximation result
    begin
      for(integer i=0; i < 2**16; i=i+1) 
         begin
       ... // do Approximation within fixed iteration steps
       ... // Result is a floating point number
         end
     Approx[31:0] = convert_fp_to_bin(fp); //another function with for-loop to convert decimal number into binary number
    end
     ....
4

1 に答える 1