Which way is better writing a register path in Verilog
问题 solution 1 reg q; always @(posedge clk or negedge rst_n) if (!rst_n) q <= 1'b0; else if (en_a) q <= da; else if (en_b) q <= db; else if (en_c) q <= dc; solution2 reg qw, qr; always @(*) if (en_a) qw = da; else if (en_b) qw = db; else if (en_c) qw = dc; always @(posedge clk or negedge rst_n) if (!rst_n) qr <= 1'b0; else qr <= qw; I use solution 1 a lot and I can find it a lot in many other engineers' code. Solution 2 seperates the combinational logic part and sequencial logic part, the classic