2017-10-10 73 views
0

具有命名塊操作的Verilog代碼是否可合成?其中一個例子是以下:Verilog代碼是否可禁用可命名的塊操作?

module named_block_disable(); 

reg [31:0] bit_detect; 
reg [5:0] bit_position; 
integer i; 

always @ (bit_detect) 
    begin : BIT_DETECT 
    for (i = 0; i < 32 ; i = i + 1) begin 
     // If bit is set, latch the bit position 
     // Disable the execution of the block 
     if (bit_detect[i] == 1) begin 
      bit_position = i; 
      disable BIT_DETECT; 
     end else begin 
      bit_position = 32; 
     end 
    end 
    end 
+0

是的,它應該工作。 –

回答

0

命名塊始終是合成的 - 它是可以有一些工具的問題disable聲明。這種用於擺脫循環的用法應該是可綜合的。在SystemVerilog中,您將使用break聲明,這絕對是可綜合的。 for循環必須靜態展開。

相關問題