Hello All, Do the below code is legal? becuase i was in the assumption that the below code will work, but when we tried the same code with NCSIM6.1 version it gave an error and the error was mailbox should not be declared inside initial block. program test(); initial begin mailbox mbx; // mailbox inside initial block not supported by ncsim mbx = new(); endSundar
program test(); initial begin mailbox mbx; // mailbox inside initial block not supported by ncsim mbx = new(); end
Hi Sundar.Is your example representative of the real use model?If you really are trying to declare the mailbox at the top of an initial block, then why not put it into the program itself?Putting it into the initial doesn't really give you any benefit, so far as I can see...As for whether it's legal, I don't see any obvious reason why not, but I also don't see why you'd put a mailbox there anyway.
Adding to what Steve has said, since your initial block is unnamed, you can't even use Hierarchical access to refer to the Mailbox from outside the initial block - who will be the receiving party of this mailbox then?Ajeetha, CVCwww.noveldv.com
If you move the mailbox declaration out of the initial block, it compiles correctly:program test();mailbox mbx;initial begin mbx = new();endendprogram