zoukankan      html  css  js  c++  java
  • 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 规定的阻塞/非阻塞交叉产生的效果。

  • 相关阅读:
    配置OSPF负载分担
    IPv4静态路由与NQA联动
    静态路由实现路由负载分担
    静态路由实现主备备份
    (一)非整数幂情形下的广义牛顿二项式定理
    小小知识点(二十三)被科研人员忽略的ORCID —— 如何注册和使用?意义何在?
    小小知识点(二十二)word 排版技巧大全
    小小知识点(二十一)Mathtype怎么批量更改全文的公式格式
    小小知识点(十九)如何破解安装编辑PDF文本的软件——福昕编辑器和Adobe acrobat DC
    (三十二)5G前传、中传和回传
  • 原文地址:https://www.cnblogs.com/chip/p/4073778.html
Copyright © 2011-2022 走看看