stone_xiyi 发表于 2010-11-24 21:09:12

关于always @ () 的问题

always @(posedge clk or posedge busy or negedge reset_n) begin
       if (reset_n == 1'b0)
                begin
                        busy_posedge_reg <= 1'b0;
                end
       else if(stage_reg == EDLE)
                begin
                        busy_posedge_reg <= 1'b0;
                end       
       else
                begin
                        busy_posedge_reg <= 1'b1;
                end
end

代码如上,目的是为了记录busy信号的上升沿,同时在EDLE状态或者复位时对busy_posedge_reg寄存器清零 ,在Modelsim中仿真没有问题,但是在Quartus II中综合,错误提示如下,请各位给点帮助

Error (10200): Verilog HDL Conditional Statement error at s1_slave.v(176): cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct

ngzhang 发表于 2010-11-25 02:03:40

因为计算姬说你写的这玩意她没法给你搞成硬件。

90999 发表于 2010-11-25 02:15:26

LS头像不是东方笨蛋⑨么?

stone_xiyi 发表于 2010-11-25 09:43:33

回复【1楼】ngzhang 兽哥
-----------------------------------------------------------------------
那么所描述的功能应该怎么写计算机才能给我弄成硬件呢?

470036398 发表于 2010-11-25 12:18:47

http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=4409079&bbs_page_no=1&search_mode=4&search_text=470036398&bbs_id=9999

Ian11122840 发表于 2010-11-25 15:54:29

在error上右键 可以看看帮助

ngzhang 发表于 2010-11-27 00:16:49

回复【3楼】stone_xiyi
回复【1楼】ngzhang 兽哥
-----------------------------------------------------------------------
那么所描述的功能应该怎么写计算机才能给我弄成硬件呢?

-----------------------------------------------------------------------

always@ 后面,只描述一个时钟敏感沿,需要时可以有一个reset敏感沿。
下面跟着就是if (reset 条件),然后写reset的内容。
然后else,开始处理其他输入。
只要你这么写,没有综合不了的东西。
页: [1]
查看完整版本: 关于always @ () 的问题