modesim 连调的问题

[复制链接]
1818|0
 楼主| 纳米小芯 发表于 2012-4-14 14:53 | 显示全部楼层 |阅读模式
//counter.v
module counter(clk,rst,counter_out);
input clk;
input rst;
output [3:0] counter_out;
reg [3:0] counter_out;
initial begin counter_out=0; end
always @(posedge clk or negedge rst)
  if(!rst)
    counter_out <= 0;
  else
    counter_out <=counter_out+1'b1;
endmodule

我的这个代码,通过quartuse 与modesim 连调的时候,CLK 一直没有变化,后来我force clk 0 0,1 50 -r 100这样,才会有CLK,但是counter_out 一直不计数,后来,我加上了
initial begin counter_out=0; end
counter_out 才开始计数的,
这个是为什么呢??请教各位大虾了!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

18

主题

36

帖子

0

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