Q2,怎么去掉透明锁存器的警告?

[复制链接]
3719|1
 楼主| aceice 发表于 2010-9-14 16:11 | 显示全部楼层 |阅读模式
代码如下:
input input_data;
reg uploader;

always @ (posedge clk or posedge cs or posedge  wr)
begin
    if(cs)
        ......

    else if(wr)
        ......
        uploader <= input_data;
        ......

    else
        ......
        if(counter < uploader)
            ......
        ......
  end

除了wr有效的时候更新uploader寄存器外,其它敏感变量变化时,uploader保持不变。
但是在另外的分支中需要用到uploader给另外一个寄存器赋值。
Warning (10240): Verilog HDL Always Construct warning at <modulename>(xx): inferring latch(es) for variable "uploader", which holds its previous value in one or more paths through the always construct
怎么消除这个警告?
ar_dong 发表于 2010-9-15 08:56 | 显示全部楼层
这个属于异步置数,如果改为同步置数是不是就解决问题了啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

374

主题

2182

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部