我是 SystemVerilog 的新手,我使用 Icarus Verilog。我正在尝试设计一个简单的 FSM 来练习,但我不断收到此错误:
错误:赋值语句左值中的语法
module primoex (input logic clk, reset, x,
output logic y);
enum reg [1:0] {S0, S1, S2} stati;
reg [1:0] stato, statoprox;
always_ff@(posedge clk, posedge reset)
if(reset) stato = S0;
else stato <= statoprox;
always_comb
case (stato)
S0: statoprox = x? S1 : S0;
S1: statoprox = x? S2 : S0;
S2: statoprox = x? S2 : S0;
default= S0;
endcase
assign y = S1 & ~S0;
endmodule