|
发表于 2018-7-10 13:26:07
|
显示全部楼层
本帖最后由 wuyi316904 于 2018-7-10 13:27 编辑
1 module block_nonblock(); 2 reg a, b, c, d , e, f ;
3
4 // Blocking assignments
5 initial begin
6 a = #10 1'b1;// The simulator assigns 1 to a at time 10
7 b = #20 1'b0;// The simulator assigns 0 to b at time 30
8 c = #40 1'b1;// The simulator assigns 1 to c at time 70
9 end
10
11 // Nonblocking assignments
12 initial begin
13 d <= #10 1'b1;// The simulator assigns 1 to d at time 10
14 e <= #20 1'b0;// The simulator assigns 0 to e at time 20
15 f <= #40 1'b1;// The simulator assigns 1 to f at time 40
16 end
17
18 endmodule
阻塞赋值的时候要执行完当前语句再执行下一句。非阻塞赋值可以同时完成。你使用阻塞和非阻塞赋值导致实际赋值时间不同,造成激励不同。 |
|