Skip to content

Commit

Permalink
Emphasize conflict between initial and always_ff
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Jun 4, 2024
1 parent 9113a47 commit 1bc39a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/hdl-by-example/coding_standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@

设置启动初始值不能代替复位的功能,不能偷懒,必须都实现。不可以对组合逻辑使用。

特别地,对于 System Verilog,对同一个寄存器在 initial 和 always_ff 中分别赋值会报错,此时可以把 always_ff 改成 always。

=== "System Verilog"

```sv
Expand All @@ -528,7 +530,7 @@
some_reg = 1'b0;
end

// GOOD
// GOOD, but do not use with always_ff
logic some_reg;
initial some_reg = 1'b0;

Expand Down

0 comments on commit 1bc39a0

Please sign in to comment.