Conditional statement cannot determine unknown value during pre-reset phase

Hi,

I have a problem on controlling the unkown value during pre-reset phase.
In pre-reset phase, I made all inputs to the DUT to have a value of `x.
However, my monitor is having an infinite loop on the forever block because the conditional statement in my monitor code cannot determine this unkown value.

This is the code in my monitor:

============================================================
$display(“Waiting for pre-reset to finish”);
@(posedge sigs.rstb); // This part cannot detect unkown value so the program just goes on

// The @(posedge sigs.data_in) cannot detect unkown value so the program goes in infinite loop
forever begin
@(posedge sigs.data_in) begin
// Some codes here

end
end

So, can you guys give me some advice on how to correctly code this one so the infinite loop will not happen when the value to be evaluated is unkown? :)

Thank you. :)

Regards,
Reuben

Hello Reuben,

I think you just have to use 3 equal signs for the conditional statement,
sample:

if(var === 1’bx) begin

end

regards,
edward

In reply to edwardestrella:

Hi Edward,

Thanks for the advice! :)

You seems to have a vast experience in verification!

You’re a pro! :)

Regards,
Reuben