s*******y 发帖数: 44 | 1 在修改一个别人写的状态机。
always @ (posedge clk or posedge reset)
begin
if(reset) begin
enable <= 0;
.........
end
else begin
case (state)
.......
enable <= some logic;
endcase
end
end
这样就没有错误信息。
可是如果写成
always @ (posedge clk or posedge reset)
begin
if(reset) begin
enable <= 0;
.........
end
else state <= next_state;
end
always @ (sensitivity list)
begin
case (state)
........
enable = some logic;
endcase
end | j***j 发帖数: 324 | 2 it is pretty clear, you have multi-source on "enable".
simply to say, normally you can not set the value for the same variable ("
enable") in two "always" blocks. I think you can figure out WHY by yourself. |
|