verilog behavioral modeling--sequential and parallel statements
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 |
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的更多相关文章
- verilog behavioral modeling ---Block statements
block statements : 1. sequential block : begin-end block 2.parallel block : fork - join bloc ...
- verilog behavioral modeling --procedural assignments
1.procedural assignments are used for updating reg ,integer , time ,real,realtime and memory data ty ...
- verilog behavioral modeling --loop statement
1.forever 2.repeat 3.while 4.for The for statement accomplishes the same results as the following ps ...
- verilog behavioral modeling--overview
1.verilog behavioral models contain procedural statements that control the simulation and manipulate ...
- verilog behavioral modeling--blocking and nonblocking
BLOCKIN ...
- verilog behaviral modeling -- procedural timing contronls
1.delay control : an expression specifies the time duration between initially encountering the state ...
- verilog behavioral modeling--branch statement
conditional statement case statement 1. conditional statement if(expression) statement_o ...
- verilog behavioral modeling--procedural continous assignment(不用)
assign / deassgin force /release the procedural continuous assignments(using keywords assign and for ...
- verilog FAQ(zz)
1. What is the race condition in verilog? Ans :The situation when two expressions are allowed to exe ...
随机推荐
- shell学习(2)- sed
一.替换(s) 详细用法 [address]s/pattern/replacement/flags 修饰flag的标志如下: 命令 说明 n 1到512之间的一个数字,表示文本模式中指定模式第n次出 ...
- python操作rabbitmq实现广播效果
生产方(Fanout_Publisher.py) # __author__ = 'STEVEN' import pika #开启socket connection = pika.BlockingCon ...
- [題解]luogu_P1333瑞瑞的木棍(并查集/圖論)
是一道歐拉路的題竟然沒看出來...... 把每種顏色看成一個點,每根木棍看成一個邊,即相同顏色在圖中接好合併成了一個點, 問題轉化為了求是否存在歐拉路 如果用map會超時,所以可以用字典樹實現離散化/ ...
- js-metisMenu
metisMenu是js的菜单插件,可以实现可折叠的二级菜单效果. 1 bootstrap折叠(Collapse) 直接引用bootstrap.js或者bootstrap.min.js就可以支持该插件 ...
- 关于presentViewController 后调用pushViewController
错误代码: LoginViewController *loginVc = [[LoginViewController alloc] int]; [self presentViewController ...
- hdu6311( 2018 Multi-University Training Contest 2)
bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6311 从dls思路中,我整理一下自己的思路: 1.首先也是建图 2.建图结束后,一个df ...
- python学习之环境搭建 输入输出
一 环境搭建: 在安装好python2.7之后就可以利用其命令行和交互式模式进行基本的输入和输出测试了,但这样编码无法保存,所以就需要用到好用的编辑器和环境搭建了,这里用uestdio. 1.1打开u ...
- Haproxy常见用法
简介 HAProxy 提供高可用性.负载均衡以及基于 TCP 和 HTTP 应用的代理,支持虚拟主机, 它是免费.快速并且可靠的一种解决方案. HAProxy 特别适用于那些负载特大的 web 站点, ...
- SSAS中雪花模型
上面的[销售事实表]与[门店]维度.[集团]维度就组成了一个雪花模型. 1.可以把[集团]关联到[门店]的维度上去: 2.如果要把[集团]作为一个单独的维度,先在[维度]里把Dim_Group添加进来 ...
- php出现Warning: file_put_contents,failed to open stream
Warning: file_put_contents(D:/wwwroot/jinxiongdi/web/temp/caches/f/index_40F756F0.php) [function.fil ...