刚学Verilog,编了下面的程序,仿真时运行出不来结果
时间:10-02
整理:3721RD
点击:
always @(FF or EF)
begin
if(!FF)
begin
WEN<=0;
Tx_Start<=1;
REN<=1;
end
if(!EF)
begin
WEN<=1;
REN<=0;
Tx_Start<=0;
end
end

begin
if(!FF)
begin
WEN<=0;
Tx_Start<=1;
REN<=1;
end
if(!EF)
begin
WEN<=1;
REN<=0;
Tx_Start<=0;
end
end

always @ ( ... sensitivity list ... ) begin
... elements ...
end
When the sensitivity list is “satisfied,” the elements inside the block are set/updated. Otherwise not.
从逻辑上看,FF和EF没有优先级,(如果FF和EF同时变化且都为低电平)导致WEN、Tx_Start和REN的值不确定。
明显是FF和EF会有信号冲突,建议多看看教材的if语句例子
你输入信号没有优先级,第一个begin没有end
