2017-10-10 5 views
0

Le code Verilog avec l'opération de bloc nommé est-il synthétisable? Un tel exemple est ci-dessous:Le code Verilog avec l'opération de blocage de bloc nommé est-il synthétisable?

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

Oui, cela devrait fonctionner. –

Répondre

0

Un bloc nommé est toujours synthétisable - c'est la déclaration disable qui peuvent avoir des problèmes avec certains outils. Cet usage pour sortir d'une boucle devrait être synthétisable. Dans SystemVerilog, vous utiliseriez une instruction break, qui est définitivement synthétisable. La boucle for doit être statiquement déroulable.