Home > Community > Forums > Functional Verification > use of is_relevant() in sequences

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

 use of is_relevant() in sequences 

Last post Sun, Feb 5 2006 7:53 PM by archive. 3 replies.
Started by archive 05 Feb 2006 07:53 PM. Topic has 3 replies and 1576 views
Page 1 of 1 (4 items)
Sort Posts:
  • Sun, Feb 5 2006 7:53 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    use of is_relevant() in sequences Reply

    Hi, I recently ran into an issue related to the use of is_relevant() from within a sequence and I'd like to get some opinion on possible solutions.

    Problem: I want to use is_relevant() as a form of back-pressure to stall the enclosing sequence upon some condition. However, that condition is not known until the current item has been generated. Since 'do' is an atomic action, and is_relevant() does not allow access to the generated item as it's being 'do'ne, I'm stuck.

    We eventually ended up replacing the 'do' syntax with our own macro for doing an item. Our macros would generate the item first, set some conditions based on the results of the gen, and then invoke 'do' to pass it the item we just generated. The conditions we set right after the gen would be used to implement is_relevant().

    The work-around solves the problem, but it's cumbersome and we might run into some issues in the future should the semantics/implementation of 'do' change.

    Has anyone else ever encountered a similar problem/limitation with is_relevant()?

    cheers,

    Joseph H. Zhang
    Lead Verification Engineer
    Cisco Systems, Inc.
    (919) 392-1350


    Originally posted in cdnusers.org by jhzhang
    • Post Points: 0
  • Wed, Feb 8 2006 9:41 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: use of is_relevant() in sequences Reply

    Hello Joseph,

    You can do couple things; you can pre-generate the field of the do item or do item's field within is_relevant method, decide to start upon the generated value
    pseudo code may look like

    struct vr_pcie_tlp_pkt {
    tlp_type: tlp_type_t;
    tc: tc_t;
    };

    sequence vr_pcie_tl_seq {

    !pre_tc: tc_t;

    body()@driver.clock is {
    do pkt keeping {
    .tc == pre_tc;
    };
    };

    is_relevant():bool is {
    gen pre_tc;
    return TRUE(tc in [0..3] and tc_pipe_is_empty);
    };
    };






    Originally posted in cdnusers.org by levent
    • Post Points: 0
  • Wed, Feb 8 2006 10:08 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: use of is_relevant() in sequences Reply

    Hi Levent, thanks for the recommendations. There's a major disadvantage that made us avoid the approaches you spoke of. That is, the user who is writing the sequences now has lost control of the field in terms of constraining as part of the do, or via extending the transaction item.

    Joseph


    Originally posted in cdnusers.org by jhzhang
    • Post Points: 0
  • Wed, Feb 8 2006 10:33 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: use of is_relevant() in sequences Reply

    Hi Joseph

    Then your choice is always generate the item first.

    The advantage of is relevant is to hold the generation till the last moment thus you can generate the item per the last snap shot of the environmet/dut status , because your generation may depend on the status. Forcv example, you hold of generation of a completion until there is an valid incoming request and generate the CMPL per specifics of that request.

    Thus you need make a choice between
    giving the same constraint control to user but not being able generate per the latest status
    or
    not giving the same constraint control

    If you are OK with the first choice then (you may already do this)

    extend FOO ex_atm_sequence {

    // Items/subsequences
    !cell: ex_atm_cell;

    // The body() method
    body() @driver.clock is {
    var preprepared_cell: ex_atm_cell;
    gen preprepared_cell;
    ...
    //BLOCK until the condition is met
    wait (prepared_cell.id == 5 and pipe_status==empty)
    do cell keeping {it == preprepared_cell};
    };

    };


    In this case user still can constraint the sequence or the "prepared_cell" item as he wishes. The down side is, as I mentioned, you loose the ability of generating the cell per the latest condition of environment/dut.

    If still this wont resolve your issue please open up a service request and may be R&D experts can help you out

    Cheers
    Levent Caglar


    Originally posted in cdnusers.org by levent
    • Post Points: 0
Page 1 of 1 (4 items)
Sort Posts:
Started by archive at 05 Feb 2006 07:53 PM. Topic has 3 replies.