Home > Community > Forums > Functional Verification > assertion in e

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: *

 assertion in e 

Last post Tue, Dec 20 2011 12:10 AM by hannes. 5 replies.
Started by redrabbit 13 Dec 2011 06:16 PM. Topic has 5 replies and 3689 views
Page 1 of 1 (6 items)
Sort Posts:
  • Tue, Dec 13 2011 6:16 PM

    • redrabbit
    • Top 500 Contributor
    • Joined on Tue, Nov 22 2011
    • Posts 26
    • Points 385
    assertion in e Reply

    hi,all

        i've no idea about how to write expect/assume  with e language......

    code is like this:

       event a_ev;

       expect  a_ev is

       @b_ev => TE @default_sample_event

       else dut_error("XXXXX");

     

      on a_ev

      {

           ev_cnt+=1;

          message(LOW,"XXXXXXX");

      }

     

    i run the simulation,the log does not contain the ev_cnt info.......and the assertion of a_ev has passed, not menthion  that compile phase has passed.so,what happened????does the assertion of e really work?or the event is not emitted?????

      

    • Post Points: 50
  • Wed, Dec 14 2011 12:02 PM

    • tpylant
    • Top 50 Contributor
    • Joined on Fri, Jul 11 2008
    • Austin, TX
    • Posts 135
    • Points 2,030
    RE: assertion in e Reply
    You can use the Specman wave command to look at the events in the waveform viewer.

                    specman> wave –event <path to instance containing events>

    The wave command will probe the waves and add them to the waveform viewer (assuming you’re in GUI mode).

     

    Tim
    • Post Points: 5
  • Mon, Dec 19 2011 8:03 AM

    • hannes
    • Top 150 Contributor
    • Joined on Fri, Nov 14 2008
    • Bracknell, Berkshire
    • Posts 43
    • Points 785
    Re: assertion in e Reply

     Hello redrabbit,

    I think a basic spmn training class would be really helpful. Questions like this one and others
    you've submitted recently would be answered there...

    Specifically to the above, a_ev doesn't seem to be emitted anywhere, so as you rightly notice
    it doesn't ever happen. Looking at the code, maybe you wanted to cover (i.e. count) when this
    expect has triggered. You can do this in 2 ways:

    1) set_config(cover,collect_checks_expects,TRUE) => this will give you coverage on expects, i.e. tell you
       whether this check was ever triggered

    2) you can have an exect statement after the trigger even (just like an on block) like this:
       expect  a_ev is

       @b_ev exec {ev_cnt+=1;message(LOW,"XXXXXXX");}   => TE @default_sample_event

       else dut_error("XXXXX");

    Best regards,
    -hannes

     

    Filed under: ,
    • Post Points: 5
  • Mon, Dec 19 2011 8:19 AM

    • hannes
    • Top 150 Contributor
    • Joined on Fri, Nov 14 2008
    • Bracknell, Berkshire
    • Posts 43
    • Points 785
    Re: assertion in e Reply

     Another thing I forgot to mention. The event a_ev is a different thing from the expect a_ev.
    You've used a named expect (expect a_ev is ....). You're allowed to do that in e, since
    the event and the expect are 2 syntatically different things. Again, fo an on block on the
    expect, just use the exec{} clause

    -hannes

    Filed under: , ,
    • Post Points: 20
  • Mon, Dec 19 2011 6:15 PM

    • redrabbit
    • Top 500 Contributor
    • Joined on Tue, Nov 22 2011
    • Posts 26
    • Points 385
    Re: assertion in e Reply

    that is to say  the event-name in expect is not the event.i define the event without explicit temporal expression,then expect it with a certain TE, the event should never occur????

    • Post Points: 20
  • Tue, Dec 20 2011 12:10 AM

    • hannes
    • Top 150 Contributor
    • Joined on Fri, Nov 14 2008
    • Bracknell, Berkshire
    • Posts 43
    • Points 785
    Re: assertion in e Reply

    Yes, the event has nothing whatsoever to do with the expect. every event occurs when it is emitted or if the temporal expression of the EVENT succeeds.you seem to think that the name associates the event with the expect. This is not the case. If you want an event on a temporal expression just do "event xyz is TE"
    -hannes

    Filed under: ,
    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by redrabbit at 13 Dec 2011 06:16 PM. Topic has 5 replies.