always语句下如果有判断语句if,那么if语句中的条件必须有always中的敏感变量。

否则错误提示为:Error (10200): Verilog HDL Conditional Statement error at ……: cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct

比如           always@(posedge CLK or negedge RSTn)

表明在clk上升沿或r_est下降沿这两个敏感事件发生时always语句块得以触发;而always中的if条件语句必须至少有一个条件指向其中一个敏感事件(边界标识符);所以写成“if(r_est)...else...”就会出错。

可以将    always@(posedge CLK or negedge RSTn)  改为  always@(posedge CLK or posedge  RSTn)  编译就没问题了。

错误原因:

CAUSE: In a conditional statement at the specified location in a Verilog Design File (.v), you specified a condition that Quartus II Integrated Synthesis cannot use to classify the edges in the enclosing always construct's event control. When an event control contains multiple edges, Quartus II Integrated Synthesis distinguishes the asynchronous control signals from the clock by analyzing the conditional statements in the always construct. For example, the following code fragment contains an always construct whose event control contains three edges---two asynchronous resets and a clock.
always @ (posedge clk or posedge rst1 or posedge rst2)
begin
   if ( rst1 || rst2 )
      q <= 1'b0;
  else
      q <= d;
end
Quartus II Integrated Synthesis uses the if condition to identify the two asynchronous resets and, by implication, the clock. For edge classification, Quartus II Integrated Synthesis requires that a condition fall into one of two categories. It can refer to a single edge identifier (to match posedge events) or its complement (to match negedge events), for example, rst1, !rst1, rst1 == 1'b1, rst1 == 1'b0. It can also OR two or more expressions that each refer to a single edge identifier or its complement, for example, (rst1 || rst2), (!rst1 || !rst2).
You can receive this error if your condition tests for the wrong polarity, or if it tests for the value of a variable that is not an edge in the event control. For example, to match a posedge rst event, the condition must be rst or rst = 1'b1.
Finally, you can receive this error if you are attempting to use a single condition expression to test for both an asynchronous reset/set and a synchronous reset/set condition. The following code fragment contains an example of an illegal condition expression:
always @ (posedge clk or posedge rst)
begin  
if ( rst || sync_rst )
      q <= 1'b0;  
else
      q <= d;
end
Quartus II Integrated Synthesis generates this error message when compiling this design because it cannot match sync_rst to an edge on the sensitivity list.

原因:……指定了一个条件,Quartus II 综合器不能够将该条件用于在封闭的always结构的事件控制中对边界进行区分。当一个事件控制中包含多重边界,Quartus II 综合器通过分析always结构中的条件语句来对时钟和异步控制信号加以区分。

Quartus II 综合器采用if条件来鉴别两个异步reset信号,并隐含地鉴别了clock信号。为了分类的需要,Quartus II 综合器需要有一个条件落入两个类别之一。它可以指向一个单独的边界标识符(以匹配posedge事件)或它的补语(以匹配negedge事件),例如, rst1, !rst1, rst1 == 1'b1, rst1 == 1'b0。它也可以是OR两个或更多的表达式,其中每一个指向一个单独的边界标识符或它的补语……
当你的条件测试发现错误极性,或者它测试变量的值,但该值在事件控制中并不是一个边界时,你会接到这个错误。例如,为了匹配一个posedge rst事件,条件必须是rst或rst = 1'b1。

always中的敏感变量的更多相关文章

  1. 血淋淋的事实告诉你:你为什么不应该在JS文件中保存敏感信息

    在JavaScript文件中存储敏感数据,不仅是一种错误的实践方式,而且还是一种非常危险的行为,长期以来大家都知道这一点. 而原因也非常简单,我们可以假设你为你的用户动态生成了一个包含API密钥的Ja ...

  2. Spring Boot 配置中的敏感信息如何保护?

    在之前的系列教程中,我们已经介绍了非常多关于Spring Boot配置文件中的各种细节用法,比如:参数间的引用.随机数的应用.命令行参数的使用.多环境的配置管理等等. 这些配置相关的知识都是Sprin ...

  3. 关于ibatis中mysql的@变量问题作用域、污染问题

    搞了1天,过程不想多说,结论如下: ibatis.net 是有连接池的,用ab.exe 并发测试,可以测出默认的max连接数 ibatis.net的数据操作 xml 中可以用@变量,也就是 Sessi ...

  4. [.net 面向对象编程基础] (5) 基础中的基础——变量和常量

    [.net面向对象编程基础]  (5) 基础中的基础——变量和常量 1.常量:在编译时其值能够确定,并且程序运行过程中值不发生变化的量. 通俗来说,就是定义一个不能改变值的量.既然不能变动值,那就必须 ...

  5. 解决ambiguous symbol命名空间中类名、变量名冲突的问题

    最近在将一个复杂的工程集成到现有的项目中.编译时发现,有的变量名冲突了,提示就是xxxx ambiguous symbol,并且在编译输出时,指明了两个文件当中特定的变量名或者类名相同.出现这个编译错 ...

  6. OC中的私有变量和description

    .OC中的私有变量 在类的实现即.m @implementation中也可以声明成员变量,但是因为在其他文件中通常都只 是包含头文件而不会包含实现文件,所以在.m文件中声明的成员变量是@private ...

  7. JS中的 公有变量、私有变量 !

    公有变量.私有变量 ! 初学者的见解,算是记录学习过程,也算是分享以便共同成长,如有不正确的地方,还请不吝赐教! 先看代码1: function car(){ var wheel = 3; //私有变 ...

  8. CI控制器中设置在其它方法中可用的变量

    开发过程中,某些变量可能需要被控制器中的其它方法所调用,这个变量改怎么设置呢? 其实可以用ci的$this->load->vars($array);和$this->load-> ...

  9. C++中使用初始化列表比在构造函数中对成员变量赋值更高效

    这是在面试中遇到的一个问题,没有答出来,后来上网上查了一些资料,终于弄明白了: 一.首先c++标准规定成员变量必须在调用构造函数前进行初始化(这一点很重要) 二.如果我们在构造函数中对成员变量进行初始 ...

随机推荐

  1. 助你了解react的小demo

    React是个啥 React 是一个用于构建用户界面的 JAVASCRIPT 库. React主要用于构建UI,很多人认为 React 是 MVC 中的 V(视图). React 起源于 Facebo ...

  2. 记Javascript的编写方式的全新学习

    前言 这次有幸参与前端的工作,对于前端开发学习了不少新知识,在此记录一下相比之前,完全不同的Javascript编写方式. 原来的编写方式 之前也是写过Javascript,就是常见的.js 文件写函 ...

  3. KODExplorer可道云-轻松搭建属于自己/团队的私有云网盘服务

    如今国内各大网盘关停的也快差不多,百度网盘限速严重.国外大牌的如 Dropbox 或 Google Drive又在长城之外,在各种VPN都被封禁的大背景下,科学上网也困难重重,麻烦到要死.那么,除了购 ...

  4. '@P0'附近有语法错误

    做一个分页查询功能,使用到了TOP #{pagenum}然后就报错了.'@P0'附近有语法错误 未解决:#{pagenum}改成${pagenum},但是mybatis报参数未找到错误, 解决:将对应 ...

  5. Java设计模式相关面试

    1.接口是什么?为什么要使用接口而不是直接使用具体类? 接口用于定义 API.它定义了类必须得遵循的规则.同时,它提供了一种抽象,因为客户端只使用接口,这样可以有多重实现,如 List 接口,你可以使 ...

  6. TF30042: The database is full. Contact your Team Foundation Server administrator.

    TF30042: The database is full. Contact your Team Foundation Server administrator. 在一个阳光明媚的下午,迁入代码的时候 ...

  7. MySQL索引与Index Condition Pushdown

    实际上,这个页面所讲述的是在MariaDB 5.3.3(MySQL是在5.6)开始引入的一种叫做Index Condition Pushdown(以下简称ICP)的查询优化方式.由于本身不是一个层面的 ...

  8. 激光相机数据融合(5)--Gazebo仿真数据融合

    这一节将用ROS+Gazebo 环境获取激光获取点云,并用PCL和OPENCV处理,源代码在:https://github.com/ZouCheng321/5_laser_camera_sim 由于激 ...

  9. vue 组件中数组的更新

    今天写项目时遇到的问题,瞬间就卡在那了 来还原一下: parent.vue: <template> <div> <button @click="change&q ...

  10. AES高级加密标准简析

    1 AES高级加密标准简介 1.1 概述 高级加密标准(英语:Advanced Encryption Standard,缩写:AES),在密码学中又称Rijndael加密法,是美国联邦政府采用的一种区 ...