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 ...
随机推荐
- Date类学习一
- MySQL 索引及优化实战
https://blog.csdn.net/qq_21987433/article/details/79753551 https://tech.meituan.com/mysql_index.html ...
- 深度学习环境搭建(Ubuntu16.04+GTX1080Ti+CUDA8.0+Cudnn6.0+TensorFlow+Caffe2(Pytorch))
OS System:Ubuntu16.04 GPU Device:GTX1080Ti Softwares:CUDA8.0.Cudnn6.0.TensorFlow(1.4.0).Caffe2(1.0.0 ...
- python入门之排序,文件操作
排序 li.sort() 对li列表从小到大排序,直接更新li列表 sorted(li) 返回一个li排序后的列表,并非直接对li作更新 列表元素必须是同一种数据类型 文件操作 打开文件: f = o ...
- springmvc 实现原理与struts2原理的区别
spring mvc的入口是servlet,而struts2是filter,这样就导致了二者的机制不同. spring mvc是基于方法的设计,sturts2是基于类设计的. springmvc将ur ...
- Python/WSGI 应用快速入门--转
http://uwsgi-docs-cn.readthedocs.io/zh_CN/latest/WSGIquickstart.html 这个快速入门指南将会向你展示如何部署简单的 WSGI 应用和普 ...
- Django的ORM基础增删改查
查询 all() 返回模型类对应表格中所有数据,返回查询集 get() 返回表格中满足条件的一条且只能有一条数据 如果查到多条数据,则抛异常:MultipleObjectsReturned 查询不到数 ...
- 难道这就是gin中间件的原理,一个装饰者模式而已?
func wrapCtx(handler func(ctx *gin.Context)) gin.HandlerFunc { return func(c *gin.Context) { //获取请求的 ...
- kafka基础六
kafka中的高可用HA 1.replication副本 同一个partition会有一个leader和多个副本,这些副本存储的内容与leader相同,可以通过 server.properties 配 ...
- js如何调用电脑的摄像头
闲来无事,用js写了一个调用摄像头的demo,并用canvas显示保存.这个功能很实用,比如上传用户的头像,即时拍照及时上传. Html: <video width="200px&qu ...