集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 6064|回复: 2

请verilog高手帮忙看看

[复制链接]
CCIE 发表于 2010-6-28 00:28:20 | 显示全部楼层 |阅读模式
本帖最后由 fpgaw 于 2010-7-12 11:34 编辑

module ram_c_count256(clk,rst,en,count256);
input clk;
input rst;
input en;
output [7:0]count256;
reg [7:0]count256;

always@(posedge clk or negedge rst or posedge en)
begin
if(!en)
  count256<=8'd0;
else if(rst)
  count256<=8'd0;
else if(count256==8'd255)
  count256<=8'd0;
else
  count256<=count256+8'd1;
end

endmodule
编译时提醒有序错误
Error: Verilog HDL Conditional Statement error at ram_c_count256.v(10): cannot match all operands in the condition expression to corresponding edges in the enclosing Always Construct's Event Control
Error: Verilog HDL Conditional Statement error at ram_c_count256.v(13): cannot match all operands in the condition expression to corresponding edges in the enclosing Always Construct's Event Control
Warning: Verilog HDL Always Construct warning at ram_c_count256.v(16): variable "count256" is read inside the Always Construct but isn't in the Always Construct's Event Control
Error: Verilog HDL Conditional Statement error at ram_c_count256.v(16): cannot match all operands in the condition expression to corresponding edges in the enclosing Always Construct's Event Control
Warning: Verilog HDL Always Construct warning at ram_c_count256.v(19): variable "count256" is read inside the Always Construct but isn't in the Always Construct's Event Control
Warning: Verilog HDL warning at ram_c_count256.v(19): can't infer register for Procedural Assignment in Always Construct because the clock signal isn't obvious. Generated combinational logic instead.
Error: Can't elaborate user hierarchy ""
Error: Quartus II Analysis & Synthesis was unsuccessful. 4 errors, 3 warnings
    Error: Processing ended: Wed May 09 16:55:38 2007
    Error: Elapsed time: 00:00:06
请问该怎么改?
Error: Quartus II Full Compilation was unsuccessful. 4 errors, 3 warnings
longtim 发表于 2010-6-28 01:05:18 | 显示全部楼层
低电平异步复位和高电平异步使能的表达有问题<br>
列表中negedge rst所对应的if条件是!rst,不是rst<br>
列表中posedge en所对应的if条件使en,不是!en
wangxi 发表于 2014-4-11 16:26:58 | 显示全部楼层
longtim 发表于 2010-6-28 01:05
低电平异步复位和高电平异步使能的表达有问题
列表中negedge rst所对应的if条件是!rst,不是rst
列表中pose ...

太好了!解决了一个大问题!
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-6-21 20:48 , Processed in 0.094735 second(s), 24 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表