Prime numbers constraint

In reply to nitin4natu:

Verilog allows you to use the name of the function as an implicit variable storing the return value. If you exit the function without using return, that value becomes the returned value. In this case, prime=g; is the same as return g;

Note that prior to SystemVerilog, the return construct did not exist. so you had to make an assignment to the implicit variable.