N
news.la.sbcglobal.net
Guest
I'm trying to simulate 'X' propogation through an enum-encoded
state-machine. But I can't seem to make this work. I've make sure the
typedef is based on a 4-state variable, but it won't initialize to 'X', nor
can I assign 'X' to it.
What am I doing wrong?
module foo;
typedef enum logic [3:0] { STATE_1=4'd0, STATE_2, STATE_3, STATE_4 }
t_statevector;
t_statevector present_state, next_state;
initial begin
// at time 0: simulator initializes present_state = STATE_1;
present_state = 'x; // COMPILE-ERROR!
end
endmodule
state-machine. But I can't seem to make this work. I've make sure the
typedef is based on a 4-state variable, but it won't initialize to 'X', nor
can I assign 'X' to it.
What am I doing wrong?
module foo;
typedef enum logic [3:0] { STATE_1=4'd0, STATE_2, STATE_3, STATE_4 }
t_statevector;
t_statevector present_state, next_state;
initial begin
// at time 0: simulator initializes present_state = STATE_1;
present_state = 'x; // COMPILE-ERROR!
end
endmodule