Home > Community > Forums > Functional Verification > passing events as parameters to methods or TCM

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

 passing events as parameters to methods or TCM 

Last post Thu, Oct 4 2012 5:11 AM by hannes. 1 replies.
Started by jaichandra 09 Sep 2012 06:41 PM. Topic has 1 replies and 817 views
Page 1 of 1 (2 items)
Sort Posts:
  • Sun, Sep 9 2012 6:41 PM

    passing events as parameters to methods or TCM Reply

    Hi everyone,

                   Is it possible to pass events to a method or TCM in e language? I have a TCM which emits events based on some register settings.

       I have five such registers and each register does the same function but on different group. Initially i thought of creating a list of events and pass the index number to the TCM and it can emit the respective event. But i belive e do not support list of events. So i was checking if it is possible to pass events as parameters to the TCM and there is nothing mentioned about this in e ref manual.

      Can someone share some information if it is possible or is there any work around? Thanks in advance for your help.

    • Post Points: 20
  • Thu, Oct 4 2012 5:11 AM

    • hannes
    • Top 150 Contributor
    • Joined on Fri, Nov 14 2008
    • Bracknell, Berkshire
    • Posts 50
    • Points 895
    Re: passing events as parameters to methods or TCM Reply

    Hello Jaichandra,

    events are not really types so you can't pass them. What you can do is a pass a list of structs/units which contain events. Depending on your condition you can then emit the events of the struct/unit in question. For example:
    type my_t: [T1, T2, T3];
    struct reg {
        event reg_ev;
    };
    unit foo {
        my_regs[3]: list of reg;
        
        my_tcm(regs:list of reg,flag:my_t)@sys.any is {
            case flag {
                T1: {emit regs[0].reg_ev;};
                T2: {emit regs[1].reg_ev;};
                T3: {emit regs[2].reg_ev;};
            };
            wait [1];
            stop_run();
        };
        run() is also {
            start my_tcm(my_regs,T2);
        };
    };

    Regards
    -hannes

    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by jaichandra at 09 Sep 2012 06:41 PM. Topic has 1 replies.