2017-10-10 74 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循环必须静态展开。

相关问题