bongosontan
Newbie level 6

Hi, I am testing a verilog code which has the following structure:
reg a;
wire b;
always @(posedge clk) begin a <= b; end
wire c = a ^ 1 ;
assign b = c ^ 1 ;
But all a, b and c are coming as undefined in the behavioral simulation. This is a part of a bigger code, after debugging the signals one by one, I noticed that this part is causing the problem. 'c' never acquires a valid value. I have tried giving a, b and c some initial value also, same result. I am not understanding what is causing this error. It would be very helpful to hear some suggestions. Thanks in advance!
reg a;
wire b;
always @(posedge clk) begin a <= b; end
wire c = a ^ 1 ;
assign b = c ^ 1 ;
But all a, b and c are coming as undefined in the behavioral simulation. This is a part of a bigger code, after debugging the signals one by one, I noticed that this part is causing the problem. 'c' never acquires a valid value. I have tried giving a, b and c some initial value also, same result. I am not understanding what is causing this error. It would be very helpful to hear some suggestions. Thanks in advance!