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. 【loj10064】黑暗城堡

    #10064. 「一本通 3.1 例 1」黑暗城堡 内存限制:512 MiB 时间限制:1000 ms 标准输入输出 题目类型:传统    评测方式:文本比较 上传者: 1bentong 提交     ...

  2. [洛谷P1434] [SHOI2007]滑雪

    题目链接: here we go 题外话: 谁能想到这是一道咕了两年的\(AC\)呢--当年是在搜索还半懂不懂的时候遇到的这道题,感觉真是难得要命()所以一直拖着不做,后面就下意识地逃避了搜索相关的内 ...

  3. crontab 在unix 没有执行。

    Quote: 引用 2 楼 jdwq33 的回复: Quote: 引用 1 楼 mp777323 的回复: 03 * * * * sh /opt/pro_some.sh 我试过了,这样也不行,难道是我 ...

  4. KEIL MDK之RTX的移植

    原文: http://lib.csdn.net/article/embeddeddevelopment/12240 一 将MDK安装目录的C:\keil\ARM\RL\RTX\Config下面的配置文 ...

  5. Access denied for user ''@'localhost' to database 的一个问题

    $conn = new mysqli("127.0.0.1", 'abc', '', DB_DATABASE); 在提供了用户名的情况下,竟然返回错误 说用户提供的用户为空,非常奇 ...

  6. 《javascript设计模式》笔记之第七章:工厂模式

    在读了这章之后,根据我个人现在的理解,工厂模式就是:将一个类或者一个方法称为一个工厂,然后再将一些模块交给这个工厂,让这个工厂按照给它的不同模块产出不同的实例. 下面为正文: 一:简单工厂: 例子: ...

  7. DB2中横表纵表互换

    1.列转行:创建一个如下的表drop table dwtmp.tmp_xn_lsb; create table dwtmp.tmp_xn_lsb ( year      int ,quarter   ...

  8. handler 方法进不去,服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看

    HTTP/1.1 500 Internal Server ErrorCache-Control: privateContent-Type: text/html; charset=utf-8Server ...

  9. 7.html超链接的使用

    <html> <head> <title>第七课网页标签</title> <meta charset="utf-8"> ...

  10. mavon-editor 存储md文件以及md文件解析成html文件

    一.md文件的存储 因为是vue-cli项目,所以使用的是mavonEditor. github地址:https://github.com/hinesboy/mavonEditor 使用方法: 首先安 ...