YuLongHuang
Member level 5
- Joined
- Dec 28, 2010
- Messages
- 84
- Helped
- 16
- Reputation
- 32
- Reaction score
- 16
- Trophy points
- 1,288
- Location
- Taipei, Taiwan
- Activity points
- 1,915
HI~!
I'd like to make sure one thing and listen what you have thought.
What would happened if unknown is shown in equality operand during RTL simulation ?
for example, what happened to r if a, b, c become unknown in following description ?
always @ ( posedge clk or posedge rst )
if ( rst )
r <= 0;
else
if ( a == 0 | b == 0 )
r <= 1;
else if ( c == 1 )
r <= 1;
According to my simulator, the result is that r will keeps the same value as last clock edge.
More specifically, the if ( ...... ) will be skipped if the operand is unknown.
Therefore, if a, b, c become unknown, r will hold the previous value instead of becoming unknown.
This behavior is inconsistent with the result of post-layout simulation.
There is no such problem since it's netlist during post-sim.
How do you think about ?
Of course it's more related to how Verilog standard is defined.
I'd like to make sure one thing and listen what you have thought.
What would happened if unknown is shown in equality operand during RTL simulation ?
for example, what happened to r if a, b, c become unknown in following description ?
always @ ( posedge clk or posedge rst )
if ( rst )
r <= 0;
else
if ( a == 0 | b == 0 )
r <= 1;
else if ( c == 1 )
r <= 1;
According to my simulator, the result is that r will keeps the same value as last clock edge.
More specifically, the if ( ...... ) will be skipped if the operand is unknown.
Therefore, if a, b, c become unknown, r will hold the previous value instead of becoming unknown.
This behavior is inconsistent with the result of post-layout simulation.
There is no such problem since it's netlist during post-sim.
How do you think about ?
Of course it's more related to how Verilog standard is defined.