RISCV_picorv32_fpga/rtl/DE0-NANO/verilog_guidelines.txt

26 lines
997 B
Plaintext

Important Coding Guidelines with Nonblocking Assignments
--------------------------------------------------------
From Clifford E. Cummings paper: Verilog Nonblocking Assignments With Delays,
Myths & Mysteries.
http://www.sunburst-design.com/papers/CummingsSNUG2002Boston_NBAwithDelays.pdf
Guideline #1: When modeling sequential logic, use nonblocking assignments.
Guideline #2: When modeling latches, use nonblocking assignments.
Guideline #3: When modeling combinational logic with an always block, use blocking
assignments.
Guideline #4: When modeling both sequential and combinational logic within the same always
block, use nonblocking assignments.
Guideline #5: Do not mix blocking and nonblocking assignments in the same always block.
Guideline #6: Do not make assignments to the same variable from more than one always block.
Guideline #7: Use $strobe to display values that have been assigned using nonblocking
assignments.
Guideline #8: Do not make assignments using #0 delays.