B
bir
Guest
I have an issue regarding the if -else statement of verilog. I have my
next_st logic as below.
case (pres_st)
`IDLE : begin
if (tms==1'b0)
next_st = `IDLE;
else if (tms==1'b1)
next_st = `SEL_DR;
end
........
........
default : next_st = `IDLE
endcase
Everything worked fine here. But problem started when I slightly
modified my rtl. I replaced the "else if" statement to "else" impliying
that if its not "0" it should be "1".
case (pres_st)
`IDLE : begin
if (tms==1'b0)
next_st = `IDLE;
else
next_st = `SEL_DR;
end
........
........
default : next_st = `IDLE
endcase
Here I realized that during a particular instant in my test-bench, tms
was getting unassigned at IDLE st and my next state is getting assigned
with `SEL_DR.
Does that mean unassigned also falls into the else condition category?
Any suggestions?
Thanks
next_st logic as below.
case (pres_st)
`IDLE : begin
if (tms==1'b0)
next_st = `IDLE;
else if (tms==1'b1)
next_st = `SEL_DR;
end
........
........
default : next_st = `IDLE
endcase
Everything worked fine here. But problem started when I slightly
modified my rtl. I replaced the "else if" statement to "else" impliying
that if its not "0" it should be "1".
case (pres_st)
`IDLE : begin
if (tms==1'b0)
next_st = `IDLE;
else
next_st = `SEL_DR;
end
........
........
default : next_st = `IDLE
endcase
Here I realized that during a particular instant in my test-bench, tms
was getting unassigned at IDLE st and my next state is getting assigned
with `SEL_DR.
Does that mean unassigned also falls into the else condition category?
Any suggestions?
Thanks