2013年5月6日 10:42:38
Verilog HDL 学习笔记2-blocking and non-blocking assignment
---学习贵在总结,将学习的心得体会记录
在学习verilog的过程中,碰到的第一块绊脚石就是data type中wire 和reg的使用,第二块就是blocking 和non-blocking assignment 的区别和使用。现将学习过程中的疑惑和自己的理解总结。
照惯例,还是先将官方说明贴出来,verilog 2001关于blocking and non-blocking assignment 表述如下:
blocking assignment :A blocking procedural assignment statement shall be executed before the execution of the statements that follow it in a sequential block (see 9.8.1). A blocking procedural assignment statement shall not prevent the execution of statements that follow it in a parallel block (see 9.8.2).
这表明的是:在顺序块中(begin end)中,阻塞过程赋值语句会阻塞其后语句的执行。也就是说,在前面的语句执行完之前,后面的语句是不能被执行的。但是在并行块中不会阻塞(fork join 语句,一般用不到)
non-blocking assignment :The non blocking procedural assignment allows assignment scheduling without blocking the procedural flow. The non blocking procedural assignment statement can be used whenever several variable assignments within the same time step can be made without regard to order or dependence upon each other.