1.Sequential statement groups

the begin-end keywords:

.group several statements togethor

.cause the statements to be evaluated sequentially(one at a time)

*any timing within the sequential groups is relative to the previous statement

*delays in the sequential accumulate(each delay is added to the previous delay)

*block finishes after the last statement in the block

Example - sequential
  1 module sequential();
  2
  3 reg a;
  4
  5 initial begin
  6   $monitor ("%g a = %b", $time, a);
  7    #10 a = 0;
  8    #11 a = 1;
  9    #12 a = 0;
10    #13 a = 1;
11    #14 $finish;
12 end
13
14 endmodule

 

Simulator Output

 
 0 a = x
10 a = 0
21 a = 1
33 a = 0
46 a = 1

2.parallel statement groups

The fork-join keywords:

.group several statements together:

.cause the statements to evaluated in parallel(all at the same time)

*timing within parallel group is absolute to the begining of the group.

*block finishes after the last statement completes(statement with highest delay ,it can be the first statement in the block).

Example - Parallel

1 module parallel();
  2
  3 reg a;
  4
  5 initial
  6 fork
  7   $monitor ("%g a = %b", $time, a);
  8    #10 a = 0;
  9    #11 a = 1;
10    #12 a = 0;
11    #13 a = 1;
12    #14 $finish;
13 join
14
15 endmodule

Simulator Output

0 a = x
10 a = 0
11 a = 1
12 a = 0
13 a = 1

Example - Mixing "begin-end" and "fork - join"

1 module fork_join();
  2
  3 reg clk,reset,enable,data;
  4
  5 initial  begin
  6   $display ("Starting simulation");
  7   $monitor("%g clk=%b reset=%b enable=%b data=%b",
  8     $time, clk, reset, enable, data);
  9   fork : FORK_VAL
10      #1 clk = 0;
11      #5 reset = 0;
12      #5 enable = 0;
13      #2 data = 0;
14   join
15    #10 $display ("%g Terminating simulation", $time);
16   $finish;
17 end
18
19 endmodule

Simulator Output

 0 clk=x reset=x enable=x data=x
1 clk=0 reset=x enable=x data=x
2 clk=0 reset=x enable=x data=0
5 clk=0 reset=0 enable=0 data=0
15 Terminating simulation

verilog behavioral modeling--sequential and parallel statements的更多相关文章

  1. verilog behavioral modeling ---Block statements

    block statements : 1. sequential block  : begin-end block 2.parallel block       :  fork - join bloc ...

  2. verilog behavioral modeling --procedural assignments

    1.procedural assignments are used for updating reg ,integer , time ,real,realtime and memory data ty ...

  3. verilog behavioral modeling --loop statement

    1.forever 2.repeat 3.while 4.for The for statement accomplishes the same results as the following ps ...

  4. verilog behavioral modeling--overview

    1.verilog behavioral models contain procedural statements that control the simulation and manipulate ...

  5. verilog behavioral modeling--blocking and nonblocking

                                                                                                 BLOCKIN ...

  6. verilog behaviral modeling -- procedural timing contronls

    1.delay control : an expression specifies the time duration between initially encountering the state ...

  7. verilog behavioral modeling--branch statement

    conditional statement case statement 1. conditional statement     if(expression)         statement_o ...

  8. verilog behavioral modeling--procedural continous assignment(不用)

    assign / deassgin force /release the procedural continuous assignments(using keywords assign and for ...

  9. verilog FAQ(zz)

    1. What is the race condition in verilog? Ans :The situation when two expressions are allowed to exe ...

随机推荐

  1. kuangbin大佬的高斯消元模板

    dalao解释的博客 #include <bits/stdc++.h> using namespace std; ; int a[MAXN][MAXN];//增广矩阵 int x[MAXN ...

  2. Jquery | 基础 | 项目实践

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. 浅谈H5技术

    1.什么是H5:HTML5将成为HTML.XHTML以及HTML  DOM的新标准.目前仍处于完善之中.然而,大部分现代浏览器已经具备了某些HTML5支持. 2.背景:HTML5 是 W3C 与 WH ...

  4. HDU6440(费马小定理)

    其实我读题都懵逼--他给出一个素数p,让你设计一种加和乘的运算使得\[(m+n)^p = m^p+n^p\] 答案是设计成%p意义下的加法和乘法,这样:\[(m+n)^p\ \%\ p = m+n\] ...

  5. SSIS Passing Parameters to an ADO .NET Source query;向ado.net数据源传递参数。

    使用SSIS的oledb数据源时的参数按钮如下图: 但是在使用ADO.NET源连接到MYSQL时,没有这个参数按钮,如何向数据流的sql command传递参数呢? steps: 1. 在 控制流 选 ...

  6. python入门之数据类型之字符串

    str方法 name.capitalize() 将name的首字母大写 name.center(20,'*') 将name居中,长度变为20,其余用*填充 name.count('chy') 返回na ...

  7. Linux、UNIX设置开机自动运行命令、脚本配置

    一般我们不建议人工部署开机自动启动的脚本.而是建议通过crontab 部署脚本监控,理由如下: 1.自动开机部署脚本不好定位问题,有可能导致主机重启过慢. 2.自动开机部署脚本不好定位问题,有可能导致 ...

  8. JDBC事务之例子篇

    上一篇随笔记了一些有关JDBC事务管理的理论知识.这篇来看例子(主要怕一篇随笔装所有东西太长了然后分开呵呵) 一般讲事务管理的,都是拿转钱来当例子的,嗯没错我们这也是. 这个是数据库中的t_accou ...

  9. jQuery addClass() 源码解读

    addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = ...

  10. hihocoder1032 最长回文子串

    思路: manacher模板. 实现: #include <iostream> #include <cstring> using namespace std; ]; strin ...