verilog异步触发问题
两个敏感信号,a,b,其中我要b信号实现异步触发请问高手我能否这样写
reg c;
regcount
always @(posedge a or posedge b)
begin
count<=count+1;
temp<=16'h1234;
if(b==1)
begin
c <=temp;
end
end
为什么提示这个错误:The logic for count does not match a standard flip-flop 乱七八糟,不明白楼主写这段代码要实现一个什么功能?为什么没有时钟? 最好把整个源程序贴出来看看! 你的c跟a无关吗?,<br>
那就把c单独拿出来放在以b为敏感表的always块里。<br>
另外你定义count时末尾少了;<br>
不知道是不是这个原因导致error。 应该视位宽定义和后面的1宽度不同造成的吧 我作仿真时也出过“The logic for count does not match a standard flip-flop ”类似的问题,<br>
可能是信号“C”在多于一个模块中赋值的问题。有整个的程序吗? c <=temp;<br>
这里temp是什么东西,有没有declare,temp又想实现什么功能? 楼主最好给个全的代码!不然别人看不懂的,也没法帮你解决问题! 这个程序 没有能够看明白 。。。 module register (c,a,b,rst);<br>
output c;<br>
input a,b,rst;<br>
wire temp;<br>
reg c;<br>
regcount;<br>
assign temp=16'h1234;<br>
always @(posedge a or posedge b or posedge rst) begin<br>
if(rst) begin<br>
count<=0;<br>
c<=0;<br>
end<br>
else<br>
if (a) <br>
count<=count+1;<br>
else<br>
if(b) <br>
c <=temp ; <br>
end <br>
endmodule<br>
<br>
揣摩楼主的用意,写了段代码,请大家指正了~
页:
[1]