Skip to content

Commit e6d6776

Browse files
committed
describe a clock divider must use blocking
assignment
1 parent 74dcbe3 commit e6d6776

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

VerilogCodingStyle.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,13 +1756,14 @@ an always block as occurring in a separate simulation event as the non-blocking
17561756
assignment. This process makes some signals jump registers, potentially leading
17571757
to total protonic reversal. That's bad.
17581758

1759-
Exception: For a clock divider blocking assingment must be used not to case race condition.
1759+
Note that all clock signals should be generated using blocking assignment even
1760+
for clock dividers. See #44 for details.
17601761

17611762
👍
17621763
```systemverilog {.good}
17631764
logic clk_div2;
17641765
always_ff @(posedge clk or negedge rst_ni) begin
1765-
// only for a clock divider blocking assignment must be used not to cause race condition
1766+
// a clock signal should be generated using blocking assignment
17661767
if (!rst_ni) clk_div2 = 1'b0;
17671768
else clk_div2 = ~clk_div2;
17681769
end

0 commit comments

Comments
 (0)