|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
源码如下:
module S_counter_new(clk_in, rst, s_cnt, mod);
input clk_in, rst;
input [2:0] s_cnt;
output mod;
reg [2:0] cnt = 0;
reg mod = 1;
always @ (negedge rst)
begin
cnt <= 0;
end
always @ (posedge clk_in)
begin
if (cnt < s_cnt) begin
mod <= 1;
cnt <= cnt + 1;
end else begin
mod <= 0;
end
end
endmodule
现在我想实现rst信号出现下降沿的时候,cnt被清零。但是用于DC综合不能再两个always块中同时对cnt进行赋值操作。那怎么处理呢?
注意是要rst异步清零,各位大佬求帮忙!
|
|