Frm: IEEE Std 1364™-2001, IEEE Standard Verilog® Hardware Description Language

Another form of procedural continuous assignment is provided by the force and release procedural statements. These statements have a similar effect to the assign-deassign pair, but a force can be applied to nets as well as to variables. The left-hand side of the assignment can be a variable, a net, a constant bit-select of a vector net, a part-select of a vector net, or a concatenation. It cannot be a memory word (array reference) or a bit-select or a part-select of a vector variable.

A force statement to a variable shall override a procedural assignment or procedural continuous assignment that takes place on the variable until a release procedural statement is executed on the variable. After the release procedural statement is executed, the variable shall not immediately change value (as would a net that is assigned with a procedural continuous assignment). The value specified in the force statement shall be maintained in the variable until the next procedural assignment takes place, except in the case where a procedural continuous assignment is active on the variable.

A force procedural statement on a net overrides all drivers of the net—gate outputs, module outputs, and continuous assignments—until a release procedural statement is executed on the net.

Releasing a variable that currently has an active procedural continuous assignment shall re-establish that assignment.

Example:

module test;
reg a, b, c, d;
wire e;
and and1 (e, a, b, c);
initial begin
$monitor("%d d=%b,e=%b", $stime, d, e);
assign d = a & b & c;
a = ;
b = ;
c = ;
#;
force d = (a | b | c);
force e = (a | b | c);
# $stop;
release d;
release e;
# $finish;
end
endmodule
Results:
d=,e=
d=,e=
d=,e=

In this example, an and gate instance and1 is “patched” as an or gate by a force procedural statement that forces its output to the value of its logical or inputs, and an assign procedural statement of logical and values is “patched” as an assign procedural statement of logical or values.

The right-hand side of a procedural continuous assignment or a force statement can be an expression. This shall be treated just as a continuous assignment; that is, if any variable on the right-hand side of the assignment changes, the assignment shall be re-evaluated while the assign or force is in effect. For example:

force a = b + f(c) ;

Here, if b changes or c changes, a will be forced to the new value of the expression b+f(c).

9.3.2 The force and release procedural statements的更多相关文章

  1. 9.3.1 The assign and deassign procedural statements

    IEEE Std 1364™-2001, IEEE Standard Verilog® Hardware Description Language The assign procedural cont ...

  2. verilog behavioral modeling--procedural continous assignment(不用)

    assign / deassgin force /release the procedural continuous assignments(using keywords assign and for ...

  3. verilog behavioral modeling --procedural assignments

    1.procedural assignments are used for updating reg ,integer , time ,real,realtime and memory data ty ...

  4. HANA SQLScript

    数据类型 日期时间类型 DATE(日期) DATE 数据类型由年.月.日信息组成,表示一个日期值. DATA 类型的默认格式为‘YYYY-MM-DD’. YYYY 表示年, MM 表示月而 DD 表示 ...

  5. 关于Verilog中的几种赋值语句

    1. 连续赋值语句(Continuous Assignments) 连续赋值语句是Verilog数据流建模的基本语句,用于对线网进行赋值,等价于门级描述,是从更高的抽象角度来对电路进行描述.连续赋值语 ...

  6. JAVA NIO FileChannel 内存映射文件

      文件通道总是阻塞式的. 文件通道不能创建,只能通过(RandomAccessFile.FileInputStream.FileOutputStream)getChannel()获得,具有与File ...

  7. udhcpc 参数使用说明

    当没有网络的时候,板子一直发送dhcp请求,导致程序不往下执行,解决的办法是把它切换到后台运行,可是如何切换到后台呢,有办法,它自带参数可以实现该功能.如下: udhcpc -b -i eth0 -p ...

  8. Verilog HDL常用的行为仿真描述语句

    一.循环语句 1.forever语句 forever语句必须写在initial模块中,主要用于产生周期性波形. 2.利用for.while循环语句完成遍历 for.while语句常用于完成遍历测试.当 ...

  9. 对Verilog 初学者比较有用的整理(转自它处)

    *作者: Ian11122840    时间: 2010-9-27 09:04                                                              ...

随机推荐

  1. php 空格,换行,跳格使用说明

    首先说说\n,\r,\t \n 软回车: 在Windows 中表示换行且回到下一行的最开始位置 在Linux.unix 中只表示换行,但不会回到下一行的开始位置. \r 软空格: 在Linux.uni ...

  2. unittest框架学习笔记五之参数化

    例子一: # coding=utf-8'''created:2018/3/29 author:star project:lianxi canshuhua'''from selenium import ...

  3. mvn eclipse:eclipse

    pom.xml 在哪个文件夹, 你就在哪里按shift 右键,,[在此处打开命令窗口]  执行那个命令. mvn eclipse:eclipse

  4. 常用内置模块(三)——shelve、xml、hashlib、configparser

    常用模块(三) 一.shelve模块 1.shelve模块也是一种序列化模块,内部使用的是pickle模块,所以也存在跨平台性差的问题 2.特点: 只要提供一个文件名即可 读写的方式和字典一样 将数据 ...

  5. jenkins构建参数

    $BUILD_NUMBER 构建序号 $WORKSPACE 工作目录 #!/bin/sh - chmod u+x mvnw./mvnw package -Pprod -Dmaven.test.skip ...

  6. 最小生成树--Prim及Kruskal

    //prim算法#include<cstdio> #include<cmath> #include<cstring> #include<iostream> ...

  7. vue on emit 父子之间传值应用详细代码

    大概很多人都知道用这个,网上教程也一大堆,但我想说的是一定要手动敲一遍,敲一遍,敲一遍,重要的事情说三遍. 大概有些人也不知道它该何时用on,或者emit 的吧? 先说两个我项目中用到的场景吧: 项目 ...

  8. 关于tp验证码模块

    转自https://blog.csdn.net/u011415782/article/details/77367280 ♜ 功能开发 1).引入第三方扩展包 进行 TP5 的开发,Composer 的 ...

  9. 22-7map

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. myEclipse环境下配置springMvc项目,进行简单的请求

    1."File-->New-->WebProject"新建一个web项目,命名为springMvc 2.将所需要用到的jar包复制到WEB-INF/lib路径下,然后右 ...