verilog behavioral modeling--blocking and nonblocking
BLOCKING ASSIGNMENTS
1.A blocking procedural assignment statement shall be exectuted before the execution of the statements that follow it in a sequential block (我们一般都这样用)
2.A blocking procedural assignment statement shall not prevent the execution of statements that follow it in a parallel block(看来阻塞赋值不是永远阻塞后面的语句)
3.variable_lvalue = [delay_or_event_control] expression(variable_lvalue、delay_or_event_control 、expression 都有多种写法,可以参考IEEE标准)
If variable_lvalue require an evaluation,it shall be evaluated at the time specified by the intra-assignment timing control.
The = assignment operator used by blocking procedural assignments is also used by procedural continous assignments and continous assignments.
NONBLOCKING ASSIGNMENTS
1.the nonblocking procedural assignment allows assignment scheduling without blocking the procedural flow.
2.the nonblocking procedural assignment statement can be used whenever several variable assignments within the same time step can be made without regard to order or dependence upon each other.
3.variable_lvalue <=[delay_or_event_control] expression
If variable_lvalue requires an evaluation,it shall be evaluated at the same time as the expression on the right-hand side.
The order of evaluation of the variable_lvalue and the expression on the right-hand side is undefined if timing control is not specified.
4.<=符合重载 : 小于等于 非阻塞赋值
5.The nonblocking procedural assignments shall be evaluated in two steps .(跟time region有关)
step1:the simulator evaluates the right-hand side of the nonblocking assignments and shedules the assignments for the end of the current time step
step2:at the end of the current time step, the simulator updates the left-hand side of each nonblocking assignment statement
6.the order of the execution of distinct nonblocking assignments to a given variable shall be preserved. in other words ,if there is clear ordering of the execution of a set of nonbolcking assignments ,
then the order of the resulting updates of the destination of the nonblocking assignments shall be the same as the ordering of the execution.(非阻塞也是可以写成阻塞的方式的)
eg:
module mutipe;
reg a;
initial a = 1;
//the assigned value of the reg is determinate
initial begin
a<= #4 0;
a<= # 1 ;
end
endmodule
7.If the simulator executes two procedural blocks concurrently and if these procedural blocks contain nonblocking assignment operators to the same variable, the final value of that variable is indeterminate.
eg:
module multipe2;
reg a;
inital a =1;
initial a<= #4 0; //schedules 0 at time 4
initial a<= #4 1; //schedules 1 at time 4
//at time 4 ,a =??
//the assigned value of the reg is indeterminate
endmodule
8.always中可以blocking /nonblocking assignments
initial 中可以blocking/nonblocking assignments
似乎,我们一直关注的是always中组合逻辑用blocking,时序逻辑用nonblocking,initial中用blocking(此外系统函数必须放在initial 中)。
其实,如果begin-end / fork-join 规定的串行/并行 跟 blocking / nonblocking 规定的阻塞/非阻塞交叉产生的效果。
verilog behavioral modeling--blocking and nonblocking的更多相关文章
- verilog behavioral modeling --procedural assignments
1.procedural assignments are used for updating reg ,integer , time ,real,realtime and memory data ty ...
- verilog behavioral modeling ---Block statements
block statements : 1. sequential block : begin-end block 2.parallel block : fork - join bloc ...
- verilog behavioral modeling --loop statement
1.forever 2.repeat 3.while 4.for The for statement accomplishes the same results as the following ps ...
- Atitit 五种IO模型attilax总结 blocking和non-blocking synchronous IO和asynchronous I
Atitit 五种IO模型attilax总结 blocking和non-blocking synchronous IO和asynchronous I 1.1. .3 进程的阻塞1 1.2. 网络 ...
- verilog behavioral modeling--overview
1.verilog behavioral models contain procedural statements that control the simulation and manipulate ...
- 同步IO与一部IO、IO多路复用(番外篇)select、poll、epoll三者的区别;blocking和non-blocking的区别 synchronous IO和asynchronous IO的区别
Python之路,Day9 , IO多路复用(番外篇) 同步IO和异步IO,阻塞IO和非阻塞IO分别是什么,到底有什么区别?不同的人在不同的上下文下给出的答案是不同的.所以先限定一下本文的上下文. ...
- verilog behaviral modeling -- procedural timing contronls
1.delay control : an expression specifies the time duration between initially encountering the state ...
- blocking and nonblocking assign
key word: 仿真建模 clock采样block/nonblock blocking时,有时候clk会sample edge后的data: nobocking时,clk sample 以前的d ...
- verilog behavioral modeling--branch statement
conditional statement case statement 1. conditional statement if(expression) statement_o ...
随机推荐
- samba服务器实验指导
第一节.samba是干什么的?它有什么用? Samba(SMB是其缩写) 是一个网络服务器,它是Linux作为本地服务器最重要的一个服务,用于Linux和Windows共享文件之用:Samba可以用于 ...
- PostgreSQL-7-数据连接
1.通过WHERE进行简单连接 SELECT * FROM company3,department 不添加WHERE将会显示所有数据 SELECT * FROM company3,departmen ...
- TCP长链接调试利器nc
最近做了不少TCP长链接的开发,包括服务端和客户端.本人感觉服务器端与客户端通信时最好采用字符串形式,这样可以做要平台无关,跨语言.如果采用对象序列化机制通用性会较差.另外采用字符串形式用nc调试很方 ...
- Python常用模块之hashlib(加密)
Python常用模块之hashlib(加密) Python里面的hashlib模块提供了很多加密的算法,这里介绍一下hashlib的简单使用事例,用hashlib的md5算法加密数据import ha ...
- siege官方文档(译)(一)
WHAT IS siege? Siege is an open source regression test and benchmark utility. Siege是一款开源回归测试和基准测试工具. ...
- IE和火狐下的iframe刷新
前面使用了前端上传插件plupload,在谷歌浏览器中运行完全没问题,但是在IE和火狐下就出现当文档加载完成之后,该文件上传的iframe插件的上传按钮点击无效,当对上传的文件进行一次删除之后,按钮就 ...
- [Tomcat]如何清理缓存
步骤: 1.进入tomcat文件夹 2.找到work目录 3.work目录下有个catalina目录 4.将catalina目录整个删除
- mysql 存在更新,不存在插入
String sql = "insert into wb_result " + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ...
- WPF知识点全攻略03- XAML
XAML 是一种声明性标记语言,XAML 是一种基于 XML 并对 XML 结构规则进行了扩展. XAML特点: 定义应用程序的界面元素 显示的声明WPF资源(样式.模板.动画等) 可扩展性(自定义U ...
- CPP-基础:关于引用
1.什么是“引用”?申明和使用“引用”要注意哪些问题? 引用就是某个目标变量的“别名”(alias),对应用的操作与对变量直接操作效果完全相同. 申明一个引用的时候,切记要对其进行初始化. 引用声明完 ...