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. 【Dart学习】-- Dart之注释

    Dart支持三种注释类型: 单行注释,多行注释,文档注释. 单行注释单行注释以//开头,从//开始到一行结束的所有内容都会被Dart编译器忽略,示例代码如下: main(){ //打印输出 print ...

  2. NGINX配置之一:日志篇

    打开nginx.conf配置文件: vi /usr/local/nginx/conf/nginx.conf 日志部分内容: 日志生成的到Nginx根目录logs/access.log文件,默认使用“m ...

  3. CF 1097D - Hello 2019 D题: Makoto and a Blackboard

    目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 Catalog Problem:传送门  Portal  原题目描述在最下面.  给一个数n ...

  4. CSS:CSS Display(显示) 与 Visibility(可见性)

    ylbtech-CSS:CSS Display(显示) 与 Visibility(可见性) 1.返回顶部 1. CSS Display(显示) 与 Visibility(可见性) display属性设 ...

  5. (53)C# 工具

    https://docs.microsoft.com/zh-cn/dotnet/framework/tools/ildasm-exe-il-disassembler 一.Visual Studio的开 ...

  6. 3、获取APP 内存占用率

    关于APP内存占用,不用多说,应该是APP性能测试中比较重要的一点.试想一下,开个应用把手机内存占满了,其它应用无法打开,那么这个应用还会有人安装吗?我觉得是没有的.下面就通过adb命令获取APP虚存 ...

  7. setjmp与longjmp的分析

    #include <setjmp.h> int main(int argc, const char* argv[]) {   jmp_buf buf = {0,}; int k = 0; ...

  8. 2019杭电多校第三场hdu6606 Distribution of books(二分答案+dp+权值线段树)

    Distribution of books 题目传送门 解题思路 求最大值的最小值,可以想到用二分答案. 对于二分出的每个mid,要找到是否存在前缀可以份为小于等于mid的k份.先求出这n个数的前缀和 ...

  9. PAT_A1070#Mooncake

    Source: PAT A1070 Mooncake (25 分) Description: Mooncake is a Chinese bakery product traditionally ea ...

  10. 拾遗:Go 基础

    这 Go,越看越像是 C 和 Python 的混合体--! gofmt 用于格式化代码,缩进使用 tab,而不是空格:Python 官方则建议使用空格,而不是 tab package Go 惯例,使用 ...