Home > Community > Forums > Functional Verification > Mailbox inside initial blocks

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Mailbox inside initial blocks 

Last post Tue, Jul 31 2007 12:46 AM by archive. 3 replies.
Started by archive 31 Jul 2007 12:46 AM. Topic has 3 replies and 1383 views
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, Jul 31 2007 12:46 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    Mailbox inside initial blocks Reply

    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();
            end


    Sundar


    Originally posted in cdnusers.org by sundar_80
    • Post Points: 0
  • Tue, Jul 31 2007 4:38 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Mailbox inside initial blocks Reply

    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.


    Originally posted in cdnusers.org by stephenh
    • Post Points: 0
  • Tue, Jul 31 2007 6:41 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Mailbox inside initial blocks Reply

    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, CVC
    www.noveldv.com


    Originally posted in cdnusers.org by ajeetha
    • Post Points: 0
  • Fri, Aug 3 2007 8:40 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Mailbox inside initial blocks Reply

    If you move the mailbox declaration out of the initial block, it compiles correctly:

    program test();

    mailbox mbx;

    initial begin
    mbx = new();
    end

    endprogram


    Originally posted in cdnusers.org by tpylant
    • Post Points: 0
Page 1 of 1 (4 items)
Sort Posts:
Started by archive at 31 Jul 2007 12:46 AM. Topic has 3 replies.